| Simulink Control Design | ![]() |
www.kxcad.net Home > CAE Software Index > MATLAB Index >
Block-by-block analytic linearization is the default linearization method in Simulink Control Design. Through this method, each block within the linearization path is first linearized individually.
There are two methods that Simulink Control Design uses to linearize the individual blocks in a model:
Each method has options that you can control to create accurate linearized models.
The following section gives details of the methods used to linearize each block, with suggestions for controlling the linearizations to create more accurate linearized models.
Many Simulink blocks contain analytic Jacobians for exact linearization. When linearizing a system using block-by-block analytic linearization, you can use these analytic linearizations instead of numerically perturbing the block. This approach is especially useful for blocks that contain discontinuities and do not give good results using numerical perturbation.
Note The preprogrammed, analytic block linearizations are only used in block-by-block analytic linearization. When you use the numerical-perturbation linearization method, such blocks are numerically perturbed with the rest of the system. |
The following table lists Simulink blocks and whether they contain analytic Jacobians for linearization.
Several blocks include options to control the linearization that you can adjust in the Block Parameters window. For example, you can change the order of the Padé approximation used in the Transport Delay block or select the Treat as gain when linearizing option in the Saturation block. The Notes column in the following table gives details on blocks that include options to control the linearization.
For more information on individual blocks, see the reference page for each block.
Blocks with Analytic Jacobians and Linearization Options
| Block | Analytic Jacobian (Y/N) | Notes |
|---|---|---|
| Continuous Library | ||
| Derivative | Y | Allows control of the time constant for the filter constant |
| Integrator | Y | Includes option to exclude saturation and resets from linearization |
| State-Space | Y | |
| Transfer Fcn | Y | |
| Transport Delay | Y | Allows control of Padé order. Supports linearization of models with internal delays, see Linearizing Models with Time Delays. |
| Variable Transport Delay/Variable Time Delay | Y | Allows control of Padé order. Supports linearization of models with internal delays, see Linearizing Models with Time Delays. |
| Zero-Pole | Y | |
| Discontinuities Library | ||
| Backlash | N | |
| Coulomb and Viscous Friction | N | |
| Dead Zone | Y | Includes option to treat as gain when linearizing |
| Dead Zone Dynamic | Y | |
| Hit Crossing | N | |
| Quantizer | Y | Includes option to treat as gain when linearizing |
| Rate Limiter | Y | Includes option to treat as gain when linearizing |
| Rate Limiter Dynamic | N | |
| Relay | N | |
| Saturation | Y | Includes option to treat as gain when linearizing |
| Saturation Dynamic | N | |
| Wrap to Zero | N | |
| Discrete Library | ||
| Difference | Y | |
| Discrete Derivative | N | |
| Discrete Filter | N | |
| Discrete State-Space | Y | |
| Discrete Transfer Fcn | Y | |
| Discrete Zero-Pole | Y | |
| Discrete-Time Integrator | Y | Includes option to ignore saturation and resets during linearization. Jacobian not supported for nondouble data types. |
| First-Order Hold | N | |
| Integer Delay | N | Supports linearization of models with internal delays, see Linearizing Models with Time Delays. |
| Memory | Y | Linearizes to a gain of 1 when driven by a continuous signal. Includes option to linearize to a Unit Delay when driven by a discrete signal. |
| Tapped Delay | N | |
| Transfer Fcn First Order | Y | |
| Transfer Fcn Lead or Lag | Y | |
| Transfer Fcn Real Zero | Y | |
| Unit Delay | Y | Jacobian does not support frame-based signals. Supports linearization of models with internal delays, see Linearizing Models with Time Delays. |
| Weighted Moving Average | N | |
| Zero-Order Hold | N | |
| Logic and Bit Operations Library | ||
| Bit Clear | N | |
| Bit Set | N | |
| Bitwise Operator | N | |
| Combinatorial Logic | N | |
| Compare To Constant | N | |
| Compare To Zero | N | |
| Detect Change | N | |
| Detect Decrease | N | |
| Detect Fall Negative | N | |
| Detect Fall Nonpositive | N | |
| Detect Increase | N | |
| Detect Rise Nonnegative | N | |
| Detect Rise Positive | N | |
| Extract Bits | Y | |
| Interval Test | N | |
| Interval Test Dynamic | N | |
| Logical Operator | N | |
| Relational Operator | N | |
| Shift Arithmetic | N | |
| Lookup Tables Library | ||
| Cosine | N | |
| Direct Lookup Table (n-D) | N | |
| Interpolation using PreLookup | Y | |
| Lookup Table | N | |
| Lookup Table (2-D) | N | |
| Lookup Table (n-D) | N | |
| Lookup Table Dynamic | N | |
| PreLookup | Y | |
| Sine | N | |
| Math Operations Library | ||
| Abs | Y | |
| Add | Y | |
| Algebraic Constraint | N | |
| Assignment | N | |
| Bias | Y | |
| Complex to Magnitude-Angle | N | |
| Complex to Real-Imag | N | |
| Concatenate | N | |
| Divide | Y | |
| Dot Product | N | |
| Gain | Y | |
| Magnitude-Angle to Complex | N | |
| Math Function | N | |
| MinMax | N | |
| MinMax Running Resettable | N | |
| Polynomial | N | |
| Product | Y | |
| Product of Elements | Y | |
| Real-Imag to Complex | N | |
| Reshape | N | |
| Rounding Function | N | |
| Sign | Y | Linearizes to Inf at zero, linearizes to zero otherwise |
| Sine Wave Function | N | |
| Slider Gain | Y | |
| Subtract | Y | |
| Sum | Y | |
| Sum of Elements | Y | |
| Trigonometric Function | N | |
| Unary Minus | N | |
| Weighted Sample Time Math | N | |
| Model Verification Library | ||
| Assertion | N/A | Does not contain outputs |
| Check Discrete Gradient | N/A | Does not contain outputs |
| Check Dynamic Gap | N/A | Does not contain outputs |
| Check Dynamic Lower Bound | N/A | Does not contain outputs |
| Check Dynamic Range | N/A | Does not contain outputs |
| Check Dynamic Upper Bound | N/A | Does not contain outputs |
| Check Input Resolution | N/A | Does not contain outputs |
| Check Static Gap | N/A | Does not contain outputs |
| Check Static Lower Bound | N/A | Does not contain outputs |
| Check Static Range | N/A | Does not contain outputs |
| Check Static Upper Bound | N/A | Does not contain outputs |
| Model Wide Utilities Library | ||
| Block Support Table | N/A | Does not contain outputs |
| DocBlock | N/A | Does not contain outputs |
| Model Info | N/A | Does not contain outputs |
| Time-Based Linearization | N/A | Does not contain outputs |
| Trigger-Based Linearization | N/A | Does not contain outputs |
| Ports and Subsystems Library | ||
| Configurable Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Atomic Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| CodeReuse Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Enable | N | |
| Enabled and Triggered Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Enabled Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| For Iterator Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Function-Call Generator | N/A | Only the blocks within the subsystem are part of the linearization |
| Function-Call Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| If | N | |
| If Action Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Inport | N/A | Does not contain outputs |
| Model | N/A | See Model Reference Blocks. |
| Outport | N/A | Does not contain inputs |
| Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Switch Case | N | |
| Switch Case Action Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Trigger | N | |
| Triggered Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| While Iterator Subsystem | N/A | Only the blocks within the subsystem are part of the linearization |
| Signal Attributes Library | ||
| Data Type Conversion | Y | |
| Data Type Conversion Inherited | Y | |
| Data Type Duplicate | N/A | Does not contain outputs |
| Data Type Propagation | N/A | Does not contain outputs |
| Data Type Scaling Strip | Y | |
| IC | N | |
| Probe | N | |
| Rate Transition | Y | |
| Signal Conversion | Y | |
| Signal Specification | Y | |
| Weighted Sample Time | N | |
| Width | N | |
| Signal Routing Library | ||
| Bus Assignment | Y | |
| Bus Creator | Y | |
| Bus Selector | Y | |
| Data Store Memory | N/A | Does not contain inputs or outputs |
| Data Store Read | Y | Linearizes to a gain of 1. Assumes that there is no delay between data store read and data store write. |
| Data Store Write | Y | Linearizes to a gain of 1. Assumes that there is no delay between data store read and data store write. |
| Demux | N/A | |
| Environment Controller | Y | |
| From | N/A | |
| Goto | N/A | |
| Goto Tag Visibility | N/A | |
| Index Vector | Y | |
| Manual Switch | Y | |
| Merge | N | |
| Multiport Switch | Y | |
| Mux | N/A | |
| Selector | Y | |
| Switch | Y | |
| Sources Library - N/A No Inputs | ||
| Sinks Library - N/A No Outputs | ||
| User Defined Functions Library | ||
| Embedded MATLAB Function | N | |
| Fcn | N | |
| Level-2 M-File S-Function | N | |
| MATLAB Fcn | N | |
| S-Function | N | |
| S-Function Builder | N | |
| Additional Math and Discrete Library | ||
| Fixed-Point State-Space | Y | |
| Transfer Fcn Direct Form II | N | |
| Transfer Fcn Direct Form II Time Varying | N | |
| Unit Delay Enabled | Y | |
| Unit Delay Enabled External IC | Y | |
| Unit Delay Enabled Resettable | Y | |
| Unit Delay Enabled Resettable External IC | Y | |
| Unit Delay External IC | Y | |
| Unit Delay Resettable | Y | |
| Unit Delay Resettable External IC | Y | |
| Unit Delay With Preview Enabled | Y | |
| Unit Delay With Preview Enabled Resettable | Y | |
| Unit Delay With Preview Enabled Resettable External RV | Y | |
| Unit Delay With Preview Resettable | Y | |
| Unit Delay With Preview Resettable External RV | Y | |
| Decrement Real World | Y | |
| Decrement Stored Integer | Y | |
| Decrement Time To Zero | Y | |
| Decrement To Zero | Y | |
| Increment Real World | Y | |
| Increment Stored Integer | Y | |
When you cannot use a preprogrammed block linearization, Simulink Control Design automatically computes the block linearization by numerically perturbing the states and inputs of the block about the operating point of the block. As opposed to the numerical-perturbation linearization method, this perturbation is local and its propagation through the rest of the model is restricted.
The block perturbation algorithm introduces a small perturbation to the nonlinear block and measuring the response to this perturbation. Both the perturbation and the resulting response are used to create the matrices in the linear state-space model of this block. Changing the size of the perturbations changes the resulting linearized model.
As described in Linearizing Models, you can write a nonlinear Simulink block as a state-space system:
![]()
In these equations, x(t) represents the states of the block, u(t) represents the inputs of the block, and y(t) represents the outputs of the block.
A linearized model of this system is valid in a small region around the operating point t=t0, x(t0)=x0, u(t0)=u0, and y(t0)=g(x0,u0,t0)=y0. Subtracting the operating point values from the states, inputs, and outputs defines a set of variables centered about the operating point:

