Integrator Blocks
Integrators with a time constant, optionally bounded by fixed or variable non-windup limits.
Integrator with (positive) time constant .
Syntax
& intx_ix_j{T}x_i is the input, x_j is the integrated output, and T is the (positive) time constant (data name, parameter name, or math expression).
Internal states: none
Discrete variables: none
Equation
Notes
is not allowed. If is too small, the solver may encounter a singularity and the simulation may fail.
Integrator with (positive) time constant and non-windup limits on output.
Syntax
& inlimx_ix_j{T}{x_min}{x_max}x_i is the input, x_j is the limited integrated output. T is the time constant; x_min and x_max are constant output limits (data names, parameter names, or math expressions).
Internal states: none
Discrete variable:
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 x_i < 0: z ← 0else: # z = -1 if x_i > 0: z ← 0Initialization
if x_j > x_max: z ← 1else if x_j < x_min: z ← -1else: z ← 0Notes
The limits are non-windup: when the output reaches a limit, integration stops and the limit is enforced as an algebraic constraint. Integration resumes (in the direction away from the limit) once the input drives the output back into the feasible range.
is not allowed. If is too small, the solver may encounter a singularity and the simulation may fail.
invlim
Section titled “invlim”Integrator with (positive) time constant and non-windup limits on output. The lower and upper limits are variables.
Syntax
& invlimx_ix_minx_maxx_j{T}x_i is the input; x_min and x_max are variable (state) lower and upper limits; x_j is the limited integrated output; T is the time constant (data name, parameter name, or math expression).
Internal states: none
Discrete variable:
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 x_i < 0: z ← 0else: # z = -1 if x_i > 0: z ← 0Initialization
if x_j > x_max: z ← 1else if x_j < x_min: z ← -1else: z ← 0Notes
Unlike inlim, the bounds and are model states (variables) that can change during simulation, enabling dynamic limit adjustment.
The non-windup behaviour is identical to inlim: integration halts when a limit is reached and resumes once the input drives the output away from that limit.
is not allowed. If is too small, the solver may encounter a singularity and the simulation may fail.
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