function reactionODE(x0,T,s)

% solves an initial value problem from process simulation
% by Runge-Kutta-Fehlberg (explicit) or by the trapezoidal rule (implicit)
% parameter:
% initial value x0; final time T;
% method selection explicit (s=0) or implicit (s=1)
% examples:  reactionODE([1 0 0],0.4,s)


if nargin==2 s=0; end

if s 
[t,y]=ode23t('reaction',[0 T],x0,odeset('OutputFcn',@odeplot));
%plot(t,y(:,1),'-b',t,y(:,2),'-r',t,y(:,3),'-g')
else
[t,y]=ode45('reaction',[0 T],x0,odeset('OutputFcn',@odeplot));
%plot(t,y(:,1),'-b',t,y(:,2),'-r',t,y(:,3),'-g')
end
waitforbuttonpress

plot(t,y(:,2),'-g')


return