Engee documentation

Discrete Derivative

Computation of the discrete time derivative.

discrete derivative

Description

The Discrete Derivative block calculates the discrete time derivative with an arbitrary coefficient using the formula:

,

where

  • and are input and output values of the block at the current time step, respectively.

  • - input values of the block at the previous time step.

  • - scaling factor, specified using the Gain value parameter.

  • - size of discrete modelling step, which should be fixed.

Do not use this block in subsystems with non-periodic runs, such as Function-Call subsystems. This configuration gives inaccurate results.

Ports

Input

Port_1 - input signal
scalar | vector | matrix

Input signal specified as a scalar, vector or matrix.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, fixed-point, Int128, UInt128.

Output

Port_1 - scaled derivative by discrete time
scalar | vector | matrix

Scaled discrete-time derivative as a scalar, vector or matrix.

The output signal data type is specified by the Output data type parameter.

*Output data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, fixed-point, Int128, UInt128.

Parameters

Main

Gain value - scale factor
1.0 (by default) | scalar | vector | matrix

The scaling factor applied to the calculated derivative is specified as a real scalar value.

Usage in program code

Block parameter

gainval

Values

scalar | vector | matrix

* By default*

1.0

Initial condition for previous weighted input K*u/Ts - initial condition
0.0 (by default) | scalar | vector | matrix

Initial condition for the previous scaled input value, specified as a scalar.

Usage in program code

Block parameter

ICPrevScaledInput

Values

scalar | vector | matrix

By default

0.0

Signal Attributes

Output data type - output data type
Inherit: auto (by default) | Float64 | Float32 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Fixed-point

Specify the type of output data. You can specify:

  • Inherit: auto data type inheritance.

  • An inherited data type, such as Float32.

  • Fixed-point data type Fixed-point.

Usage in program code

Block parameter

OutDataTypeStr

Values

Inherit: auto | Float64 | Float32 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Fixed-point

By default

Inherit: auto

Output fixed-point type - fixed-point output data type
Fixed{Int16, 0} (By default) | description of fixed-point data type

Specify the fixed-point output data type.

Dependencies

This parameter appears when Fixed-point is selected for Output data type.

Usage in program code

Block parameter

OutDataTypeStrFixed

Values

OutDataTypeStrFixed description

By default

Fixed{Int16, 0}

Integer rounding mode - rounding mode for fixed point operations
Floor (by default) | Ceiling | Convergent | Nearest | Round | Zero

This option does not affect the rounding of block parameter values. Engee rounds such values to the nearest representable integer value.

Usage in program code

Block parameter

RndMeth RndMeth

Values

Ceiling | Convergent | Floor | Nearest | Round | Zero

* By default*

Floor

Saturate to max or min when overflows occur - method of action when overflows occur
off (by default) | on

When this flag is set, the overflowed value is reset to the maximum or minimum value that the selected data type can represent. Otherwise the overflow is carried over.

When this flag is set, saturation is applied to all internal operations in the block, not just the output data or result.

Usage in program code

Block parameter

DoSatur

Values

off | on

By default

off