Main Content

Linearize万博1manbetxModel 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, seeLinearize at Trimmed Operating PointandLinearize at Simulation Snapshot.

Linearize万博1manbetxModel UsingModel Linearizer

这个例子显示了如何使线性化模型国防部万博1manbetxel at the operating point specified in the model using theModel Linearizer.

Open Simulink model.

mdl = 'watertank'; open_system(mdl)

TheWater-Tank Systemblock 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 theLinearizationtab. To do so, in the Simulink window, in theAppsgallery, click线性化管理.

To specify an analysis point for a signal, click the signal in the model. Then, on theLinearizationtab, in theInsert Analysis Pointsgallery, select the type of analysis point.

  • Configure the output signal of thePID Controllerblock as anInput Perturbation.

  • Configure the output signal of theWater-Tank Systemblock as anOpen-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, seeSpecify Portion of Model to Linearize.

For more information on defining analysis points in a Simulink model, seeSpecify Portion of Model to Linearize in Simulink Model. Alternatively, if you do not want to introduce changes to the Simulink model, you can define analysis points using theModel Linearizer. For more information, seeSpecify Portion of Model to Linearize in Model Linearizer.

To open theModel Linearizerfor the model, in the Simulink model window, in theAppsgallery, clickModel Linearizer.

To use the analysis points you defined in the Simulink model as linearization I/Os, on theLinear Analysistab, in theAnalysis I/Osdrop-down list, leaveModel I/Osselected.

For this example, use the model operating point for linearization. In theOperating Pointdrop-down list, leaveModel Initial Conditionselected.

To linearize the system and generate a response plot for analysis, in theLinearizesection, click a response. For this example, to generate a Bode plot for the resulting linear model, clickBode.

The software adds the linearized model,linsys1, to theLinear Analysis Workspaceand generates a Bode plot for the model.linsys1is 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, seeAnalyze Results Using Model Linearizer Response Plots.

You can also export the linearized model to the MATLAB®workspace. To do so, in theData Browser, draglinsys1from theLinear Analysis Workspaceto theMATLAB Workspace.

Linearize Simulink Model at Command Line

This example shows how to linearize a Simulink® model at the model operating point using thelinearizecommand.

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 theliniocommand.

Create an input perturbation analysis point at the output of the PID Controller block.

io(1) = linio('watertank/PID Controller',1,“输入”);

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, seeSpecify Portion of Model to Linearize.

Linearize the model at the model operating point using the specified analysis points.

linsys1 = linearize(mdl,io);

linsys1is 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, seeLinear Analysis.

See Also

|

Related Topics