Linearize Multirate Models

You can linearize a Simulink® model that contains blocks with different sample times using Simulink Control Design™ software. By default, the linearization tools:

  • Convert sample times using a zero-order hold conversion method.

  • Create a linearized model with a sample time equal to the largest sample time of the blocks on the linearization path.

You can change either of these behaviors by specifying linearization options, which affects the linearization result.

For more information on how Simulink Control Design software linearizes multirate models, see Linearization of Multirate Models.

Change Sample Time of Linear Model

By default, the software chooses the largest sample time of the multirate model. If the default sample time is not appropriate for your application, you can specify a different sample time.

To specify the sample time of the linear model in the Linear Analysis Tool:

  1. On the Linear Analysis tab, click More Options.

  2. In the Options for exact linearization dialog box, on the Linearization tab, in the Enter sample time (sec) field, specify the sample time. You can specify any of the following values:

    • -1 — Use the largest sample time from the model.

    • 0 — Create a continuous-time model. In this case, the software creates a discrete-time model using the largest sample time from the model, then converts the resulting model to continuous time.

    • Positive scalar — Use the specified value for the sample time.

To specify the sample time of the linear model at the command line, create a linearizeOptions option set, and set the SampleTime option. For example:

opt = linearizeOptions;
opt.SampleTime = 0.01; 

You can then use this option set with linearize or slLinearizer.

Change Linearization Rate Conversion Method

When you linearize models with multiple sample times, such as a discrete controller with a continuous plant, the software uses a rate conversion algorithm to create a single-rate linear model. The default rate conversion method is zero-order hold.

To specify the rate conversion method in the Linear Analysis Tool:

  1. On the Linear Analysis tab, click More Options.

  2. In the Options for exact linearization dialog box, on the Linearization tab, in the Choose rate conversion method drop-down list, select one of the following rate conversion methods.

    Rate Conversion MethodWhen to Use
    Zero-Order HoldYou need exact discretization of continuous dynamics in the time domain for staircase inputs.
    TustinYou need good frequency-domain matching between a continuous-time system and the corresponding discretized system, or between an original system and a resampled system.
    Tustin with PrewarpingYou need good frequency-domain matching at a particular frequency between a continuous-time system and the corresponding discretized system, or between an original system and the resampled system.
    Upsampling when possible, Zero-Order Hold otherwise
    Upsampling when possible, Tustin otherwise
    Upsampling when possible, Tustin with Prewarping otherwise
    Upsample discrete states when possible to ensure gain and phase matching of upsampled dynamics. You can only upsample when the new sample time is an integer multiple of the sample time of the original system. Otherwise, the software uses the alternate rate conversion method.
  3. If you select either of the following rate conversion methods:

    • Tustin with Prewarping

    • Upsampling when possible, Tustin with Prewarping otherwise

    then, in the Enter prewarp frequency field, specify the prewarp frequency.

To specify the rate conversion method at the command line, create a linearizeOptions option set, and set the RateConversionMethod and PreWarpFreq options. For example:

opt = linearizeOptions;
opt.RateConversionMethod = 'prewarp';
opt.PreWarpFreq = 100;

You can then use this option set with linearize or slLinearizer.

Note

If you use a rate conversion method other than zero-order hold, the converted states no longer have the same physical meaning as the original states. As a result, the state names in the resulting LTI system are '?'.

See Also

Apps

Functions