How to numerically solve first order differential equation with dependent variables?
Show older comments
My equation looks like this:
(a1*b1*c1+a2*b2*c2)dT/dt = u*p*V(t) - (k1+k2)*(T-Tinf)
with an initial condition: T(0)=Tinf and V(t)=V0(1-t/ts)
I'm very new to matlab and have been trying to implement dsolve and ode45, but can't figure out how to include the initial condition and the velocity function within the solution. Any help is appreciated.
2 Comments
James Tursa
on 25 Apr 2020
Please post the code you have tried so far and we can point you in the right direction.
Michael Ortiz
on 25 Apr 2020
Answers (1)
darova
on 25 Apr 2020
You didn't declared variables inside each function

Do this like this
function Vel=fvel(t)
V0 = 5;
ts = 0.3;
Vel = V0*(1-t/ts);
Categories
Find more on Ordinary Differential Equations 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!