Linearize Simulink Model at Command Line
This example shows how to linearize a Simulink® model at the model operating point using the docid:slcontrol_ug#bvflwv7 command.
Open Simulink model.
mdl = 'watertank'; open_system(mdl)
For this system, the Water-Tank System block contains all the nonlinear dynamics. To specify the portion of the model to linearize, create an array of linearization I/O objects using the docid:slcontrol_ug#bvhjpwl command.
Create an input perturbation analysis point at the output of the PID Controller block.
io(1) = linio('watertank/PID Controller',1,'input');
Create an open-loop output analysis point at the output of the Water-Tank System block. An open-loop output point is an output measurement followed by a loop opening, which removes the effects of the feedback signal on the linearization without changing the model operating point.
io(2) = linio('watertank/Water-Tank System',1,'openoutput');
For information on the different types of analysis points, see docid:slcontrol_ug#bsw97v9.
Linearize the model at the model operating point using the specified analysis points.
linsys1 = linearize(mdl,io);
linsys1 is the linear model from the specified input to the specified output, computed at the default model operating point.
You can then analyze the response of the linearized model. For example, plot its Bode response.
For more information on analyzing linear models, see docid:control_doccenter#linear-analysis.