Main Content


Linearize Simulink model with Uncertain State Space block



    ulin = ulinearize(mdl,io) linearizes the Simulink® model mdl, at the operating point specified in the model, using the analysis points specified by io. If you omit io, then ulinearize uses the root-level input and output ports in mdl. The function returns a uss model object ulin that represents the uncertain model response at those analysis points. ulin contains all the uncertain elements referenced by Uncertain State Space blocks in the linearization path.

    ulin = ulinearize(mdl,io,op) linearizes the model at operating point specified by op. This operating point can be an OperatingPoint object, a simulation snapshot time, or a vector of simulation snapshot times.

    ulin = ulinearize(mdl,op,blockname) returns the uncertain linearization of the Uncertain State Space block with the path specified by blockname.

    ulin = ulinearize(___,'StateOrder',stateorder) specifies the order of the non-uncertain states in the returned uss model. Specify the state order by listing them in the cell array stateorder. You can use this syntax with any of the previous input-argument combinations.

    ulin = ulinearize(___,options) uses additional options when computing the linearization. Specify the options using linearizeOptions (Simulink Control Design).


    collapse all

    Compute an uncertain linearization of a Simulink® model containing Uncertain State Space blocks. The model rct_ulinearize_uss has three such blocks, each of which references an uncertain uss model in its Uncertain system variable parameter:

    • Unmodeled Plant Dynamics — references input_unc

    • Uncertain Plant — references plant

    • Uncertain Sensor — references sensor

    Create these uncertain uss models.

    wt = makeweight(0.25,130,2.5);
    input_unc = ultidyn("input_unc",[1 1]);
    unc_pole = ureal("unc_pole",-5,"Range",[-10 -4]);
    plant = ss(unc_pole,5,1,0);
    sensor_pole = ureal("sensor_pole",-20,"Range",[-30 -10]);
    sensor = tf(1,[1/(-sensor_pole) 1]);

    Open the model.

    mdl = "rct_ulinearize_uss";

    The model also contains predefined linearization analysis points, an additive input point at the signal r and an output point at the signal y. Extract these points from the model in a linearization I/O object.

    io = getlinio(mdl);

    Compute the uncertain linearization of the model. If you do not specify a linearization operating point, ulinearize uses the current operating point of the model.

    ulin = ulinearize(mdl,io);

    The resulting ulin is a uss model object representing the uncertain response of the model from r to y. The uss model contains all the uncertain variables referenced in the three Uncertain State Space blocks.

    Uncertain continuous-time state-space model with 1 outputs, 1 inputs, 5 states.
    The model uncertainty consists of the following blocks:
      input_unc: Uncertain 1x1 LTI, peak gain = 1, 1 occurrences
      sensor_pole: Uncertain real, nominal = -20, range = [-30,-10], 1 occurrences
      unc_pole: Uncertain real, nominal = -5, range = [-10,-4], 1 occurrences
    Type "ulin.NominalValue" to see the nominal value and "ulin.Uncertainty" to interact with the uncertain elements.

    Input Arguments

    collapse all

    Simulink model name, specified as a character vector or string. The model must be in the current working folder or on the MATLAB® path.

    Analysis points for linearizing the model, specified as a linearization I/O object or a vector of linearization I/O objects that represent inputs, outputs, and loop openings for linearization: To create io:

    • Define the inputs, outputs, and openings using the linio (Simulink Control Design) function.

    • If the inputs, outputs, and openings are specified in the Simulink model, extract these points from the model using the getlinio (Simulink Control Design) function.

    If you omit io, then linearize uses the root-level inports and outports of the model as analysis points.

    For more information on specifying linearization inputs, outputs, and openings, see Specify Portion of Model to Linearize (Simulink Control Design).

    Operating point for linearization, specified as one of the following:

    • OperatingPoint object, created using:

      • operpoint (Simulink Control Design)

      • findop (Simulink Control Design) with either a single operating point specification, or a single snapshot time.

    • Array of OperatingPoint objects, specifying multiple operating points. To create an array of OperatingPoint objects, you can:

    • Vector of positive scalars representing one or more simulation snapshot times. The software simulates sys and linearizes the model at the specified snapshot times.

    Path to block to linearize, specified as a string or character vector.

    State order in linearization results, specified as a cell array of block paths or state names. The order of the block paths and states in stateorder determines the order of the states in usys. Specify the state order as a cell array who cells contain the names of the blocks containing states in the model. For all blocks, you can enter block names as the full block path. For continuous blocks, you can alternatively enter block names as the user-defined unique state name.

    You can specify block paths for any blocks in mdl that have states, or any named states in mdl. You do not have to specify every block and state from mdl in stateorder. The states you specify appear first in usys, followed by the remaining states in their default order.

    Linearization algorithm options, specified as a linearizeOptions (Simulink Control Design) option set.

    Output Arguments

    collapse all

    Uncertain linearization result, returned as a uss model or an array of uss models (if you specify an array of operating points). ulin represents the uncertain model response at the specified operating point and analysis points. ulin contains all the uncertain elements referenced by Uncertain State Space blocks in the linearization path.

    Version History

    Introduced in R2009b