You can write the linearized model in terms of these new variables. The representation is usually valid when the variables are small, i.e., when the departure from the operating point is small:
![]()
The state-space matrices A, B, C,
and D of this linearized model represent the Jacobians
of the block, as defined in Linearizing Models.
To compute the matrices, the states and inputs are perturbed, one at a time,
and the response of the system to this perturbation is measured by computing
and δy.
The perturbation and response are then used to compute the matrices in the
following way:

where
xp,i is the state vector whose ith component is perturbed from the operating point value.
xo is the state vector at the operating point.
up,i is the input vector whose ith component is perturbed from the operating point value.
uo is the input vector at the operating point.
is the value of
at xp,i, uo.
is the value of
at up,i, xo.
is the value of
at the operating point.
is the value of
at xp,i, uo.
is the value of
at up,i, xo.
yo is the value of y at the operating point.
Linearized models of discrete-time are computed in a similar way. For more information, see Linearizing Models in the Simulink Control Design Getting Started documentation for the equations of linearized discrete-time and multirate systems.
Note
A perturbed value is one that has been changed
by a very small amount from the operating point value. The default difference
between the perturbed value and the operating point value is
|
Changing the size of the perturbations
changes the linearization results. The default perturbation size is 10-5(1+|x|),
where x is the operating point value of the state or
input being perturbed. For example, to change the perturbation size of the
states in the Magnetic Ball Plant block in the magball model
to
, type
blockname='magball/Magnetic Ball Plant' set_param(blockname,'StatePerturbationForJacobian','1e-7')
To change the perturbation size of the input of the Magnetic Ball Plant
block to
, where u
is the input signal level, follow these steps:
ph=get_param('magball/Magnetic Ball Plant','PortHandles')
pin=ph.Inport(1)
Finally, set the perturbation level for this inport:
set_param(pin,'PerturbationForJacobian','1e-7')
If there is more than one inport, you can choose to assign a different perturbation level to each. The following figure shows an S-Function block with two input signals, the actual signal and an index variable. To avoid perturbing the index signal, you can assign a perturbation level of 0 to this inport.

