Simulink Control Design™ - MathWorks

(Tuis.) #1

Create and Run Custom Queries


The Linearization Advisor also provides objects and functions for creating custom queries.
Using these queries, you can find blocks in your model that match specific criteria. For
example, to find all SISO blocks that are linearized using numerical perturbation, first
create query objects for each search criterion:



  • Has one input

  • Has one output

  • Is numerically perturbed


qIn = linqueryHasInputs(1);
qOut = linqueryHasOutputs(1);
qPerturb = linqueryIsNumericallyPerturbed;


Create a CompoundQuery object by combining these query objects using logical
operators.


sisopert = qIn & qOut & qPerturb;


Search the block diagnostics in advisor2 for blocks matching these criteria.


sisopertBlocks = find(advisor2,sisopert)


sisopertBlocks =


LinearizationAdvisor with properties:


Model: 'scdpendulum'
OperatingPoint: [1x1 opcond.OperatingPoint]
BlockDiagnostics: [1x3 linearize.advisor.BlockDiagnostic]
QueryType: '((Has 1 Inputs & Has 1 Outputs) & Perturbation)'


There are three SISO blocks in the model that are linearized using numerical
perturbation.


For more information on using custom queries, see “Find Blocks in Linearization Results
Matching Specific Criteria” on page 4-55.


Troubleshoot Linearization Results at Command Line
Free download pdf