Im trying to find the max Concentration for the curve R and its corresponding time. The max function doesn't seem to work when I tried it.
function CBE350HW10PT1tspan = [0,2000];conc = [0.02,0,0];[t, c] = ode45(@odefun3,tspan,conc);figureplot(t,c)xlabel('Time')ylabel('Concentration')legend('A','R','S')endfunction dCdt = odefun3(t,c)k1 = 0.00108;k2 = 0.00119;k3 = 0.00159;CA = c(1);CR = c(2);CS = c(3);dCdt = zeros(3,1);dCdt(1) = -k1*CA;dCdt(2) = (k1*CA)-(k2*CR)-(k3*CR*CS);dCdt(3) = (k2*CR)-(k3*CR*CS);end
Best Answer