Main Content

Handle Blocks with Internal State Representation

Operating Point Object Excludes Blocks with Internal States

The operating point object used for linearization and control design does not include Simulink® blocks with internal state representation, such as the following:

For example, if you compute a steady-state operating point for the following Simulink model, the resulting operating point object does not include the Backlash block states because these states have an internal representation. If you use this operating point object to initialize a Simulink model, the initial conditions of the Backlash blocks might be incompatible with the operating point.

As an example, you can compute an operating point for model myModel from a simulation snapshot at 10 seconds and then linearize the model at this operating point. In this case, the linearize function initializes the model state with the operating point before linearizing the model.

op = findop('myModel',10);
linsys = linearize('myModel',io,op);

If myModel contains a one or more blocks with an internal state representation, op does not contain the internal states. Therefore, linsys might not be an accurate linear representation of the model.

Instead of finding an operating point at the simulation snapshot, you can simulate the model to the snapshot time and linearize the model at the snapshot itself.

linsys = linearize('myModel',io,10);

This approach avoids initializing the model with an operating point that is missing state information.

Configure Blocks with Internal States for Steady-State Operating Point Search

Blocks with internal states can cause problems for steady-state operating point search (trimming). Where there is no direct feedthrough, the input to the block at the current time does not determine the output of the block at the current time.

To fix this issue for Memory, Transport Delay, or Variable Transport Delay blocks, select the Direct feedthrough of input during linearization block parameter before searching for an operating point or linearizing a model at a steady state. This setting makes such blocks behave as if they have a gain of one during an operating point search.

For example, the following model includes a Transport Delay block. In this case, you cannot find a steady-state operating point using optimization because the output of the Transport Delay is always zero. Since the reference signal is 1, the input to the Plant block must be nonzero to get the plant block to have an output of 1 and be at steady state.

Select the Direct feedthrough of input during linearization option in the Block Parameters dialog box before searching for an operating point. This setting allows the PID Controller block to pass a nonzero value to the Plant block.

You can also set direct feedthrough options at the command line.

BlockCommand to Specify Direct Feedthrough
Memoryset_param(blockname,'LinearizeMemory','on')
Transport Delay or Variable Transport Delayset_param(blockname,'TransDelayFeedthrough','on')

For other blocks with internal states, determine whether the output of the block impacts the state derivatives or desired output levels before computing operating points. If the block impacts these derivatives or output levels, consider replacing it using a configurable subsystem.

Related Topics