Transfer Function Blocks
Linear transfer functions in the Laplace domain, several with non-windup output or rate limits.
Transfer function between input and output: one time constant.
Syntax
& tf1pname of variable x_iname of variable x_jdata name, parameter name or math expression for Gdata name, parameter name or math expression for TInternal States
None.
Discrete Variables
None.
Equations
Notes
The time constant can be zero, in which case the block behaves as a simple gain .
tf1plim
Section titled “tf1plim”Transfer function between input and output: one time constant with non-windup limits on output.
Syntax
& tf1plimname of variable x_iname of variable x_jdata name, parameter name or math expression for Gdata name, parameter name or math expression for Tdata name, parameter name or math expression for x_mindata name, parameter name or math expression for x_maxInternal States
None.
Discrete Variables
Equations
Discrete Transitions
if z = 0: if x_j > x_max: z ← 1 else if x_j < x_min: z ← -1else if z = 1: if G*x_i - x_j < 0: z ← 0else if z = -1: if G*x_i - x_j > 0: z ← 0Initialization
if x_j >= x_max: z ← 1else if x_j <= x_min: z ← -1else: z ← 0Notes
The time constant can be zero. In this case the block behaves as a gain () but the limits and remain in effect.
tf1pvlim
Section titled “tf1pvlim”Transfer function between input and output: one time constant with non-windup limits on output. The limits are variables.
This block is identical in behaviour to tf1plim except that and are variable states rather than fixed data parameters.
Syntax
& tf1pvlimname of variable x_iname of variable x_jname of variable x_minname of variable x_maxdata name, parameter name or math expression for Gdata name, parameter name or math expression for TInternal States
None.
Discrete Variables
Equations
Discrete Transitions
if z = 0: if x_j > x_max: z ← 1 else if x_j < x_min: z ← -1else if z = 1: if G*x_i - x_j < 0: z ← 0else if z = -1: if G*x_i - x_j > 0: z ← 0Initialization
if x_j >= x_max: z ← 1else if x_j <= x_min: z ← -1else: z ← 0Notes
The time constant can be zero. In this case the block behaves as a gain () but the variable limits remain in effect.
tf1p2lim
Section titled “tf1p2lim”Transfer function between input and output: one time constant, with limits on rate of change of output and non-windup limits on output.
Syntax
& tf1p2limname of variable x_iname of variable x_jdata name, parameter name or math expression for Gdata name, parameter name or math expression for Tdata name, parameter name or math expression for x_mindata name, parameter name or math expression for x_maxdata name, parameter name or math expression for dx_min/dtdata name, parameter name or math expression for dx_max/dtInternal States
, initialized at
Discrete Variables
(rate limiter) and (output limiter)
Equations
(resp. ) is the maximum (resp. Minimum) rate of change of with time.
Discrete Transitions
# Rate limiter (z_1):if z_1 = 0: if x_1 > T*dx_max: z_1 ← 1 else if x_1 < T*dx_min: z_1 ← -1else if z_1 = 1: if G*x_i - x_j < T*dx_max: z_1 ← 0else if z_1 = -1: if G*x_i - x_j > T*dx_min: z_1 ← 0
# Output limiter (z_2):if z_2 = 0: if x_j > x_max: z_2 ← 1 else if x_j < x_min: z_2 ← -1else if z_2 = 1: if x_1 < 0: z_2 ← 0else if z_2 = -1: if x_1 > 0: z_2 ← 0Initialization
if G*x_i - x_j > T*dx_max: z_1 ← 1else if G*x_i - x_j < T*dx_min: z_1 ← -1else: z_1 ← 0
if x_j > x_max: z_2 ← 1else if x_j < x_min: z_2 ← -1else: z_2 ← 0Notes
The time constant can be zero. In this case throughout the simulation, the block behaves as a gain , and both limiters are ignored (, , , ).
tf1p2limr
Section titled “tf1p2limr”As tf1p2lim, with one time constant, rate limits and non-windup output limits, plus an integrator reset.
The block behaves exactly like tf1p2lim until the reset condition is met. When the parameter becomes equal to the flag , the internal state is driven to zero and the block passes its input straight through () until the condition clears. The flag is intended to be set during the simulation with a CHGPRM disturbance, which makes the reset controllable from the disturbance file.
Uses the same block diagram as tf1p2lim.
Syntax
& tf1p2limrname of variable x_iname of variable x_jdata name, parameter name or math expression for Gdata name, parameter name or math expression for Tdata name, parameter name or math expression for x_mindata name, parameter name or math expression for x_maxdata name, parameter name or math expression for dx_min/dtdata name, parameter name or math expression for dx_max/dtdata name, parameter name or math expression for the reset parameterdata name, parameter name or math expression for the reset flagThe two trailing arguments are the only difference from tf1p2lim.
Internal States
As tf1p2lim.
Discrete Variables
As tf1p2lim, plus the reset state: the block switches to the pass-through equation while the reset is active.
tf1p1z
Section titled “tf1p1z”Transfer function between input and output: one zero and one pole.
The transfer function is .
Syntax
& tf1p1zname of variable x_iname of variable x_jdata name, parameter name or math expression for Gdata name, parameter name or math expression for T_zdata name, parameter name or math expression for T_pInternal States
Discrete Variables
None.
Equations
Initialization
Notes
- is allowed: the block reduces to (i.e.,
tf1p). - is formally allowed but produces a pure differentiator ; undesired transients may occur at discontinuities of or .
- : is initialized to zero and remains zero, giving .
tf2p2z
Section titled “tf2p2z”Transfer function between input and output: two real zeros and two real poles.
The transfer function is .
Syntax
& tf2p2zname of variable x_iname of variable x_jdata name, parameter name or math expression for Gdata name, parameter name or math expression for n_1data name, parameter name or math expression for n_2data name, parameter name or math expression for d_1data name, parameter name or math expression for d_2Internal States
and
Discrete Variables
None.
Equations
State-space controllable canonical form:
Initialization
Notes
Exception. If , both and are set to zero and the transfer function reduces to:
as in the tf1p1z block. If additionally , both and are set to zero and the block becomes a simple gain .
tfder1p
Section titled “tfder1p”Transfer function: derivative with one time constant.
The transfer function is .
Syntax
& tfder1pname of variable x_iname of variable x_jdata name, parameter name or math expression for Gdata name, parameter name or math expression for TInternal States
Discrete Variables
None.
Equations
Initialization
Notes
The model allows . In this case as expected; the second equation is formally retained but becomes redundant.
See Also
Section titled “See Also”- Block Index, all CODEGEN blocks by category
- CODEGEN Model Examples, complete models built from these blocks
- User-Defined Models, the DSL file format