Why does LINEARIZE give different results if my Simulink Solver is set to Variable Step or Fixed Step in Simulink Control Design 3.0 (R2009b)?

8 views (last 30 days)
I have a model that I am linearizing either via the LINEARIZE command line function, or via the Linear Analysis, or Compensator Design panes of the Simulink Control Design GUI. When I linearize my model with the model configured with a Variable Step solver, I get different results that if I linearize my model when the model is configured to a Fixed Step solver.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 2 Mar 2010
This is expected behavior in Simulink Control Design 3.0 (R2009b).
For some blocks in Simulink, the sample time depends on the solver and sample of times of blocks impact the linearization result. The Memory block in the Discrete section of the Simulink library is one of such blocks. When the solver is variable-step, the sample time of the Memory block is fixed in minor time step whereas when the solver is fixed-step, its sample time becomes discrete.
Attached is a simple model that illustrates this behavior. Please follow these steps:
1. From the model configuration parameters dialog, notice that the solver type is set to fixed-step, and the fixed-step size set to 1.
2. Navigate to Tools-> Control Design -> Linear Analysis to open the Control and Estimation Tool Manager.
3. Press the "Linearize Model" button.
4 .Leaving Control and Estimation Tool Manager open, navigate to the model Configuration Parameters -> solver and select variable-step.
5. In the Control and Estimation Tool Manager, hit the "Linearize Model" button again.
6. Compare the 2 generated models.
For each model, you can see from the State Space matrices as well as the step response that these are not equivalent systems. In the variable-step case, the linearization result is continuous because the memory block in this case is equivalent to an infinitesimal time delay and its does not have an impact on the linearization. In the fixed-step case, the Memory block is equivalent to a time delay, which makes the linearization result discrete. It is expected for the linearization results to be different because the models are effectively different.
To find such blocks in your model, you can enable Sample Time Colors from the Format menu. Inspect the colors when the solver is variable-step vs. fixed-step and notice those blocks whose color is different. Depending on the sample of linearization result you wish to end up with, you can react to these blocks accordingly.
In order to avoid this type of issue, it is possible to set the sample time of the linearization. This can be done from the Tools menu of the Control and Estimation Tool Manager or from command line using:
opt = linoptions
opt.SampleTime = 0
sys = linearize(mdl,io,opt)
If you repeat the procedure below with a linearization sample time specified, you will notice that the linearization results are the same for this simple model regardless of the solver choice.
For issues with multirate models, you may wish to see the demo "Linearization of Multirate Model" under Simulink Control Design->Demos.

More Answers (0)

Products


Release

R2009b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!