Documentation Center

  • Trial Software
  • Product Updates

Contents

setlinio

Specify linearization input/output (I/O) points for Simulink model, Linear Analysis Plots block, or Model Verification block

Syntax

oldio = setlinio('sys',io)
oldio = setlinio('blockpath',io)

Alternatives

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.

Description

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.

oldio = setlinio('blockpath',io) assigns the settings in io as the linearization I/Os in a Linear Analysis Plots block or a Model Verification block. blockpath is the full path to the block.

Examples

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.

  1. Open a Simulink model.

    magball
    
  2. 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.

  3. 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:

  4. Create an I/O object with the getlinio function:

    io=getlinio('magball')
    
  5. Modify io to compute the plant transfer function. Edit the object or use the set function.

    io(2).Type='openoutput';
    
  6. Assign the new settings in io to the model.

    oldio=setlinio('magball',io)
    

    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.

  1. Open the watertank model, and specify input and output (I/O).

    1. Right-click the Desired Water Level output signal, and select Linear Analysis Points > Input Perturbation.

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

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

  3. 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
  4. Specify the linearization output to be open loop.

    io(2).Type = 'openoutput';

      Note:   The loop opening does not affect the model I/Os.

  5. Update the I/O in the Bode Plot block.

    oldio = setlinio('watertank/Bode Plot',io);

See Also

| | |

Was this topic helpful?