function y=no2(t,u)
% Oxidation of NO to NO2.
% Atkins and Jones, first edition, pp. 624-625. 
% [t,u]=ode_cg1('no2', [0, 300], [.5; 1; 0; 0],.001);
% [t,u]=my_ode('no2', [0, 20], [.5; 1; 0; 0],.01); 

% rate constants 
k11=10;
k12=10;
k21=.01;
% k22=.0001;
k22=0;

% reaction rates 
r11=k11*u(1)^2;  
r12=k12*u(3);
r21=k21*u(2)*u(3);
r22=k22*u(4)^2;

s1=0; s2=0;  % source terms

y=zeros(size(u));

y(1)=-2*r11+2*r12+s1;  % NO
y(2)=-r21+r22+s1;      % O2
y(3)=r11-r12-r21+r22;  % N2O2
y(4)=2*r21-2*r22;      % NO2