When linearizing model reference blocks with accelerated mode, Simulink Control Design automatically uses block perturbation. If you instead want to linearize these referenced models using block-by-block analytical linearization, then change the block mode from accelerated to normal.
Note Model blocks with multiple sample times and accelerated mode cannot be linearized using block perturbation. To linearize blocks with multiple sample times, you must set the block mode to normal. |
Note If your model contains multiple model blocks referencing the same Simulink model, you must set all of the blocks to accelerator mode. |
Blocks that have nondouble data type signals as either inputs or outputs, and which do not have a preprogrammed exact linearization, automatically linearize to zero as they cannot be numerically perturbed. For example, many logical operator blocks have Boolean outputs and therefore linearize to 0.
Workarounds for Blocks with Nondouble Data Types. To work around the problem of blocks with nondouble data types linearizing to zero, you can use a Data Type Conversion block. This block has a preprogrammed exact linearization, to convert your signals to doubles before linearizing the model. The following example illustrates this concept. The model in this example is configured to linearize the Square block at an operating point where the input is 1. The resulting linearized model should be 2, but the input to the Square block is Boolean and the linearization is zero.

However, by inserting a Data Type Conversion block before the linearization input point, you can make the input signal to the Square block a double. Thus, the linearized model gives the correct response of 2.

