How to use extra time varying discrete inputs in Ode45?
Show older comments
For example as shown in the function below: Where Ts is the variable with initial value, while Qu is input but it changes with time having specific values defined in the matrix.
function Ts=temp(t,Ts,Qu) Ts=Qu/(1500*4190)-12*10^6/(1500*4190)-11.1*3600*(Ts-20)/(1500*4190);
I am using in this way: Qu=[0 0 0 0 0 0 0 0 21 41 60 75] for j=1:12 Qu=Qu(t); [t,Ts]=ode45(@(t,Ts)temp(t,Ts,Qu),(1:1:12),45) end
But its giving error... please explain how to use inputs with changing time with this example.
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!