Main Content

advise

Find blocks that are potentially problematic for linearization

Description

When you linearize a Simulink® model, you can create a LinearizationAdvisor object that contains diagnostic information about individual block linearizations. To search the LinearizationAdvisor object for diagnostics of blocks that are potentially problematic for linearization, use the advise function.

advise(advisor) opens the Model Linearizer with an Advisor tab open for troubleshooting the block linearizations in advisor. For more information, see Troubleshoot Linearization Results in Model Linearizer.

example

result = advise(advisor) returns a LinearizationAdvisor object that contains linearization diagnostic information for any blocks in advisor that are potentially problematic for linearization.

example

Examples

collapse all

Load Simulink model.

mdl = 'scdpendulum';
load_system(mdl)

Linearize model, and obtain LinearizationAdvisor object.

io = getlinio(mdl);
opt = linearizeOptions('StoreAdvisor',true);
[linsys,~,info] = linearize(mdl,io,opt);
advisor = info.Advisor;

Open the Linearization Advisor in the Model Linearizer.

advise(advisor)

Load Simulink model.

mdl = 'scdpendulum';
load_system(mdl)

Linearize model and obtain LinearizationAdvisor object.

io = getlinio(mdl);
opt = linearizeOptions('StoreAdvisor',true);
[linsys,~,info] = linearize(mdl,io,opt);
advisor = info.Advisor;

Find potentially problematic blocks for linearization.

result = advise(advisor)
result = 
  LinearizationAdvisor with properties:

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

Input Arguments

collapse all

Diagnostic information for block linearizations, specified as a LinearizationAdvisor object or an array of LinearizationAdvisor objects.

Output Arguments

collapse all

Diagnostic information for potentially problematic blocks in linearization results, returned as a LinearizationAdvisor object. result contains linearization diagnostic information for any blocks in advisor that are on the linearization path and satisfy at least one of the following criteria:

  • Have diagnostic messages regarding the block linearization

  • Linearize to zero

  • Have substituted linearizations

Algorithms

Calling the advise function is equivalent to performing the following custom query with the find function:

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

Version History

Introduced in R2017b