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!




