Engee documentation

Weighted Sample Time

Performs calculations that include a calculation step.

blockType: WeightedSampleTimeMath

Weighted Sample Time

Path in the library:

/Basic/Math Operations/Weighted Sample Time

Weighted Sample Time Math

Path in the library:

/Basic/Math Operations/Weighted Sample Time Math

Description

Block Weighted Sample Time adds, subtracts, multiplies or divides the input signal ( ) by a weighted calculation step ( ). If the input signal is continuous, is the calculation step of the model. Otherwise, is the sampling step of the input signal. If the input signal is constant, the block is assigned a final calculation step based on its connection and context.

The block icon changes depending on the operation selected in the Operation parameters and the value of Weight value.

The mathematical operation is specified by the parameters Operation. The block can also output the weighted calculation step (Ts Only) or weighted sampling rate (1/Ts Only).

The weighting factor is specified by the parameters Weight value. If the weight is 1.0, this value is not displayed in the equation on the block icon.

You can use the Weighted Sample Time block to extract the calculation step from the signal. To do this, set the parameters Operation to a value of Ts Only`and set the Weight value parameters to `1.0. In this configuration, the block outputs the calculation step of the input signal.

The block calculates the value of the output signal using the priority rules for operators. For example, if the parameter Operation is set to the value of +, the block calculates the output signal as follows:

.

However, if the parameter Operation is set to , the unit calculates the output signal as follows: . /, then the unit calculates the output signal as follows:

.

Ports

Input

# IN_1 — input signal
scalar | vector | matrix

Details

Input signal as a scalar, vector or matrix. Depending on the value of the parameter Operation, the block can add, subtract, multiply or divide the input signal by a weighted calculation step or simply output a weighted calculation step or weighted sampling rate.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Complex numbers support

No

Output

# OUT_1 — output signal
scalar | vector | matrix

Details

Weighted calculation step, the sampling rate of the input signal or the result of calculations involving a weighted calculation step ( ). If the input signal is continuous, then is the computation step of the model. Otherwise, is the sampling rate of the input signal. If the input signal is constant, the block is assigned a final calculation step based on its connection and context.

Data types

Float64.

Complex numbers support

No

Parameters

Main

# Weight value — calculation step weighting factor
Scalar / array of real and/or complex numbers

Details

Weight coefficient of the calculation step.

Default value

1.0

Program usage name

weightValue

Tunable

No

Evaluatable

Yes

# Operation — mathematical operation
+ | - | * | / | Ts Only | 1/Ts Only

Details

A mathematical operation applied to an input signal.

Values

+ | - | * | / | Ts Only | 1/Ts Only

Default value

Program usage name

TsampMathOp

Tunable

No

Evaluatable

No

Additional options

C code generation: Yes