Engee documentation

Discrete Derivative

Calculates the discrete time derivative.

discrete derivative

Description

Block Discrete Derivative 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 set using the parameters Gain value;

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

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

Ports

Input

# IN_1 — input signal
scalar | vector | matrix

Details

An 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.

Complex numbers support

Yes

Output

# OUT_1 — scaled discrete-time derivative
scalar | vector | matrix

Details

A scaled derivative over discrete time in the form of a scalar, vector or matrix.

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

Data types

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

Complex numbers support

Yes

Parameters

Main

# Gain value — scaling factor
Scalar / array of real numbers

Details

The scaling factor applied to the calculated derivative.

Default value

1.0

Program usage name

gainval

Tunable

No

Evaluatable

Yes

# Initial condition for previous weighted input K*u/Ts — initial condition
Scalar / array of real and/or complex numbers

Details

Initial condition for the previous scaled input value.

Default value

0.0

Program usage name

ICPrevScaledInput

Tunable

Yes

Evaluatable

Yes

Signal Attributes

# Output data type — output data type
Inherit: auto | Float64 | Float32 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Fixed-point

Details

Specify the type of output data. You can specify:

  • Data type inheritance Inherit: auto.

  • Embedded data type, e.g., Float32.

  • A fictionalised point data type Fixed-point.

Values

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

Default value

Inherit: auto

Program usage name

OutDataTypeStr

Tunable

No

Evaluatable

No

# Output fixed-point type — fixed-point output data type
Data type

Details

Specify the type of fixed-point output data.

Dependencies

This parameter appears when the parameters are set to Output data type is set to Fixed-point.

Default value

fixdt(1, 16, 0)

Program usage name

OutDataTypeStrFixed

Tunable

No

Evaluatable

Yes

# Integer rounding mode — rounding mode for fixed-point operations
Ceiling | Convergent | Floor | Nearest | Round | Zero

Details

Select the rounding mode for fixed-point operations. You can select:

  • Floor - rounds both positive and negative numbers downwards (towards negative infinity).

  • Ceiling - rounds both positive and negative numbers upwards (towards positive infinity).

  • Convergent - rounds the number to the nearest representable value. If the fractional part of a number ends in 5, the number is rounded to the nearest even integer.

  • Nearest - rounds the number to the nearest representable value. If the fractional part of the number ends in 5, the number is rounded upwards (towards positive infinity).

  • Round - rounds the number to the nearest representable value. If the fractional part of a number ends in 5, positive numbers are rounded upwards (towards positive infinity) and negative numbers are rounded downwards (towards negative infinity).

  • Zero - rounds the number towards zero.

The block parameters are always rounded to the nearest representable value.

Values

Ceiling | Convergent | Floor | Nearest | Round | Zero

Default value

Floor

Program usage name

RndMeth

Tunable

No

Evaluatable

No

# Saturate to max or min when overflows occur — overflow action method
Logical

Details

When this checkbox is selected, a value that exceeds the type boundaries is reset to the maximum or minimum value that the selected data type can represent. Otherwise, the overflow is carried over.

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

Default value

false (switched off)

Program usage name

DoSatur

Tunable

No

Evaluatable

No