function [s,v,w,r,T]=fingint(tf) % This function uses Matlab's ode45 to numerically solve the system of % differential equations for Eichner and Hadeler's OPV model (see paper for % reference). One integrates the system by typing 'fingint(1)' into the % command window. global p m a b c d %par=[1/45 144 36 12 12]; %known constants and variable paramters m=1/45; a=144; b=36; c=12; d=12; p=0.6875; col=''; x0=[.9,0,.1,0]; %initial conditions s=[]; v=[]; w=[]; r=[]; T=[]; op=odeset('reltol',1e-10, 'abstol',1e-11,'stats','on'); tic tspan=[0, tf]; [t,x] = ode45('fingeqns',tspan,x0,op); s=[s;x(:,1)]; v=[v;x(:,2)]; w=[w;x(:,3)]; r=[r;x(:,4)]; T=[T;t]; toc plot(T,s,T,v,T,w,col) legend('s','v','w',0) hold off; final=[s(end) v(end) w(end) r(end)]