How to implement tightly coupled nonlinear odes using ode45 in matlab?
이전 댓글 표시
I am solving a problem from fluid dynamics; in particular tightly coupled nonlinear ordinary differential equations. The following is a scaled-down version of my actual problem. I have solved system of coupled odes many times in the past but this case is different since double derivatives of one variable depends on the double derivative of another variable. How do I implement it in ode45? I need 3 x 2 = 6 plots of x, x-dot and x-ddot versus time for t, 0 to 2. All required initial conditions have zero values at t = 0 How do I store the updated value of the double derivatives as the ode45 code runs? The way ode45 works, I get x and x-dot as output but not the double derivatives. Any help will be highly appreciated.

댓글 수: 8
John D'Errico
2018년 11월 12일
Did you read the documentation for ODE45? In there as I recall, it shows you how to convert higher order differentials into a system of first order problems.
Vikash Pandey
2018년 11월 12일
madhan ravi
2018년 11월 12일
what are the intial conditions??
Vikash Pandey
2018년 11월 12일
편집: Vikash Pandey
2018년 11월 12일
madhan ravi
2018년 11월 12일
편집: madhan ravi
2018년 11월 12일
I have always used FORTRAN to solve such equations,
so does the result coincide with fortran?
Vikash Pandey
2018년 11월 12일
편집: Vikash Pandey
2018년 11월 12일
Torsten
2018년 11월 12일
ydot(3)=y(3) and ydot(6)=y(6) ? Looks wrong to me.
Vikash Pandey
2018년 11월 12일
편집: Vikash Pandey
2018년 11월 12일
채택된 답변
추가 답변 (1개)
Vikash Pandey
2018년 11월 12일
0 개 추천
댓글 수: 12
Vikash Pandey
2018년 11월 12일
If your equations are like in the modified problem, set
y1=x1
y2=x1'
y3=x1''
y4=x2
y5=x2'
y6=x2''
and solve the DAE system
y1'=y2
y2'=y3
y4'=y5
y5'=y6
y3+t*y6^2-t*y4+y1*y5=0
t*y3+y6-t^2*y1-y4*y2=0
As for the former case, initial conditions are only necessary for x1, x1', x2 and x2'.
Vikash Pandey
2018년 11월 12일
I don't understand how you want to formulate the problem for ODE45 in this case.
Usually, you can explicitly solve for x1'' and x2'' as expressions of x1,x1',x2,x2' and t (two equations in the two unknowns x1'' and x2''). This is in principle possible for your modified problem (with ugly right-hand side F) , but not for your original problem (why ?).
If it's possible, you can write your system as a first-order system consisting of 4 equations.
If it's not possible, you can write your system as a system of 4 ODEs and 2 AEs as I did for the modified problem.
Vikash Pandey
2018년 11월 12일
편집: Vikash Pandey
2018년 11월 12일
Vikash Pandey
2018년 11월 12일
Torsten
2018년 11월 12일
I see no difference to the modified problem from above. So you can solve it the way I suggested.
Vikash Pandey
2018년 11월 13일
Huy Nguyen
2022년 12월 6일
hi, I have the same problem. can you help me or share the code please?
Sam Chak
2022년 12월 6일
Hi @Huy Nguyen
Would advise you to post your specific problem in a New Question. Also to clarify whether it's a math-related problem or a technical problem in MATLAB code.
Huy Nguyen
2022년 12월 7일
hi, thanks for your reply. I fix the problem.
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




