How to write ode45 to solve differential equations with changing parameters
조회 수: 3 (최근 30일)
이전 댓글 표시
I am going to solve the differential equations:
dX = f(X, U, P), X is system states, U is control inputs which is known, and P is function of X, U and P itself. Since nonlinearity, P cannot be expressed analytically.
I tried to use ode45, but I have to use a for-end loop to upgrade my P for every step. Is there anyway I can avoid using for-end loop here? For example, just use ode45 to integrate my equations for one go?
I'm new to MATLAB, I will be very thankful if you let me know how to write it in detail. Thank you very much.
댓글 수: 2
Torsten
2015년 4월 7일
dX=f(X,U,P) P-f2(X,U,P)=0
This is a differential-algebraic system which can be solved by ODE15S, e.g.
Best wishes
Torsten.
답변 (1개)
Jan
2015년 4월 6일
Please explain the values of U and P with details. Is the function to be integrated still smooth? Otherwise ODE45 cannot handle it reliably. See http://www.mathworks.com/matlabcentral/answers/59582#answer_72047
참고 항목
카테고리
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!