Info
此问题已关闭。 请重新打开它进行编辑或回答。
output middle variable in ode45 to the main function
1 次查看(过去 30 天)
显示 更早的评论
Here are the problems I encountered:
1. ode45 can only relate one variable to time t, in this case it's T(including Tcr Tmu Tfat Tvsk Tsk Tbl)
2. BF, CO and HR are used to be sub-sub-sub function of obtaining the coupled differential equations,
For example,
in my main function, [t,T] = ode45(@(t,T) Tcoupled(H,T,MuVO2,VO2,Mtot), tspan, T0);
in Tcoupled function: coupled = [tcr; tmu; tfat; tvsk; tsk; tbl;] will be returned as the 6 differential equations' matrix take tbl as an example: it's one of the differential equations returned from function HBSL in hsbl = feval(@HSBL,T,Mtot,MuVO2,VO2);
in HSBL function: BF=feval(@getBF,VO2,T,MuVO2); (have to mention CO and HR are in subfunction of BF)
Now, I have successfully moved BF,CO and into the subfunction Tcoupled , however, the purpose of Tcouple function is just return the differential equations into the input of ode45. BF,CO and HR have to be inside so that their value change over time. But in this case, i don't know how to output them to the main function.
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!