function first_oder_odeFunderin = 1.7153Funderout = 1.7153Fsep= 0.9406MassUnders = 12.0069t=0:0.01:5;if 0 < t < 3 Cu_in = 0.9717else Cu_in = 0 end [t,Cu]=ode45( @rhs, t, 0); plot(t,Cu); xlabel('t'); ylabel('Cu'); function dCudt = rhs(t,Cu) dCudt = (Funderin* Cu_in - Funderout*Cu - Fsep*Cu)/MassUnders; end end
Currently with the code above I'm trying to generate a graph that should look like this with the red line instead of the blue line. It's a conditional statement that turns off Cu_in (after 3 seconds, Cu_in = 0) and what's left of it is 'drained' away by Fsep and Funderout. Have I approached the question correctly or am I missing something here?
%
Best Answer