This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Linearize at Simulation Snapshot

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.

 Code Alternative

  1. Open the Simulink® model.

    sys = 'watertank';
    open_system(sys)

  2. Open the Linear Analysis Tool for the model.

    In the Simulink model window, select Analysis > Control Design > Linear Analysis.

  3. In the Simulink model window, define the portion of the model to linearize:

    • Right-click the PID Controller block output signal (input signal to the plant model). Select Linear Analysis Points > Input Perturbation.

    • Right-click the Water-Tank System output signal, and select Linear Analysis Points > Open-loop Output.

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

  5. 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, enter 10 to extract the operating point at this simulation time.

    Tip

    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.

  6. Generate the simulation-snapshot operating point. Click Take Snapshots.

    The operating point op_snapshot1 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.

  7. 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 linsys1 appears in the Linear Analysis Workspace.

  8. Double click 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.

  9. Close Simulink model.

    bdclose(sys);

Related Topics