Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

output middle variable in ode45 to the main function

조회 수: 3 (최근 30일)
jin wang
jin wang 2015년 12월 4일
마감: MATLAB Answer Bot 2021년 8월 20일
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개)

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by