Nonlinear equations within Simulink Coder
Show older comments
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
Answers (2)
Guy Rouleau
on 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
on 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.
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!