Contents

linio

Define linearization input/output (I/O) points for Simulink model

Syntax

io = linio('blockname', portnum)
io = linio('blockname', portnum, type)
io = linio('blockname', portnum, type, [], 'buselementname')

Alternatives

As an alternative to linio, create linearization I/O settings by using the right-click menu on the signal in the model diagram or in the Linear Analysis Tool.

Description

io = linio('blockname', portnum) creates a linearization input/output (I/O) object for the signal that originates from the outport with port number portnum of the block blockname in a Simulink® model. The default I/O type is 'input' which applies an additive input to the signal. Use io with linearize to create linearized models.

io = linio('blockname', portnum, type) specifies the type of linearization I/O. type must be one of the following strings:

  • 'openinput' — Open-loop input. Specifies a linearization input point after a loop opening.

    Typically, you use this input type with an open-loop linearization output to linearize a plant or controller.

    For example, to compute the plant transfer function, G, in the following feedback loop, specify the linearization points as shown:

    Similarly, you can compute the controller transfer function, K, by specifying openinput at the input signal and open-loop linearization output at the output signal of the Controller block.

  • 'openoutput' — Open-loop output. Specifies a linearization output point before a loop opening.

    Typically, you use this output type with an open-loop linearization input openinput or input perturbation input to linearize a plant or controller, as shown in the preceding figure.

  • 'looptransfer' — Loop transfer. Specifies an output point before a loop opening followed by an input.

    Use this input/output type to compute the open-loop transfer function around the loop.

    For example, to compute -GK in the following feedback loop, specify the linearization input/output point as shown:

    Similarly, compute -KG by specifying looptransfer at the output signal of the Controller block.

  • 'input' — Input perturbation. Specifies an additive input to a signal.

    For example, to compute the response -K/(1+KG) of the following feedback loop, specify an input perturbation and an output measurement point as shown:

    Similarly, you can compute G/(1+GK) using input at the output signal of the Controller block and an output measurement output at the output signal of the Plant block.

  • 'output' — Output measurement. Takes measurement at a signal.

    For example, to compute the response -K/(1+KG), specify an output measurement point and an input perturbation as shown in the preceding figure.

  • 'loopbreak' — Loop break. Specifies a loop opening.

    Use to compute open-loop transfer function around a loop. Typically, you use this input/output type when you have nested loops or want to ignore the effect of some loops.

    For example, to compute the inner loop seen by K1 and exclude the outer loop, specify the input/output points and loopbreak as shown:

  • 'sensitivity' — Sensitivity. Specifies an additive input followed by an output measurement.

    Use to compute sensitivity transfer function for an additive disturbance at the signal.

    For example, compute the input/load sensitivity, 1/(1+KG), in the following feedback loop, specify the linearization input/output point as shown:

    Similarly, compute output sensitivity at the plant output, 1/(1+GK), by specifying a sensitivity input/output point at the output signal of the Plant block.

  • 'compsensitivity' — Complementary sensitivity. Specifies an output followed by an additive input.

    Use to compute closed-loop transfer function around the loop.

    For example, to compute -GK/(1+GK) (the transfer function from r to y) in the following feedback loop, specify the linearization input/output point at the output signal of the Plant block as shown:

io = linio('blockname', portnum, type, [], 'buselementname') creates a linearization I/O object for the element buselementname at the bus signal that originates from the portnum of blockname.

Examples

This example shows how to create linearization I/O settings for a Simulink model.

  1. Create an I/O setting for the signal originating from the Controller block of the magball model.

    io(1)=linio('magball/Controller',1)
    

    By default, this I/O is an input point that specifies an additive input to the signal.

    1x1 vector of Linearization IOs: 
    --------------------------
    1. Linearization input perturbation located at the following signal:
    - Block: magball/Controller
    - Port: 1
  2. Create a second I/O setting within the object, io.

    io(2)=linio('magball/Magnetic Ball Plant',1,'openoutput')
    

    This I/O originates from the Magnetic Ball Plant block, is an output point and is also an open-loop point.

    1x2 vector of Linearization IOs: 
    --------------------------
    1. Linearization input perturbation located at the following signal:
    - Block: magball/Controller
    - Port: 1
    
    2. Linearization open-loop output located at the following signal:
    - Block: magball/Magnetic Ball Plant
    - Port: 1

Select Individual Bus Element as Linearization I/O point

This example shows how to create a linearization I/O setting for individual bus elements in a bus signal.

  1. Open Simulink model.

    mdl = 'scdbusselection';
    open_system(mdl);
    
  2. Specify to linearize the Counter block using linearization I/O points on an individual bus element.

    io(1) = linio('scdbusselection/COUNTERBUSCreator',1,'input',[],...
    		    'limits.upper_saturation_limit');
    io(2) = linio('scdbusselection/CounterA',1,'output',[],...
    			'limits.upper_saturation_limit');
  3. Update the model to reflect the linearization I/O object.

    setlinio(mdl,io)
    set_param(mdl,'ShowLinearizationAnnotations','on');

    The linearization I/O markers appear in the model. Use these markers to visualize your linearization points.

  4. Linearize the model at the model operating point.

    sys = linearize(mdl,io);
Was this topic helpful?