identify and fix common linearization issues
if your linearization results are not as expected, you can identify common linearization issues using the linearization advisor. the linearization advisor collects diagnostic information regarding individual block linearizations. using this information, you can:
view linearization details and operating points for each linearized block in your model.
identify potentially problematic blocks that cause common linearization issues.
determine which blocks are on and off the linearization path and which blocks contribute to the model linearization result.
search linearization results for blocks that meet specified criteria.
enable linearization advisor
since collecting diagnostic information adds linearization overhead, the linearization advisor is disabled by default. to collect diagnostic information, you must enable the linearization advisor before you linearize your model.
to enable the linearization advisor, in the model linearizer, on the linear analysis tab, select linearization advisor.
when you select this option and linearize your model, the software opens an advisor tab for troubleshooting your linearization results.
tip
to make viewing the diagnostic information easier, you can minimize the data browser.
on the advisor tab, you can gain insight into your model linearization by querying the diagnostic information. to do so, use the built-in queries in the queries section, or create custom queries in the manage queries section.
when you run a query, the navigation tree lists the linearized blocks in your model that match the query search criteria. the tree structure reflects the model hierarchy.
to view a table of all blocks that match the search criteria, in the navigation tree, click the top-level model name. you can also view all blocks in a subsystem that satisfy the query by clicking the subsystem name. each entry in the table summarizes the linearization diagnostics for a single block.
to view detailed diagnostic information for a block in a table, in the corresponding row, click block info. you can troubleshoot the block linearization using the detailed diagnostic information. for more information, see .
for an example of interactive troubleshooting using the linearization advisor, see .
tip
if you close the advisor tab for a given linearization, you can reopen it from the plots and results tab.
in the linear analysis workspace, select the linearized model you want to troubleshoot. then, click view advisor. this option is only available if you enabled the linearization advisor before linearizing the model.
you can also create a object when you linearize models at the command line. you can then troubleshoot the linearization results using the and functions. for an example, see .
blocks that are potentially problematic for linearization
as a starting point for troubleshooting, the linearization advisor searches the linearization diagnostic information for blocks that can cause common linearization issues. these potentially problematic blocks are on the linearization path and satisfy at least one of the following criteria.
criteria | description |
---|---|
blocks with linearization diagnostic messages | diagnostic messages indicate blocks with configurations or linearizations that correspond to common linearization problems. |
blocks that linearize to zero | blocks with zero linearizations do not contribute to the linearization result and can remove other blocks from the linearization result. |
blocks with substituted linearizations | errors in defining substitute linearizations can be difficult to diagnose. |
for more information on the linearization path, see linearization path.
in the model linearizer, the diagnostic information for these blocks is listed on the advisor tab when the tab first opens. also, to access this diagnostic information at any time, in the queries section, click linearization advice.
you can troubleshoot the linearizations of these blocks using the linearization advisor. for more information on troubleshooting block linearizations using diagnostic information, see .
at the command line, the advise
function returns diagnostic
information for these blocks.
blocks with linearization diagnostic messages
linearization diagnostic messages indicate blocks with properties or linearizations that correspond to common linearization problems. fixing linearization issues identified in diagnostic messages is a good first step when troubleshooting your linearization.
some block configurations that can generate diagnostic messages include:
blocks with non-floating-point input or output signals and no predefined exact linearization. such blocks linearize to zero and generate diagnostic messages.
discontinuous blocks linearized at an operating point near a discontinuity. if such blocks are not treated as a gain during linearization, the software can generate diagnostic messages regarding their linearization.
blocks with least one input/output pair that linearizes to zero which causes a zero input/output pair in the overall model linearization.
blocks that do not support linearization because they do not have a predefined exact linearization and do not support numerical perturbation.
some diagnostic messages propose solutions to their corresponding linearization issues. for example, when an input signal is outside the saturation limits of a saturation block, the diagnostic message proposes treating the block as a gain during linearization.
blocks that linearize to zero
a common cause of linearization issues is a block that unexpectedly linearizes to a gain of zero. to diagnose the cause of a zero block linearization, you can consider:
any corresponding diagnostic messages. these messages can highlight common causes of zero linearizations and propose potential solutions.
the block operating point; that is the values of the block states and inputs at the model operating point used for linearization. for example, if the input to a saturation block is outside the block saturation limits, and the block is not configured to linearize as a gain, the block linearizes to zero.
the block parameters. for example, if a block is configured to use non-floating-point inputs or states and is linearized using numerical perturbation, it linearizes to zero.
a zero block linearization does not necessarily indicate a linearization
problem; that is, you may expect a block to linearize to zero under the expected
operating conditions of the model. for example, if a trigonometric
fcn block is configured as a sin
function and the
input value is π/2 at the model operating point, then the block linearizes to
zero.
blocks with substituted linearizations
errors in defining a custom block linearization can be difficult to diagnose. after fixing issues related to diagnostic messages and zero linearizations, if your model still does not linearize as expected, verify that any substituted block linearizations in your model are correct.
for more information on specifying substitute block linearizations, see .
find specific blocks in linearization results
if your model still does not linearize as you expect after fixing linearization issues related to potentially problematic blocks, you can query the linearization advisor for additional block diagnostic information. you can gain insight into your model linearization using this information. for example, you can investigate:
blocks that are linearized using numerical perturbation.
sampling rates of block linearizations in multirate models by finding blocks with a specified sample time.
blocks that have delays that can cause linearization issues.
blocks that are not on the linearization path.
for more information, see .
linearization path
the linearization path is the graphical connection in the simulink® model from the linearization inputs to the linearization outputs. a block is on the linearization path if at least one linearization input is connected to at least one linearization output through that block. for more information on specifying linearization inputs and outputs, see .
when a block is on the linearization path, its linearization can contribute to the overall model linearization. blocks that linearize to zero do not contribute to the model linearization and can prevent branches of the linearization path from contributing to the model linearization.
blocks that are not on the linearization path can still affect the linearization of other blocks, and therefore the model linearization, by modifying the operating points or parameters of the other blocks. for example, consider the following product block that is on the linearization path (highlighted in blue):
the constant block is not on the linearization path. however, the value of the constant affects the operating point of the product block, which in turn affects the linearization from the first input of the product block to the output.
highlight linearization path
to visualize the linearization path and view blocks that contribute to the model linearization, you can highlight the linearization path in the simulink model using the linearization advisor. a block is on the linearization path if there is a signal path from at least one linearization input to at least one linearization output that passes through the block.
after you linearize your model with the linearization advisor enabled, to highlight the linearization path, in the model linearizer, on the advisor tab, click highlight linearization path.
the software highlights the linearization path in the model, showing which blocks are on the path and which blocks contribute to the model linearization. blocks highlighted in:
blue are on the linearization path and numerically influence the model linearization.
red are on the linearization path, but have no influence on the model linearization due to at least one block on the linearization path that is linearized to zero.
gray are not on the linearization path and do not contribute to the model linearization.
to turn off the highlighting, close the linearization path dialog box.
you can also highlight the linearization path from the command line using the function.
troubleshoot batch linearizations
if you linearize your model at multiple operating points, you can troubleshoot each resulting linear model using linearization advisor.
after batch linearizing the model, on the advisor tab, in the select operating point drop-down list, select the operating point for which you want to troubleshoot the linearization.
if you batch linearized your model using:
parameter variation, the linearization summary shows the parameter values that correspond to the selected operating point.
multiple simulation snapshot times, the linearization summary shows the time at which the model was linearized.
multiple trimmed operating points, the linearization summary does not show additional information about the operating point. to view details about the operating points, on the linear analysis tab, in the operating point drop-down list, select the operating point array used for linearization. in the same drop-down list, select
edit
.then, in the edit dialog box, in the select operating point drop-down list, select an operating point. the location of the operating point in this drop-down list corresponds to the location in the drop-down list on the advisor tab.