Troubleshooting Linearization

Linearization Troubleshooting Overview

Troubleshooting Checklist

If you do not get good linearization results, use the Linear Analysis Tool's troubleshooting tools. For example, use the Diagnostic Messages tab and the Linearization Inspector tab that are available in the Diagnostic viewer. To open the Diagnostic viewer, see Linearization Diagnostics.

You can also use Linearization result dialog box for troubleshooting. To open the Linearization result dialog box:

  1. After linearizing the model, in the Linear Analysis tab of the Linear Analysis Tool, select the model of interest in the Select Result list.

  2. In the Select Report list, select Show result details to open the Linearization result dialog box for the selected model.

Where to LookLearn MoreSigns of Successful LinearizationSigns of Unsuccessful Linearization

Linear analysis plot, generated after linearization.

Create plots, as described in Visualize Models.

Time- or frequency-domain plot characteristics (e.g., rise time, bandwidth) capture system dynamics.

Response plot characteristics do not capture the dynamics of your system.

For example, Bode plot gain is too large or too small, or pole-zero plot contains unexpected poles or zeros.

Linear model equations in the Linearization result details dialog box.

View other linear model representations, as described in State-Space, Transfer Function, and Zero-Pole-Gain Equations of Linear Model.

State-space matrices show expected number of states.

You might see fewer states in the linear model than in your Simulink® model because, in many cases, the path between linearization input and output points do not reach all the model states.

Poles and zeros are in correct location.

Results show only D = 0 or D = Inf.

Click in the Exact Linearization tab.

Highlighting Linearized Blocks

Highlighted blocks in the Simulink model that represent the portion of the model you wanted to linearize.

Missing blocks in the linearization path might indicate incorrect linearization input or output point placement, or that a critical block unexpectedly linearizes to zero, or that critical blocks are connected in a path to a block that linearizes to zero. See Check Linearization I/O Points Placement.

Extra blocks in the linearization path might indicate incorrect loop opening placement. See Check Loop Opening Placement.

Linearization diagnostics in the Diagnostic Messages tab of the Diagnostic viewer.

Linearization Diagnostics

Message indicates that there are no problematic blocks in the linearization.

One or more warnings about specific problematic blocks. See Check Individual Block Linearization Values.

State-Space, Transfer Function, and Zero-Pole-Gain Equations of Linear Model

You can view the linear model equations in the Linearization result dialog box of the Linear Analysis Tool.

To open the Linearization result details dialog box:

  1. After linearizing the model, in the Linear Analysis tab, select the desired linear model from the Select Result list.

  2. Select Show result details from the Select Report list.

    The Linearization result dialog box opens.

Linear model equations display in state-space form, by default. Alternatively, you can view the Zero Pole Gain or Transfer Function representation in the Display linearization result as list.

Linearization Diagnostics

You can view diagnostic information about the linearization of specific blocks in the Diagnostic Messages tab of the Diagnostic viewer of the Linear Analysis Tool. The Diagnostic Messages tab also suggests corrective actions.

