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

Réponses (2)

Guy Rouleau
Guy Rouleau le 14 Mar 2012

1 vote

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.
Kaustubha Govind
Kaustubha Govind le 13 Mar 2012

0 votes

I'm not sure, but I'm guessing that the blocks that introduce nonlinear dynamics may not even be supported for code-generation.

Catégories

En savoir plus sur Simulink Coder dans Centre d'aide et File Exchange

Produits

Question posée :

le 17 Fév 2012

Community Treasure Hunt

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

Start Hunting!

Translated by