原标题:求解器在生成代码时有什么作用?
关键字:Matlab,simulink
最佳回答:weijia zhang
回答字数:1233字
variable-step在求解过程中步长根据需要变化,每个major timestep还分成多个minor timestep。生成代码是要在实时的嵌入式系统上运行,而variable-step没法在map到硬件上。更基础的说,就是c code在编译前需要知道每一个step的时间间隔,不能动态确定step size。
“The choice between these types depends on how you plan to deploy your model and the model dynamics. If you plan to generate code from your model and run the code on a real-time computer system, choose a fixed-step solver to simulate the model. You cannot map the variable-step size to the real-time clock.
If you do not plan to deploy your model as generated code, the choice between a variable-step and a fixed-step solver depends on the dynamics of your model. A variable-step solver might shorten the simulation time of your model significantly. A variable-step solver allows this saving because, for a given level of accuracy, the solver can dynamically adjust the step size as necessary. This approach reduces the number of steps required. The fixed-step solver must use a single step size throughout the simulation, based on the accuracy requirements. To satisfy these requirements throughout the simulation, the fixed-step solver typically requires a small step.
联系作者
回答作者:weijia zhang
评论0