Specify D-Matrix System for Block Linearization Using
Function
This example shows how to specify custom linearization for a saturation block using a
function.
(^1) Open Simulink model.
sys = 'configSatBlockFcn';
open_system(sys)
In this model, the limits of the saturation block are -satlimit and satlimit. The
current value of the workspace variable satlimit is 10.
(^2) Linearize the model at the model operating point using the linear analysis points
defined in the model. Doing so returns the linearization of the saturation block.
io = getlinio(sys);
linsys = linearize(sys,io)
linsys =
D =
Constant
Saturation 1
Static gain.
At the model operating point, the input to the saturation block is 10. This value is
right on the saturation boundary. At this value, the saturation block linearizes to 1.
(^3) Suppose that you want the block to linearize to a transitional value of 0.5 when the
input falls on the saturation boundary. Write a function that defines the saturation
block linearization to behave this way. Save the function to the MATLAB path.
function blocklin = mySaturationLinearizationFcn(BlockData)
Augment the Linearization of a Block 2-
% based on the block input signal level, U:
Specify D-Matrix System for Block Linearization Using Function