Nonlinear equations within Simulink Coder

Hi,
If a Simulink model have nonlinear equations, is it mandatory to linearize it before using Simulink coder (RTW)?
If the answer is no, the code generated will call a Newton's solver and thus iterative computation will be made. In this case, this is opposite to the principle of determinism for real-time applications.
Best Rgeards, Hassen

回答(2 个)

You can generate code for models with non-linearities.
For example generate code for a model with a saturated integrator... this is non-linear and is no problem.
If your model contains ODEs (continuous states) then Simulink will use an ODE solver, which does not require iterative computations.
The only time you will need an iterative solver is when your model contains a Simscape network... because Simscape can handle DAEs.
If you are interested in this topic, I recommend the following article:
In that case, you have a "fixed-cost" option to limit the numbe rof iterations and respect real-time contrains.
I'm not sure, but I'm guessing that the blocks that introduce nonlinear dynamics may not even be supported for code-generation.

类别

帮助中心File Exchange 中查找有关 Simulink Coder 的更多信息

提问:

2012-2-17

Community Treasure Hunt

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

Start Hunting!

Translated by