Documentation

simscape.findNonlinearBlocks

Check model for blocks with nonlinear equations

Syntax

blockList = simscape.findNonlinearBlocks(modelName)

Description

example

blockList = simscape.findNonlinearBlocks(modelName) checks a model and reports which blocks, if any, contain nonlinear equations that keep the physical networks in the model from being linear or switched linear. modelName is the name of the model, in single quotes.

You do not have to open the model before using the function.

The function reports how many physical networks in the model are linear or switched linear, how many networks are nonlinear, and which blocks have nonlinear equations. It returns a cell array of the block names. If all the networks in the model are linear or switched linear, the cell array is empty.

Examples

collapse all

Check the Nonlinear Bipolar Transistor example model for blocks with nonlinear equations. You do not have to open the model before running the diagnostic. This model is on the MATLAB® path, therefore you do not have to include the full path into the model name.

nonlinBlocks = simscape.findNonlinearBlocks('ssc_bipolar_nonlinear')
Found network that contains nonlinear equations in the following blocks:
    'ssc_bipolar_nonlinear/AC Voltage 1kHz/10mV,1KHz'
    'ssc_bipolar_nonlinear/Nonlinear NPN Transistor/D1/exp(x)'
    'ssc_bipolar_nonlinear/Nonlinear NPN Transistor/D2/exp(x)'

The model contains no linear or switched linear networks.
The model contains 1 network that is neither linear nor switched linear.

nonlinBlocks =

  3×1 cell array

    'ssc_bipolar_nonlinear/AC Voltage 1kHz/10mV,1KHz'
    'ssc_bipolar_nonlinear/Nonlinear NPN Transistor/D1/exp(x)'
    'ssc_bipolar_nonlinear/Nonlinear NPN Transistor/D2/exp(x)'

The diagnostic function found no networks that are linear or switched linear. It found one network that contains nonlinear equations in three blocks. The function displays the names of the blocks in the diagnostic message.

The function returns a cell array, nonlinBlocks, containing the names of the blocks with nonlinear equations. The number of rows in the array corresponds to the number of blocks found. Each cell contains the name of a block, including the full path to the block from the root of the model.

Input Arguments

collapse all

Model name, specified as a character vector. If the model is not on the MATLAB path, the model name must include the full path.

Data Types: char

Output Arguments

collapse all

Names of blocks with nonlinear equations, returned as an n-by-1 cell array. n is the number of blocks in the model that have nonlinear equations.

Each cell contains the name of a block, including the full path to the block from the root of the model.

Limitations

  • This function does not work with Simscape™ Multibody™ networks.

Introduced in R2017a

Was this topic helpful?