Specify linearization input/output (I/O) points for Simulink model, Linear Analysis Plots block, or Model Verification block
oldio = setlinio('sys',io)
oldio = setlinio('blockpath',io)
As an alternative to the setlinio function, edit linearization I/Os annotated in the Simulink® model using the:
Exact Linearization tab of the Linear Analysis Tool. In the Setup section, click to view and edit the linearization I/Os. The icon appears only when Analysis I/Os is set to Model I/Os.
Linearization inputs/outputs table and Click a signal in the model to select it in the Linearizations tab of the Block Parameters dialog box for Linear Analysis Plots or Model Verification blocks.
oldio = setlinio('sys',io) assigns the settings in the vector of linearization input/output (I/O) objects, io, to the Simulink model, sys. These settings appear as annotations on the signal lines. oldio contains the old I/O settings. Use the function getlinio or linio to create the linearization I/O objects. You can save I/O objects to disk in a MAT-file and use them later to restore linearization settings in a model.
This example shows how to assign linearization input/output settings to a Simulink model.
Before assigning I/O settings to a Simulink model using setlinio, you must create a vector of I/O objects representing linearization annotations, such as input points or output points, on a Simulink model.
Open a Simulink model.
Right-click the signal line between the Magnetic Ball Plant and the Controller. Select Linear Analysis Points > Input Perturbation to place an input point on this signal line. A small arrow pointing to a small circle just above the signal line represents the input point. The input point is not the output of the block, rather it is an additive input to the signal.
Right-click the signal line after the Magnetic Ball Plant. Select Linear Analysis Points > Output Measurement from the menu to place an output point on this signal line.
The model diagram should now look similar to the following figure:
Create an I/O object with the getlinio function:
Modify io to compute the plant transfer function. Edit the object or use the set function.
Assign the new settings in io to the model.
This assignment returns the old I/O settings (that have been replaced by the settings in io).
2x1 vector of Linearization IOs: -------------------------- 1. Linearization input perturbation located at the following signal: - Block: magball/Controller - Port: 1 2. Linearization output measurement located at the following signal: - Block: magball/Magnetic Ball Plant - Port: 1
The model diagram now looks similar to the following figure.
Update linearization input/output settings in a Linear Analysis Plots block
This example shows how to update linearization input/output settings in a Linear Analysis Plots block.
Open the watertank model, and specify input and output (I/O).
Right-click the Desired Water Level output signal, and select Linear Analysis Points > Input Perturbation.
Right-click the Water-Tank System output signal, and select Linear Analysis Points > Output Measurement.
The linearization I/O markers appear in the model, as shown in the next figure.
Alternatively, you can use linio.
Drag and drop a Bode Plot block from the Simulink Control Design™ Linear Analysis Plots library into the Simulink Editor. When you drag and drop the block, the block I/Os are set to the model I/Os.
Find all I/Os used by the Bode Plot block.
io = getlinio('watertank/Bode Plot')
The following results appear at the MATLAB® prompt:
2x1 vector of Linearization IOs: -------------------------- 1. Linearization input perturbation located at the following signal: - Block: watertank/Desired Water Level - Port: 1 2. Linearization output measurement located at the following signal: - Block: watertank/Water-Tank System - Port: 1
Specify the linearization output to be open loop.
io(2).Type = 'openoutput';
Update the I/O in the Bode Plot block.
oldio = setlinio('watertank/Bode Plot',io);