Overriding Nondouble Data Types. When you linearize a model that contains nondouble data types but still runs correctly in full double precision, you can choose to override all data types with doubles. To perform this override, in the model window select Tools > Fixed-Point Settings from the menu. This selection opens the Fixed-Point Settings window. Within this window select True doubles from the Data type override menu. Now, when you linearize and simulate the model, it uses doubles for all data types.
Note This method does not work when the model relies on other data types in its algorithm, such as relying on integer data types to perform truncation from floats. |
You can linearize models with time delays using:
Padé approximation provides the following results:
An approximate representation of continuous delays using the Padé order you specify in the block dialog for the delay Simulink blocks
Discrete delays as states
For more information, see Finding Linearized Models with Padé Approximation of Delays.
Exact linearization provides the following results:
An exact representation of continuous delays
An internal representation of discrete delays
These discrete delays do not appear as states in the linearized model but are accounted for as internal delays.
For more information, see Finding Linearized Models with Exact Delays.
The delays in your model can arise from any of the following Simulink blocks:
Transport Delay
Variable Time Delay
Variable Transport Delay
Integer Delay
Unit Delay
For more information on time delays, see Time Delays in the Control System Toolbox documentation.
To find linearized models with Padé approximations of delays, first adjust the order of the Padé approximation in the Block Parameters window for any block with delay. Then, perform the linearization.
Note To use a Padé approximation for continuous delay blocks, set the UseExactDelayModel option of the linoptions function to the default setting, off. |
For more information on Padé approximations, see Eliminating Time Delays: Padé Approximation in the Control System Toolbox documentation.
You can use block-by-block analytic linearization to find linear models with exact time delays. You can do this in the following ways:
In the Linearizations Options dialog box, select the Return linear model with exact delay(s) option.
For more information on the Linearization Option dialog box, see Changing Linearization Options.
At the command line, set thelinoptions function option UseExactDelayModel to on.
For more information, see the "Linearizing Models with Time Delays" demo listed under the Simulink Control Design Demos in the demos browser.
There are several Simulink blocks that contain discontinuities, such as the Sign block, whose behavior is shown in the following figure.

