MATLAB Examples

Linearize Plant at Command Line

This example shows how to linearize a plant subsystem in a Simulink® model 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 linearize this subsystem, first specify its block path.

blockpath = 'watertank/Water-Tank System';

Then, linearize the plant subsystem at the model operating point.

linsys1 = linearize(mdl,blockpath);

The model operating point consists of the initial state values and input signals stored in the model. For information on linearizing models at different operating points, see docid:slcontrol_ug#bso7hgx and docid:slcontrol_ug#bso7hhu.

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 docid:control_doccenter#linear-analysis.