Documentation

linqueryAdvise

Query object for finding blocks that are potentially problematic for linearization

Description

linqueryAdvise creates a custom query object for finding the blocks in a linearization result that are potentially problematic for linearization.

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 Linear Analysis Tool. For more information on finding specific blocks in linearization results, see Find Blocks in Linearization Results Matching Specific Criteria.

Using the find function with a linqueryAdvise object is equivalent to using the advise function.

Creation

Syntax

query = linqueryAdvise

Description

example

query = linqueryAdvise creates a query object for finding all the blocks in a LinearizationAdvisor object that are potentially problematic for linearization.

Properties

expand all

Query type, specified as 'Linearization Advice'.

Query description, specified as 'Blocks that are Potentially Problematic for Linearization'. You can add your own description to the query object using this property.

Usage

After creating a linqueryAdvise query object, you can:

  • Find all the blocks in a LinearizationAdvisor object that are potentially problematic for linearization by using the linqueryAdvise query directly with the find command.

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

Object Functions

findFind blocks in linearization results that match specific criteria

Examples

expand all

Load the Simulink model.

mdl = 'scdpendulum';
load_system(mdl)

Linearize the model and obtain the LinearizationAdvisor object.

opts = linearizeOptions('StoreAdvisor',true);
io = getlinio(mdl);
[sys,op,info] = linearize(mdl,io,opts);
advisor = info.Advisor;

Create query object, and find all the linearized blocks that have potentially problematic linearizations.

qAdvise = linqueryAdvise;
advAdvise = find(advisor,qAdvise)
advAdvise = 
  LinearizationAdvisor with properties:

               Model: 'scdpendulum'
      OperatingPoint: [1x1 opcond.OperatingPoint]
    BlockDiagnostics: [1x3 linearize.advisor.BlockDiagnostic]
           QueryType: 'Linearization Advice'

Algorithms

Creating a linqueryAdvise object is equivalent to creating the following custom query:

qPath     = linqueryIsOnPath;
qZero     = linqueryIsZero;
qBlkRep   = linqueryIsBlockSubstituted;
qDiags    = linqueryHasDiagnostics;
  
q = qPath & (qZero | qDiags | qBlkRep);
 
advisor_new = find(advisor,q);

Alternative Functionality

App

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

Introduced in R2017b

Was this topic helpful?