How to solve a system of odes where every equation is a function-handle?
2 ビュー (過去 30 日間)
古いコメントを表示
Well, my title tells all about my question.
I have a system (5x5) of differential equations. I have found these equations. Each equation is a function handle, like you can see bellow:
df1/dt = @(yq)interp1(y1,fy1,yq);
df2/dt = @(yq)interp1(y2,fy2,yq);
df3/dt = @(yq)interp1(y3,fy3,yq);
df4/dt = @(yq)interp1(y4,fy4,yq);
df5/dt = @(yq)interp1(y5,fy5,yq);
How can I solve this system by mean of ode45?
I can not solve them separately, like for example:
tspan = [0 10];
[~, X1approx] = ode45(@(t,y1)f1(y1, tspan, x0);
This is the reason why I am struggling with this one!
I have to send all 5 equations to ode45 at the same time. The reason of this is because the parameters in the function-handle-system are dependent on each other.
I am open for other type of solutions and/or suggestions.
Thanks for your help!!!
0 件のコメント
回答 (1 件)
Jan
2014 年 10 月 5 日
You want to integrate a set of linear interpolations. Linear interpolations are not smooth and the reliability of the result will be questionable, see http://www.mathworks.com/matlabcentral/answers/59582#answer_72047 .
It is not clear what "y1" and "fy1" etc. contain. As long as we cannot see, how the equations are coupled, it is impossible to guess how this can be implemented. The anonymous function for "dx1/dt" has teh input "x1", but does not use it?!
参考
カテゴリ
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!