How to solve coupled first order ODE using something other than ODE45?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have 6 coupled equations:
- m1'=-m1+a/(1+p3)^n+a0
- m2'=-m2+a/(1+p1)^n+a0
- m3'=-m3+a/(1+p2)^n+a0
- p1'=-b(p1-m1)
- p2'=-b(p2-m2)
- p3'=-b(p3-m3)
{a, a0, b and n are parameters. m1' is showing derivative of m1 with respect to t (time).}
I know these equations can easily be solved using ODE45 but I want to solve them using something more basic like Euler method. I can solve uncoupled ODEs using Euler method but for coupled equation I am little confused. Someone please give me or give me some ideas and hints to solve these equations. Thank you.
댓글 수: 0
답변 (1개)
John D'Errico
2017년 4월 22일
편집: John D'Errico
2017년 4월 22일
What is the problem? If you understand how to solve an ODE using Euler's method, all you need to do is use the current value of your variables to predict ahead. If you have two or more variables, it still works the same. WTP?
Thus, if you have
y' = f(t,y)
then you predict ahead at time step t(k) to step t(k+1) as:
y(k+1) = y(k) + f(t(k),y(k))*dt
If you have multiple coupled equations, then each of them is still of the same form. Euler's method is about as simple as you can make it. It is not very good, since it is just Euler's method! But then, you are the one who wants to use it instead of something better. (This is rarely a good idea, unless you know enough to fully understand the problems and how to recognize them, as well as to know if you can afford to use a poor method. If you can't figure out how to code Euler's method, then you don't understand the issues.)
댓글 수: 2
shireesha myadari
2021년 2월 25일
I am not understanding ,how to make coupling between the given equations.
Thanks in advance.
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!