Specifically, the Diagnostic Messages tab flags blocks with configuration warnings, unsupported blocks, and blocks that automatically linearize using numerical perturbation.

  1. In the Linear Analysis Tool, before linearizing the model, select the Launch Diagnostic Viewer check box in the Exact Linearization tab.

    This action ensures that the software logs the diagnostics for the linearized model.

    The Diagnostic Messages dialog for the model opens after you linearize the model.

      Tip   You can also open the Diagnostic viewer for a model by choosing the model in the Select Result list in the Linear Analysis tab of the Linear Analysis Tool. Then choose Show diagnostic viewer in the Select Report list.

  2. In the Diagnostic Messages dialog box, the Show diagnostics for drop-down list provides the following options:

    • all blocks in the Simulink model — Use when you suspect that certain blocks are inappropriately excluded from linearization. For example, blocks that linearize to zero (and shouldn't) are excluded from the linearization path.

    • blocks in the linearization path — Use when you are sure that all of the blocks that should be included in the linearization are included. That is, your linearization I/O points and any loop openings are set correctly, and blocks do not inappropriately linearize to zero.

    In this example, the model contains one block that is linearized using numerical perturbation.

  3. To investigate the flagged block, click the block link to highlight the corresponding block in the model.

    If the linearization results are poor, you can use the Linearization Inspector to explore linearization values of individual blocks.

Highlighting Linearized Blocks

You can highlight blocks in your model to help you diagnose linearization issues.

To highlight all of the blocks included in the linearization:

  • In the Linear Analysis Tool, click in the Exact Linearization tab.

    Blocks that linearize to zero do not appear highlighted in the model. Use the Simulink Control Design™ Diagnostic Messages tab to identify the blocks that cause the linearization of certain blocks to be zero.

To remove highlighting in the model:

  • In the Simulink model, select Display> Remove Highlighting.

 More About

Check Operating Point

To diagnose whether you used the correct operating point for linearization, simulate the model at the operating point you used for linearization.

The linearization operating point is incorrect when the critical signals in the model:

  • Have unexpected values.

  • Are not at steady state.

To fix problem, compute a steady-state operating point and repeat the linearization at this operating point.

 Related Examples

Check Linearization I/O Points Placement

After linearizing the model, highlight which block are included in the linearization.

Blocks might be missing from the linearization path for different reasons.

Incorrect placement linearization I/O points can result in inappropriately excluded blocks from linearization. To fix the problem, specify correct linearization I/O points and repeat the linearization.

Blocks that linearize to zero (and other blocks on the same path) are excluded from linearization. To fix this problem, troubleshoot linearization of individual blocks, as described in Check Individual Block Linearization Values.

 More About

Check Loop Opening Placement

Incorrect loop opening placement causes unwanted feedback signals in the linearized model.

To fix the problem, use block highlighting to identify which blocks are included in the linearization. If undesired blocks are included, place the loop opening on a different signal and repeat the linearization.

 More About

Check Phase of Frequency Response for Models with Time Delays

When the Bode plot shows insufficient lag in phase for a model containing time delays, the cause might be Padé approximation of time delays in your Simulink model.

See Models with Time Delays.

Check Individual Block Linearization Values

In the Linear Analysis Tool, check the Diagnostic Messages tab of the Diagnostic viewer for blocks with configuration warnings, unsupported blocks, and blocks that automatically linearize using numerical perturbation. Click the block link to view the highlighted block in the model.

After identifying the blocks flagged in the Diagnostic Messages tab, view the linearization values of these blocks in the Linearization Inspector tab of the Diagnostic viewer.

  1. In the Linear Analysis Tool, select the linear model for which to display linearization results.

    1. In the Linear Analysis tab, use the Select Result list to select the model.

    2. In the Select Report list, select Show diagnostic viewer to open the Diagnostic viewer dialog box.

    3. In the Diagnostic viewer dialog box, click the Linearization Inspector tab.

  2. Select the specific subsystem or block.

    For example, in the watertank model, select the Water-Tank System subsystem. Then, in Subsystem Blocks, select the Square Root block.

      Tip   Right-click anywhere in the Subsystem Blocks list, and select Show only blocks in linearization path. This action filters the list to include only the linearized blocks.

  3. Plot the response of the linearized block.

    For example, right-click the Square Root block under Subsystem Blocks, and select PlotBlock > Step Plot.

    The step response of the block is displayed.

  4. Troubleshoot individual blocks.

    Block or Subsystem TypeCommentPossible Fix
    Incompatible with linearizationSome blocks are implemented without analytic Jacobians and do not support numerical perturbation.Define custom linearization for affected block as an expression or function. See Controlling Block Linearization
    Event-based subsystemLinearization of event-based subsystems is zero because such subsystems do not trigger during linearization.When possible, specify a custom event-based subsystem linearization as a lumped average model or periodic function call subsystem. See Event-Based Subsystems (Externally Scheduled Subsystems).
    Simulink blocks in Discontinuities library, such as Deadzone, Saturation, and Quantizer blocksThe Discontinuities library blocks typically have poor linearization results when the operating point that is close to the discontinuity.

    If you want the linearization to be a gain of 1, select Treat as gain when linearizing in the block parameters dialog box.

    Define custom linearization for affected block as an expression or function. See Controlling Block Linearization.

    Model reference blockLinearization is not fully compatible with model reference blocks with Accelerator simulation mode.

    Always set each Model (model reference) block to use Normal simulation mode, instead of Accelerator mode.

    Blocks that linearize using numerical perturbation, instead of using preprogrammed analytic Jacobians

    Blocks that are located near discontinuous regions, such as S-Functions, MATLAB function blocks, or lookup tables, are sensitive to numerical perturbation levels. If the perturbation level is too small, the block linearizes to zero.

    Change the numerical perturbation level of the block. See Perturbation Level of Blocks Perturbed During Linearization.
     

    Blocks that have nondouble precision inputs signals and states linearize to zero.

    Use the Linearization Inspector tab to view the block linearization.

    Convert nondouble-precision data types to double precision. See Linearizing Blocks with Nondouble Precision Data Type Signals

Check Large Models

Troubleshooting the linearization of large models is easier using a divide-and-conquer strategy.

Systematically linearize specific model components independently and check whether that component has the expected linearization.

 Related Examples

Check Multirate Models

Incorrect sampling time and rate conversion method can cause poor linearization results in multirate models.

Change Sampling Time of Linear Model

The sampling time of the linear model displays in the Linearization results dialog box, below the linear equations.

By default, the software chooses the slowest sample time of the multirate model. If the default sampling time is not appropriate, specify a different linearization sample time and repeat.

In Linear Analysis Tool:

  1. In the Exact Linearization tab, click Options.

    The Options for exact linearization dialog box opens.

  2. In the Linearization tab, enter the desired sample time in the Enter sample time (sec) box. Press Enter.

    -1 specifies that the software linearizes at the slowest sample rate in the model.

    0 specifies a continuous-time linear model.

At the command line, specify the SampleTime linearization option.

For example:

opt = linearizeOptions;
opt.SampleTime = 0.01; 

Change Linearization Rate Conversion Method

When you linearize models with multiple sample times, such as a discrete controller with a continuous plant, a rate conversion algorithm generates a single-rate linear model. The rate conversion algorithm affects linearization results.

In the Linear Analysis Tool:

  1. Select Options in the Exact Linearization tab.

  2. Click the Linearization tab to select the appropriate rate conversion method from the Choose rate conversion method list.

    Rate Conversion MethodWhen to Use
    Zero-Order HoldUse when you need exact discretization of continuous dynamics in the time-domain for staircase inputs.
    TustinUse when you need good frequency-domain matching between a continuous-time system and the corresponding discretized system, or between an original system and the resampled system.
    Tustin with PrewarpingUse when you need good frequency domain matching at a particular frequency between the continuous-time system and the corresponding discretized system, or between an original system and the resampled system.
    Upsampling when possible (Zero-Order Hold, Tustin, and Tustin with Prewarping)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 sampling time of the original system. Otherwise, the software uses an alternate rate conversion method.

At the command line, specify the RateConversionMethod linearization option.

For example:

opt = linearizeOptions;
opt.RateConversionMethod = 'tustin'; 

 See Also

 Related Examples

Was this topic helpful?