Integration and Differentiation There are continuous and discrete integrator and derivative blocks.
Continuous Integrator There are various ways of configuring integrators with extra functionality using block parameters:
By default, the Initial Condition is set within the block,
however it can be set as a block input.
(set Initial Condition Source to External)
Limit the output to a maximum and minimum value
(tick Limit Output, adds saturation icon to block).
You can add an external reset signal, to force the output of the integrator back to its initial condi-
tion. You can configure the reset pin to act on a rising edge, falling edge or both.
Discrete Integrator For the discrete integrator block, you can specify whether to use forward or backward Euler, or the
Trapezoidal method. As with the continuous integrator block you can specify in the block
parameters if you want to define initial conditions externally or internally, set upper and lower
limits and set up a reset condition. You can also define an input gain value.
Continuous Derivative The derivative block approximates the derivative of the input signal
𝑢
with respect to the time
𝑡
,
by computing a numerical difference. Here
𝛥𝑢
is the change in input value and
𝛥𝑡
is the change in
time since the previous simulation (major) time step:
𝑦(𝑇
𝑐𝑢𝑟𝑟𝑒𝑛𝑡
) =
Δ𝑢
Δ𝑡
=
𝑢(𝑇
𝑐𝑢𝑟𝑟𝑒𝑛𝑡
) − 𝑢(𝑇
𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠
)
𝑇
𝑐𝑢𝑟𝑟𝑒𝑛𝑡
− 𝑇
𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠
The initial output for the block is zero.
Discrete Derivative The discrete derivative block computes an optionally scaled discrete time derivative with output:
𝑦(𝑇
𝑐𝑢𝑟𝑟𝑒𝑛𝑡
) =
𝐾𝑢(𝑇
𝑐𝑢𝑟𝑟𝑒𝑛𝑡
)
𝑇
𝑠
−
𝐾𝑢(𝑇
𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠
)
𝑇
𝑠
where
𝑇
𝑠
is the fixed simulation time step.