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 个)
Guy Rouleau
2012-3-14
1 个投票
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
2012-3-13
0 个投票
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 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!