function dydt = sysodeinput(x,y,nvec);
%
%  one reaction
%  2A --> B
%
%nuA = -2.0;
%k = 1.0e-0 ; % 1/sec
%
%  in terms of concentrations
%
%CA = y(1); % mol/liter
%r = k*CA^abs(nuA);
%dydt(1) = nuA*r;
%
%  in terms of conversion
%
%
%XA = y(1);
%CAo = 1;
%CA = CAo*(1-XA);
%rate = k*CA^2;
%dydt(1) = -nuA/CAo*rate;
%
%  in terms of moles
%
%V = 1.0; % liters
%NA = y(1);
%CA = NA/V;
%r = k*CA^abs(nuA);
%dydt(1) = nuA*V*r;
%
%  in terms of concentrations
%
%CA = y(1); % mol/liter
%CB = y(2);
%nuB = 1.0;
%r = k*CA^abs(nuA);
%dydt(1) = nuA*r;
%dydt(2) = nuB*r;

%
% reversible reactions
%
%  A + B <--> 2C
%
%  treat as two reactions
%
%  reaction 1:  A + B --> 2C
%  reaction 2:  2C --> A + B
%nuA1 = -1;
%nuB1 = -1;
%nuC1 = 2;
%nuA2 = 1;
%nuB2 = 1;
%nuC2 = -2;
%CA = y(1);
%CB = y(2);
%CC = y(3);
%k1 = 1.0e+0; % liters/mole/sec
%k2 = 1.0e+0; % liters/mole/sec
%rate1 = k1*CA*CB;
%rate2 = k2*CC^2;
%  balance on A in terms of conc of A
%dydt(1) = nuA1*rate1+nuA2*rate2;
%  balance on B in terms of conc of B
%dydt(2) = nuB1*rate1+nuB2*rate2;
%  balance on C in terms of conc of C
%dydt(3) = nuC1*rate1+nuC2*rate2;
%
% mutliple reactions
%
%  A + B --> C
%  B + C --> D
%
nuA1 = -1;
nuB1 = -1;
nuC1 = 1;
nuD1 = 0;
nuA2 = 0;
nuB2 = -1;
nuC2 = -1;
nuD2 = 1;
CA = y(1);
CB = y(2);
CC = y(3);
CD = y(4);
k1 = 1.0e+0; % liters/mole/sec
k2 = 1.0e+0; % liters/mole/sec
rate1 = k1*CA*CB;
rate2 = k2*CB*CC;
%  balance on A in terms of conc of A
dydt(1) = nuA1*rate1+nuA2*rate2;
%  balance on B in terms of conc of B
dydt(2) = nuB1*rate1+nuB2*rate2;
%  balance on C in terms of conc of C
dydt(3) = nuC1*rate1+nuC2*rate2;
%  balance on D in terms of conc of D
dydt(4) = nuD1*rate1+nuD2*rate2;
