Main Content

simscape.findNonlinearBlocks

Check model for blocks with nonlinear equations

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 because of the nonlinear blocks, and which blocks have nonlinear equations. It returns a cell array of the block names. If none of the blocks have nonlinear equations, the cell array is empty.

Examples

collapse all

Check the Nonlinear Bipolar Transistor example model for blocks with nonlinear equations.

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

The number of linear or switched linear networks in the model is 0.
The number of nonlinear networks in the model is 1.
nonlinBlocks = 3x1 cell
    {'NonlinearBipolarTransistor/AC Voltage 1kHz/10mV,1KHz'         }
    {'NonlinearBipolarTransistor/Nonlinear NPN Transistor/D1/exp(x)'}
    {'NonlinearBipolarTransistor/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 or string scalar. If the model is not on the MATLAB® path, the model name must include the full path.

Data Types: char | string

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.

Version History

Introduced in R2017a