The very large derivatives that occur at the point of discontinuity can cause problems with linearization. For example, the Sign block has the following linearization
![]()
where D is a state-space matrix, and u is the input signal to the block.
When these blocks are within the linearization path of your model, the resulting linearized model could potentially have very large values. There is no obvious solution to this problem and it is recommended that you remove or replace these blocks. However, when your model operates in a region away from the point of discontinuity, the linearization will be zero. This should not cause any problems, although when the linearizations of several blocks are multiplied together (as in a feedback path) it can cause the linearization of the system to be zero.
When these blocks are outside the linearization path, they can still contribute to the definition of the operating point of the model but will not otherwise affect the linearization. It is safe to use them for reference signals, disturbances, and any other signals and blocks that are not being linearized.
Other examples of blocks with discontinuities include
Relational Operator blocks
Relay block
Logical Operator blocks
Stateflow blocks
Quantizer block (has an option to treat as a gain when linearizing)
Saturation block (has an option to treat as a gain when linearizing)
Deadzone block (has an option to treat as a gain when linearizing)
When an Integrator block has an external reset condition or output limitations (saturation) and the model is operating near the point where the Integrator is reset or the output is limited, it might be more meaningful for the linearization to ignore the effect of the saturation or reset. To linearize a model around an operating point that causes the integrator to reset or saturate, select Ignore limit and reset when linearizing in the Integrator block parameters dialog box. Selecting this option causes the linearization to treat this block as unresettable and as having no limits on its output, regardless of the settings of the block's reset and output limitation (saturation) options.

The linearization of triggered subsystems and other event-based models can be particularly difficult because of the system's dependence on previous events. In particular, the execution of a triggered system depends on previous signal events such as zero crossings. Therefore, for linearization, which takes place at a particular moment in time, a trigger event will never happen. Thus, while the event-based dynamics contribute to the definition of the system's operating point, this information is not captured by the list of values of states and inputs that typically describe the operating point for linearization.
Triggered events describe many different systems. One such system is an internal combustion (IC) engine. When an engine piston approaches the top of a compression stroke, a spark is introduced and combustion occurs. The timing of the spark for combustion is dependent on the speed and position of the engine crankshaft. An example of a Simulink model that models this behavior is engine.mdl which is included as a demonstration model in Simulink.
In engine.mdl, triggered subsystems generate events when the pistons reach both the top and bottom of the compression stroke. The linearization will not be meaningful because of the presence of these triggered subsystems. However, you can get a meaningful linearization while still preserving the simulation behavior by recasting the event-based dynamics. For example, you can use curve fitting to approximate the event-based behavior. This is done in scdspeed.mdl, a demonstration model included in Simulink Control Design and shown in the figure below:

The basic functional approximation in scdspeed is included within the Convert to mass charge block inside the subsystem scdspeed/Throttle & Manifold/Intake Manifold where a quadratic polynomial is used to approximate the relationship between the Air Charge, the Manifold Pressure, and the Engine Speed.

The approximation has the following form:
![]()
Simulation data from the original model is used to compute the unknown parameters p1, p2, p3, p4, and p5 using a least squares fitting technique.
When measured data for internal signals is available, you can use Simulink Parameter Estimation to compute the unknown parameters. This method is outlined in the Simulink Parameter Estimation demo called Engine Speed Model Parameter Estimation. The demo also shows how to linearize this model and use the linearization to design a feedback controller.
The approximated model can now accurately simulate and linearize the engine from approximately 1500 to 5500 RPM. The following figure shows the comparison between a simulation of the original event-based model, and a simulation of the new approximated model.

| Choosing a Linearization Algorithm Method | Numerical-Perturbation Linearization | ![]() |
© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments