This example shows how to use the Linear Analysis Tool to linearize a model by simulating the model and extracting the state and input levels of the system at specified simulation times.
Open the Simulink® model.
sys = 'watertank'; open_system(sys)
Open the Linear Analysis Tool for the model.
In the Simulink model window, select Analysis > Control Design > Linear Analysis.
In the Simulink model window, define the portion of the model to linearize:
PID Controller block
output signal (input signal to the plant model). Select Linear Analysis Points > Input
Water-Tank System output
signal, and select Linear Analysis Points > Open-loop Output.
Create a new simulation-snapshot operating point at which to linearize the model. In the Linear Analysis Tool, in the Operating Point drop-down list, select Take simulation snapshot.
In the Enter snapshot times to linearize
dialog box, in the Simulation Snapshot Times field,
enter one or more snapshot times at which to linearize. For this example,
10 to extract the operating point at this
To linearize the model at several operating points, specify
a vector of simulation times in the Simulation Snapshot
Times field. For example, entering
[1 10] results
in an array of two linear models, one linearized at
t = 1 and
the other at
t = 10.
Generate the simulation-snapshot operating point. Click Take Snapshots.
The operating point
in the Linear Analysis Workspace. In the Operating Point drop-down
list, this operating point is now selected as the operating point
to be used for linearization.
Linearize the model at the specified operating point and generate a bode plot of the result.
Click Bode. The Bode plot of the
linearized plant appears, and the linearized plant
in the Linear Analysis Workspace.
linsys1 in the Linear
Analysis Workspace to see the state space representation
of the linear model. Right-click on the plot and select information
from the Characteristics menu to examine
characteristics of the linearized response.
Close Simulink model.