How to solve ODEs that are a function of the derivatives of the state variables
9 ビュー (過去 30 日間)
古いコメントを表示
I don't know how to properly ask this question. Let me try to explain it.
Typical coupled ODEs:
y'(1) = function(state variables)
y'(2) = function(state variables)
y'(3) = etc ...
Can I solve ODEs in MATLAB that look like this?:
y'(1) = function(state variable,y'(x))
y'(2) = function(state variables,y'(x))
y'(3) = etc ...
basically I am asking if you can have y primes' on the right side of the equal sign.
(Edit 3/1/2011) example:
- rho' = f(rho,A,u,u')
- u' = f(rho,u,P')
- h' = f(u, u')
- P' = f(alpha,T',T,rho',rho)
- T' = f(alpha,h')
- alpha'= f(T,rho',rho,alpha)
It is not possible to write the primes' in terms of state variables only. Can MATLAB solve these type of equations? Is there a similar function to Mathematica's NDSolve[]?
2 件のコメント
Matt Tearle
2011 年 2 月 25 日
The notation is a bit confusing. Can you give a small example. I think the answer is "yes", but an example would help show how (as well as understand the question correctly)
採用された回答
Matt Tearle
2011 年 3 月 2 日
Ah, that actually wasn't what I was thinking (I don't know why, b/c in retrospect your question makes perfect sense). Anyway, that actually makes the answer fairly easy: yes. See ode15i. Rewrite the equations as a vector system F(A,x,x'), where x = [rho; u; h; P; T; alpha], and away you go.
5 件のコメント
Matt Tearle
2011 年 3 月 2 日
Here are the online doc pages:
Function handles in general
http://www.mathworks.com/help/matlab/ref/function_handle.html
Anonymous function handles
http://www.mathworks.com/help/matlab/matlab_prog/f4-70115.html
And, most useful in this context, using anonymous handles to provide parameters to named functions, for use in things like the ode routines
http://www.mathworks.com/help/matlab/matlab_prog/f4-70115.html#f4-70238
その他の回答 (1 件)
Jesse
2011 年 3 月 2 日
2 件のコメント
Matt Tearle
2011 年 3 月 2 日
Thanks for posting that, for the benefit of others. I'd call that an example of "doing the right thing"
(http://www.mathworks.com/company/aboutus/mission_values/)
参考
カテゴリ
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!