linearize simulink model at model operating point
if you do not specify an operating point when linearizing a simulink® model, the software uses the operating point specified in the model by default. the model operating point consists of the initial state and input signal values stored in the model.
for information on linearizing models at different operating points, see and .
linearize simulink model using model linearizer
this example shows how to linearize a simulink model at the operating point specified in the model using the .
open simulink model.
mdl = 'watertank';
open_system(mdl)
the water-tank system block represents the plant in this control system and includes all of the system nonlinearities.
to specify the portion of the model to linearize, first open the linearization tab. to do so, in the simulink window, in the apps gallery, click linearization manager.
to specify an analysis point for a signal, click the signal in the model. then, on the linearization tab, in the insert analysis points gallery, select the type of analysis point.
configure the output signal of the pid controller block as an input perturbation.
configure the output signal of the water-tank system block as an open-loop output. 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.
when you add linear analysis points, the software adds markers at their respective locations in the model. for more information on the different types of analysis points, see .
for more information on defining analysis points in a simulink model, see . alternatively, if you do not want to introduce changes to the simulink model, you can define analysis points using the model linearizer. for more information, see .
to open model linearizer for the model, in the simulink model window, in the apps gallery, click model linearizer.
to use the analysis points you defined in the simulink model as linearization i/os, on the linear
analysis tab, in the analysis i/os drop-down
list, leave model i/os
selected.
for this example, use the model operating point for linearization. in the
operating point drop-down list, leave model
initial condition
selected.
to linearize the system and generate a response plot for analysis, in the linearize section, click a response. for this example, to generate a bode plot for the resulting linear model, click bode.
the software adds the linearized model, linsys1
, to the
linear analysis workspace and generates a bode plot for the
model. linsys1
is the linear model from the specified input to
the specified output, computed at the default model operating point.
for more information on analyzing linear models, see .
you can also export the linearized model to the matlab® workspace. to do so, in the data browser, in the linear
analysis workspace right-click linsys1
and select
export to matlab workspace.
linearize simulink model at command line
this example shows how to linearize a simulink® model at the model operating point using the 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 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 .
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.
bode(linsys1)
for more information on analyzing linear models, see linear analysis.
see also
|