When you linearize a Simulink® model, you can find blocks in your linearization result that match specific criteria using the Linearization Advisor. You can specify search criteria to find blocks that can:
Potentially cause linearization issues in your model, if your model does not linearize as expected. For more information on identifying and fixing linearization issues using the Linearization Advisor, see Identify and Fix Common Linearization Issues.
Help you gain insight into your model linearization, even if the model has linearized as expected.
You can also query the Linearization Advisor at the command line using the
function. For an example, see Troubleshoot Linearization Results at Command Line.
Searching the linearization results requires linearization diagnostic information. To collect this information, you must enable the Linearization Advisor before linearizing 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. You can then find blocks of interest in the linearization results by running queries with the Linearization Advisor.
After finding blocks of interest, you can examine the individual block linearizations using the linearization diagnostic information. For more information, see Block Linearization Troubleshooting.
The Linearization Advisor provides a set of built-in queries for searching your linearization results. These queries are useful for finding blocks that are potentially causing linearization issues. To run one of these queries, on the Advisor tab, in the Queries section, click the query.
|Built-In Query||Find Blocks That...|
|Linearization Advice||Are potentially problematic for linearization. This query is performed by default when the Advisor tab opens.|
|Diagnostics on Path||Are on the linearization path and that have diagnostic messages
regarding their linearization. This query is a subset of the
|Substitutions on Path||Are on the linearization path and have a custom block
linearization specified. This query is a subset of the
|Zero I/O Pair on Path||Are on the linearization path and have at least one input/output pair that linearizes to zero.|
|All Blocks on Path||Are on the linearization path; that is, blocks where at least one linearization input is connected to at least one linearization output through the block.|
The linearization advisor also provides a set of simple queries for searching your model. You can run these queries on their own or use them to create compound queries.
|Simple Query||Find Blocks That...|
|Are in the linearized model.|
|Linearize to zero.|
|Have a custom block linearization specified.|
|Are on the linearization path.|
|Numerically contribute to the model linearization result.|
|Are linearized using their defined exact linearization.|
|Are linearized using numerical perturbation.|
|Have diagnostic messages regarding their linearization.|
|Are of a specified type.|
|Have a specified number of inputs.|
|Have a specified number of states.|
|Have a specified number of outputs.|
|Have a specified sample time.|
|Have at least one input/output pair that linearizes to zero.|
To run a simple query, in the Model Linearizer, on the Advisor tab, click New Query.
In the Query Builder dialog box, configure the query. For example, create a query for finding all blocks that numerically contribute to the linearization result.
In the Query Name field, specify the name for the
In the drop-down list, select
If you select any of the following queries, specify the corresponding search parameter.
|Block Type — This parameter
corresponds to the |
|Inputs — Specify a positive integer.|
|States — Specify a positive integer.|
|Outputs — Specify a positive integer.|
|Sample Time — Specify a nonzero
scalar. To find continuous-time blocks, specify
To create and run the query, click Run Query. The software runs the query and, on the Advisor tab, displays the list of blocks that contribute to the model linearization.
The query is added to the Queries section.
You can also create compound queries by logically combining existing queries using And, Or, and Not logical operations. You can create a compound query using simple queries, built-in queries, or other compound queries.
To create a compound query, in the Query Builder dialog box, configure the query using multiple search criteria. For example, create a query to find all discrete-time blocks that are on the linearization path.
In the Query Name field, specify the name for the
Discrete on Path.
To find blocks on the linearization path, in the drop-down list, select
On Linearization Path.
To add another search criteria, click Add to Query. The software adds a second row to the search criteria. By default, the search criteria are combined using an And operation.
To find discrete-time blocks, first add a search criteria to find
continuous-time blocks. In the second row, in the drop-down list, select
Has 'Ts' Sample Time. Keep the default
Sample Time of
To find discrete-time blocks, in the second row, select Not.
Click Run Query.
Each time you create a custom query, the software adds it to the drop-down list of
search criteria in the Query Builder dialog box. You can then use your custom
queries to create more complex queries. For example, to find discrete-time blocks on
the linearization path that are linearized using numerical perturbation, create a
query that combines the
Discrete on Path custom query
Perturbed simple query using an