Skip to content

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.

tf1p block diagram

Syntax

& tf1p
name of variable x_i
name of variable x_j
data name, parameter name or math expression for G
data name, parameter name or math expression for T

Internal States

None.

Discrete Variables

None.

Equations

Tx˙j=xj+GxiT \, \dot{x}_j = -x_j + G \, x_i

Notes

The time constant TT can be zero, in which case the block behaves as a simple gain xj=Gxix_j = G \, x_i.


Transfer function between input and output: one time constant with non-windup limits on output.

tf1plim block diagram

Syntax

& tf1plim
name of variable x_i
name of variable x_j
data name, parameter name or math expression for G
data name, parameter name or math expression for T
data name, parameter name or math expression for x_min
data name, parameter name or math expression for x_max

Internal States

None.

Discrete Variables

z{1,0,1}z \in \{-1, 0, 1\}

Equations

{Tx˙j=Gxixjif z=00=xjxmaxif z=10=xjxminif z=1\begin{cases} T \, \dot{x}_j = G \, x_i - x_j & \text{if } z = 0 \\ 0 = x_j - x_{max} & \text{if } z = 1 \\ 0 = x_j - x_{min} & \text{if } z = -1 \end{cases}

Discrete Transitions

if z = 0:
if x_j > x_max: z ← 1
else if x_j < x_min: z ← -1
else if z = 1:
if G*x_i - x_j < 0: z ← 0
else if z = -1:
if G*x_i - x_j > 0: z ← 0

Initialization

if x_j >= x_max: z ← 1
else if x_j <= x_min: z ← -1
else: z ← 0

Notes

The time constant TT can be zero. In this case the block behaves as a gain (xj=Gxix_j = G x_i) but the limits xminx_{min} and xmaxx_{max} remain in effect.


Transfer function between input and output: one time constant with non-windup limits on output. The limits are variables.

tf1pvlim block diagram

This block is identical in behaviour to tf1plim except that xminx_{min} and xmaxx_{max} are variable states rather than fixed data parameters.

Syntax

& tf1pvlim
name of variable x_i
name of variable x_j
name of variable x_min
name of variable x_max
data name, parameter name or math expression for G
data name, parameter name or math expression for T

Internal States

None.

Discrete Variables

z{1,0,1}z \in \{-1, 0, 1\}

Equations

{Tx˙j=Gxixjif z=00=xjxmaxif z=10=xjxminif z=1\begin{cases} T \, \dot{x}_j = G \, x_i - x_j & \text{if } z = 0 \\ 0 = x_j - x_{max} & \text{if } z = 1 \\ 0 = x_j - x_{min} & \text{if } z = -1 \end{cases}

Discrete Transitions

if z = 0:
if x_j > x_max: z ← 1
else if x_j < x_min: z ← -1
else if z = 1:
if G*x_i - x_j < 0: z ← 0
else if z = -1:
if G*x_i - x_j > 0: z ← 0

Initialization

if x_j >= x_max: z ← 1
else if x_j <= x_min: z ← -1
else: z ← 0

Notes

The time constant TT can be zero. In this case the block behaves as a gain (xj=Gxix_j = G x_i) but the variable limits remain in effect.


Transfer function between input and output: one time constant, with limits on rate of change of output and non-windup limits on output.

tf1p2lim block diagram

Syntax

& tf1p2lim
name of variable x_i
name of variable x_j
data name, parameter name or math expression for G
data name, parameter name or math expression for T
data name, parameter name or math expression for x_min
data name, parameter name or math expression for x_max
data name, parameter name or math expression for dx_min/dt
data name, parameter name or math expression for dx_max/dt

Internal States

x1x_1, initialized at min ⁣[max ⁣(0,Tx˙min),Tx˙max]\min\!\left[\max\!\left(0,\, T \, \dot{x}_{min}\right),\, T \, \dot{x}_{max}\right]

Discrete Variables

z1{1,0,1}z_1 \in \{-1, 0, 1\} (rate limiter) and z2{1,0,1}z_2 \in \{-1, 0, 1\} (output limiter)

Equations

{0=x1Gxi+xjif z1=00=x1Tx˙maxif z1=10=x1Tx˙minif z1=1\begin{cases} 0 = x_1 - G \, x_i + x_j & \text{if } z_1 = 0 \\ 0 = x_1 - T \, \dot{x}_{max} & \text{if } z_1 = 1 \\ 0 = x_1 - T \, \dot{x}_{min} & \text{if } z_1 = -1 \end{cases} {Tx˙j=x1if z2=00=xjxmaxif z2=10=xjxminif z2=1\begin{cases} T \, \dot{x}_j = x_1 & \text{if } z_2 = 0 \\ 0 = x_j - x_{max} & \text{if } z_2 = 1 \\ 0 = x_j - x_{min} & \text{if } z_2 = -1 \end{cases}

x˙max\dot{x}_{max} (resp. x˙min\dot{x}_{min}) is the maximum (resp. Minimum) rate of change of xjx_j 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 ← -1
else if z_1 = 1:
if G*x_i - x_j < T*dx_max: z_1 ← 0
else 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 ← -1
else if z_2 = 1:
if x_1 < 0: z_2 ← 0
else if z_2 = -1:
if x_1 > 0: z_2 ← 0

Initialization

if G*x_i - x_j > T*dx_max: z_1 ← 1
else if G*x_i - x_j < T*dx_min: z_1 ← -1
else: z_1 ← 0
if x_j > x_max: z_2 ← 1
else if x_j < x_min: z_2 ← -1
else: z_2 ← 0

Notes

The time constant TT can be zero. In this case x1=0x_1 = 0 throughout the simulation, the block behaves as a gain xj=Gxix_j = G x_i, and both limiters are ignored (xmaxx_{max} \to \infty, xminx_{min} \to -\infty, Tx˙maxT\dot{x}_{max} \to \infty, Tx˙minT\dot{x}_{min} \to -\infty).


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 presetp_{reset} becomes equal to the flag fresetf_{reset}, the internal state is driven to zero and the block passes its input straight through (xj=xix_j = x_i) 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

& tf1p2limr
name of variable x_i
name of variable x_j
data name, parameter name or math expression for G
data name, parameter name or math expression for T
data name, parameter name or math expression for x_min
data name, parameter name or math expression for x_max
data name, parameter name or math expression for dx_min/dt
data name, parameter name or math expression for dx_max/dt
data name, parameter name or math expression for the reset parameter
data name, parameter name or math expression for the reset flag

The 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 0=xjxi0 = x_j - x_i while the reset is active.


Transfer function between input and output: one zero and one pole.

tf1p1z block diagram

The transfer function is xj=G1+sTz1+sTpxi\displaystyle x_j = G \frac{1 + s T_z}{1 + s T_p} x_i.

Syntax

& tf1p1z
name of variable x_i
name of variable x_j
data name, parameter name or math expression for G
data name, parameter name or math expression for T_z
data name, parameter name or math expression for T_p

Internal States

x1x_1

Discrete Variables

None.

Equations

x˙1=Gxixj0=TpxjGTzxix1\begin{aligned} \dot{x}_1 &= G \, x_i - x_j \\ 0 &= T_p \, x_j - G \, T_z \, x_i - x_1 \end{aligned}

Initialization

x1=G(TpTz)xix_1 = G \, (T_p - T_z) \, x_i

Notes

  • Tz=0T_z = 0 is allowed: the block reduces to Tpx˙j=xj+GxiT_p \dot{x}_j = -x_j + G x_i (i.e., tf1p).
  • Tp=0T_p = 0 is formally allowed but produces a pure differentiator G(1+sTz)G(1 + sT_z); undesired transients may occur at discontinuities of xix_i or x˙i\dot{x}_i.
  • Tp=Tz=TT_p = T_z = T: x1x_1 is initialized to zero and remains zero, giving xj=Gxix_j = G x_i.

Transfer function between input and output: two real zeros and two real poles.

tf2p2z block diagram

The transfer function is xj=G(1+n1s)(1+n2s)(1+d1s)(1+d2s)xi\displaystyle x_j = G \frac{(1 + n_1 s)(1 + n_2 s)}{(1 + d_1 s)(1 + d_2 s)} x_i.

Syntax

& tf2p2z
name of variable x_i
name of variable x_j
data name, parameter name or math expression for G
data name, parameter name or math expression for n_1
data name, parameter name or math expression for n_2
data name, parameter name or math expression for d_1
data name, parameter name or math expression for d_2

Internal States

x1x_1 and x2x_2

Discrete Variables

None.

Equations

State-space controllable canonical form:

x˙1=x2d2x˙2=x1d1x2+d2xi0=G(d2n2)x1+G(n1d2d1n2)x2+Gn2d2xid22xj\begin{aligned} \dot{x}_1 &= x_2 \\ d_2 \, \dot{x}_2 &= -x_1 - d_1 x_2 + d_2 x_i \\ 0 &= G(d_2 - n_2) x_1 + G(n_1 d_2 - d_1 n_2) x_2 + G n_2 d_2 x_i - d_2^2 x_j \end{aligned}

Initialization

x2=0,x1=d2xix_2 = 0, \qquad x_1 = d_2 \, x_i

Notes

Exception. If d2<0.005d_2 < 0.005, both d2d_2 and n2n_2 are set to zero and the transfer function reduces to:

G1+n1s1+d1sG \frac{1 + n_1 s}{1 + d_1 s}

as in the tf1p1z block. If additionally d1<0.005d_1 < 0.005, both d1d_1 and n1n_1 are set to zero and the block becomes a simple gain xj=Gxix_j = G x_i.


Transfer function: derivative with one time constant.

tfder1p block diagram

The transfer function is xj=Gs1+sTxi\displaystyle x_j = \frac{G s}{1 + sT} x_i.

Syntax

& tfder1p
name of variable x_i
name of variable x_j
data name, parameter name or math expression for G
data name, parameter name or math expression for T

Internal States

x1x_1

Discrete Variables

None.

Equations

Tx˙1=xj0=Gxix1xj\begin{aligned} T \, \dot{x}_1 &= x_j \\ 0 &= G \, x_i - x_1 - x_j \end{aligned}

Initialization

x1=Gxix_1 = G \, x_i

Notes

The model allows T=0T = 0. In this case xj=0x_j = 0 as expected; the second equation is formally retained but becomes redundant.