function prob_2_18 % % Written by: % -- % John L. Weatherwax 2005-05-07 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- % x_1 = y(1), x_2 = y(2), y = y(3) options = odeset('AbsTol',1e-20); %ode15s(@odes,[0 8e5],[0; 1; 0],options); ode45(@odes,[0 8e5],[0; 1; 0],options); %=================================================== function dydt = odes(t,y) k = [8.4303270e-10 2.9002673e+11 2.4603642e+10 8.7600580e-06]; dydt = zeros(3,1); dydt(1) = -k(1)*y(1) + k(2)*y(3); dydt(2) = -k(4)*y(2) + k(3)*y(3); dydt(3) = k(1)*y(1) + k(4)*y(2) - (k(2) + k(3))*y(3);