POLYMATH Report          DEQ 
 Ordinary Differential Equations       2016-May-31 

Calculated values of DEQ variables
  Variable Initial value Final value Minimal value Maximal value
1 B 0.05 6.71667 0.05 6.71667
2 k 0.3 0.3 0.3 0.3
3 Km 1.0E-06 1.0E-06 1.0E-06 1.0E-06
4 S 5 -1.17E-32 -1.67E-25 5
5 t 0 20 0 20
6 y 0.75 0.75 0.75 0.75

Differential equations
1 d(S)/d(t) = -k * y * B * S / (Km + S)
2 d(B)/d(t) = k * B * S / (Km + S)

Explicit equations
1 k = 0.3
2 y = .75
3 Km = 1.e-6

Problem source text
# S. 24* - Stiff ODE System
# Biological Reactors
# Verified Final Values: B=6.71667, S=0
# Ref.:Prob. 6.1 in Problem Solving in Chemical...
d(S)/d(t) = -k * y * B * S / (Km + S)
d(B)/d(t) = k * B * S / (Km + S)
k = 0.3
y = .75
Km = 1.e-6
t(0) = 0
S(0) = 5
B(0) = 0.05
t(f) =20

Matlab formatted problem
Create m file called PolyOde.m and paste the following text into it.
% S. 24* - Stiff ODE System
% Biological Reactors
% Verified Final Values: B=6.71667, S=0
% Ref.:Prob. 6.1 in Problem Solving in Chemical...
function PolyOde
   tspan = [0 20]; % Range for the independent variable
   y0 = [5; 0.05]; % Initial values for the dependent variables
   [t,y]=ode15s(@ODEfun,tspan, y0);
   plot (t,y);
   xlabel('t');
   legend('S','B');
   fprintf('S = %16.6f \n',y(length(y),1));
   fprintf('B = %16.6f \n',y(length(y),2));
end

function dYfuncvecdt = ODEfun(t,Yfuncvec)
   S = Yfuncvec(1);
   B = Yfuncvec(2);
   k = 0.3;
   y = 0.75;
   Km = 1E-06;
   dSdt = 0 - (k * y * B * S / (Km + S));
   dBdt = k * B * S / (Km + S);
   dYfuncvecdt = [dSdt; dBdt];
end

General Settings
Total number of equations 5
Number of differential equations 2
Number of explicit equations 3
Reporting digits 8
Elapsed time 0.22 sec
Solution method stiff
Independent variable accuracy. eps 1E-05
First stepsize guess. h1 0.02
Minimum allowed stepsize. hmin 2E-07
Good steps 171
Bad steps 16
Calculated Intermediate data points 50

Calculated data points
    t S B
1 0 5 0.05
2 0.87721 4.98871 0.065052
3 1.33257 4.98157 0.074574
4 1.77303 4.97367 0.085109
5 2.19954 4.96496 0.096726
6 2.40784 4.96028 0.102963
7 2.81499 4.95024 0.11634
8 3.21018 4.93926 0.130984
9 3.78201 4.92088 0.155497
10 4.15015 4.90726 0.173655
11 4.50848 4.89248 0.193362
12 4.85749 4.87647 0.214706
13 5.36458 4.85001 0.249984
14 5.69231 4.83064 0.275811
15 6.01222 4.8098 0.303594
16 6.47824 4.77564 0.349148
17 6.92862 4.73776 0.399657
18 7.22068 4.71031 0.436255
19 7.64719 4.66565 0.495804
20 8.06056 4.61655 0.561263
21 8.46156 4.56274 0.633013
22 8.85092 4.50392 0.711445
23 9.22928 4.43978 0.796962
24 9.71771 4.34545 0.922728
25 10.0727 4.26769 1.02642
26 10.4185 4.18353 1.13862
27 10.8661 4.0608 1.30227
28 11.2993 3.92527 1.48297
29 11.6152 3.8147 1.63039
30 12.0251 3.65468 1.84375
31 12.4229 3.47943 2.07743
32 12.8092 3.28799 2.33268
33 13.2769 3.02447 2.68404
34 13.6396 2.79306 2.99259
35 14.0796 2.47634 3.41488
36 14.4215 2.19972 3.7837
37 14.8369 1.82309 4.28588
38 15.2398 1.41011 4.83652
39 15.6309 0.958527 5.43863
40 16.0108 0.466058 6.09526
41 16.4145 -1.67E-25 6.71667
42 16.9422 -6.87E-28 6.71667
43 17.2461 -2.29E-28 6.71667
44 17.8861 -2.55E-29 6.71667
45 18.2061 -8.5E-30 6.71667
46 18.5261 -2.83E-30 6.71667
47 18.8461 -9.45E-31 6.71667
48 19.4861 -1.05E-31 6.71667
49 19.8061 -3.51E-32 6.71667
50 20 -1.17E-32 6.71667