Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

output middle variable in ode45 to the main function

1 Ansicht (letzte 30 Tage)
jin wang
jin wang am 4 Dez. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by