Main Content

linqueryContributesToLinearization

Query object for finding blocks that contribute to the model linearization result

Description

linqueryContributesToLinearization creates a custom query object for finding all the blocks that numerically contribute to the model linearization result.

When you linearize a Simulink® model, you can create a LinearizationAdvisor object that contains diagnostic information about individual block linearizations. To find block linearizations that satisfy specific criteria, you can use the find function with custom query objects. Alternatively, you can analyze linearization diagnostics using the Linearization Advisor in the Model Linearizer. For more information on finding specific blocks in linearization results, see Find Blocks in Linearization Results Matching Specific Criteria.

Creation

Description

query = linqueryContributesToLinearization creates a query object for finding all the blocks in a LinearizationAdvisor object that numerically contribute to the model linearization result.

example

Properties

expand all

Query type, specified as 'Contributes to Linearization'.

Query description, specified as 'Blocks that Contribute to the Model Linearization'. You can add your own description to the query object using this property.

Usage

After creating a linqueryContributesToLinearization query object, you can:

  • Find all the blocks in a LinearizationAdvisor object that numerically contribute to the model linearization result by using the linqueryContributesToLinearization query directly with the find command.

  • Create a CompoundQuery object by logically combining the linqueryContributesToLinearization query with other query objects.

Object Functions

findFind blocks in linearization results that match specific criteria

Examples

collapse all

Load the Simulink model.

mdl = 'scdspeed';
load_system(mdl)

Linearize the model, and obtain the LinearizationAdvisor object.

opts = linearizeOptions('StoreAdvisor',true);
io(1) = linio('scdspeed/throttle (degrees)',1,'input');
io(2) = linio('scdspeed/rad//s to rpm',1,'output');
[sys,op,info] = linearize(mdl,io,opts);
advisor = info.Advisor;

Create query object, and find all blocks that numerically contribute to the model linearization result.

qContribute = linqueryContributesToLinearization;
advContribute = find(advisor,qContribute)
advContribute = 
  LinearizationAdvisor with properties:

               Model: 'scdspeed'
      OperatingPoint: [1x1 opcond.OperatingPoint]
    BlockDiagnostics: [1x22 linearize.advisor.BlockDiagnostic]
           QueryType: 'Contributes to Linearization'

To find blocks that do not contribute to the linearization result, use the same query object with a NOT (~) logical operator.

advNoContribute = find(advisor,~qContribute)
advNoContribute = 
  LinearizationAdvisor with properties:

               Model: 'scdspeed'
      OperatingPoint: [1x1 opcond.OperatingPoint]
    BlockDiagnostics: [1x5 linearize.advisor.BlockDiagnostic]
           QueryType: '~(Contributes to Linearization)'

Alternative Functionality

App

You can also create custom queries for finding specific blocks in linearization results using the Linearization Advisor in the Model Linearizer. For more information, see Find Blocks in Linearization Results Matching Specific Criteria.

Version History

Introduced in R2017b