Main Content

Specify Portion of Model to Linearize at Command Line

To specify the portion of your Simulink® model to linearize, you can define linear analysis points at the command line using the linio, setlinio, and getlinio functions. Analysis points represent linearization inputs, outputs, and loop openings for your model. Using this method, you can specify multiple sets of analysis points without changing your model.

Alternatively, you can define analysis points:

Specify Analysis Points

To specify analysis points at the command line, create linearization I/O objects using the linio function. To create an analysis point at the output port of a block in your model, use the following syntax:

io = linio(block,port,type);

where

  • block is the full block path of the block, specified as a character vector.

  • port is the output port number.

  • type is the analysis point type, specified as one of the following:

    • 'input' — Input perturbation

    • 'output' — Output measurement

    • 'loopbreak' — Loop break

    • 'openinput' — Open-loop input

    • 'openoutput' — Open-loop output

    • 'looptransfer' — Loop transfer

    • 'sensitivity' — Sensitivity

    • 'compsensitivity' — Complementary sensitivity

For more information on analysis point types, see Specify Portion of Model to Linearize.

After creating an analysis point, you can change its type using dot notation. For example, to change an analysis point to be an open-loop output, use:

io.Type = 'openoutput';

You can also specify analysis points on bus elements in your model. For an example, see linio.

To specify multiple analysis points, create a vector of linearization I/O objects. For example, create a set of analysis points that includes an input perturbation, an output measurement, and a loop opening.

io(1) = linio(block1,port1,'input');
io(2) = linio(block2,port2,'output');
io(3) = linio(block3,port3,'loopbreak');

To linearize your model using the specified analysis points, use the linearize function.

Save Analysis Points in Simulink Model

You can save your specified analysis points in your Simulink model using the setlinio function.

setlinio(mdl,io);

Here, mdl is a character vector specifying the name of a model in the current working folder or on the MATLAB® path, and io is a vector of linearization I/O objects.

The analysis points in io overwrite any existing analysis points saved in the model.

Alternatively, you can specify analysis points directly in your model. For more information, see Specify Portion of Model to Linearize in Simulink Model.

Obtain Analysis Points from Simulink Model

To linearize your model with the linearize function using the analysis points saved in the model, you must first extract the analysis points using the getlinio function.

io = getlinio(mdl);

Here, mdl is a character vector specifying the name of a model in the current working folder or on the MATLAB path.

See Also

| | |

Related Topics