This example shows how to use the Linear Analysis Tool to linearize a model at a trimmed steady-state operating point (equilibrium operating point).
The operating point is trimmed by specifying constraints on the operating point values, and performing an optimization search that meets these state and input value specifications.
Open the Simulink® model.
sys = 'magball'; 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 for this linearization task:
output signal (input signal to the plant). Select Linear Analysis Points > Input
Magnetic Ball Plant output
signal, and select Linear Analysis Points > Open-loop Output.
Annotations appear in the model indicating which signals are designated as linearization I/O points.
Tip Alternatively, if you do not want to introduce changes to the Simulink model, you can specify the linearization I/O points in the Linear Analysis Tool. See Specify Portion of Model to Linearize in Linear Analysis Tool.
Create a new steady-state operating point at which to linearize the model. In the Linear Analysis Tool, in the Operating Point drop-down list, select Trim model.
In the Trim the model dialog box, the Specifications tab shows the default specifications for model trimming. By default, all model states are specified to be at equilibrium, indicated by the check marks in the Steady State column.
Specify a steady-state operating point at which the magnetic ball height remains fixed at the reference signal value, 0.05. In the States tab, select Known for the height state. This selection tells Linear Analysis Tool to find an operating point at which this state value is fixed.
Since the ball height is greater than zero, the current
must also be greater than zero. Enter
0 for the
minimum bound of the Current block state.
Compute the operating point.
Click Start trimming.
A new variable,
op_trim1, appears 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 plot of the linearized plant appears, and the linearized plant
in the Linear Analysis Workspace.
Tip Instead of a Bode plot, generate other response types by clicking the corresponding button in the plot gallery.
Right-click on the plot and select information from the Characteristics menu to examine characteristics of the linearized response.