|On this page…|
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:
After linearizing the model, in the Linear Analysis tab of the Linear Analysis Tool, select the model of interest in the Select Result list.
In the Select Report list, select Show result details to open the Linearization result dialog box for the selected model.
|Where to Look||Learn More||Signs of Successful Linearization||Signs 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.
|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.
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.
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:
After linearizing the model, in the Linear Analysis tab, select the desired linear model from the Select Result list.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
In the Linear Analysis Tool, select the linear model for which to display linearization results.
In the Linear Analysis tab, use the Select Result list to select the model.
In the Select Report list, select Show diagnostic viewer to open the Diagnostic viewer dialog box.
In the Diagnostic viewer dialog box, click the Linearization Inspector tab.
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.
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.
Troubleshoot individual blocks.
|Block or Subsystem Type||Comment||Possible Fix|
|Incompatible with linearization||Some 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 subsystem||Linearization 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 blocks||The 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 block||Linearization 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|
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.
Incorrect sampling time and rate conversion method can cause poor linearization results in multirate models.
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:
In the Exact Linearization tab, click Options.
The Options for exact linearization dialog box opens.
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.
opt = linearizeOptions; opt.SampleTime = 0.01;
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:
Select Options in the Exact Linearization tab.
Click the Linearization tab to select the appropriate rate conversion method from the Choose rate conversion method list.
|Rate Conversion Method||When to Use|
|Zero-Order Hold||Use when you need exact discretization of continuous dynamics in the time-domain for staircase inputs.|
|Tustin||Use 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 Prewarping||Use 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.
opt = linearizeOptions; opt.RateConversionMethod = 'tustin';