solving a set of first order differential equations in simulink

5 次查看(过去 30 天)
I wish there is a way, maybe a block or something, to simulate a set of first order differential equations of any form (not restricted to be linear) easily. You know how difficult it is to build the system using basic blocks particularly when it is a high order nonlinear one. I got a clue on the Web. Is there a block called dee (differential equation editor)? I couldn't find anything about that in my Matlab 2012b help documentation or in the simulink library. Maybe it has been added in later versions, Huh?

回答(2 个)

Mischa Kim
Mischa Kim 2014-1-20
Hello Pouya, there is a way: use an embedded MATLAB function to define the differential equations, say Xdot = f(X), where X is the state vector. Then use an integrator block to compute X . Initial conditions can be defined either externally or internally (to the integrator block).
  2 个评论
Pouya Jamali
Pouya Jamali 2014-1-20
Thank you Mischa for your reply. you're certainly true. But this method has a limitation for my application. I'm doing Monte-Carlo simulation and I need to run my simulink consecutively with different parameters.I should be able to use set_param command from an script file to set the parameters for each run. have you heard about dee block? It sounds to be best fitted to my application, but I don't know why I can't find it in my Matlab.
Mischa Kim
Mischa Kim 2014-1-20
编辑:Mischa Kim 2014-1-20
Yes, I am familiar with the dee tool (simply type dee at the MATLAB command prompt, if you have it installed). I still recommend the general approach shown above because it gives you much more flexibility setting up the problem.
For MC simulations I would follow the procedure you outlined (using the Parallel Computing Toolbox, if available). See this demo for reference and this example .

请先登录,再进行评论。


Yugal Maheshwari
Yugal Maheshwari 2018-12-23
Hi,
How to set intial condtion Y(1)=1 in Simulink for ODE?

类别

Help CenterFile Exchange 中查找有关 General Applications 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by