Vous êtes sur la page 1sur 8

Homework #9

Due 11/07/08
Phosphorus kinetics in a batch reactor
For the work of Burgoa et al. (1990) with a soil/solution ratio of 0.500 kg L-1 we estimate ka=0.050 L mg1 -1
h , kd=0.25h-1, kr=0.005h-1, S0=220mgL-1. Assume P0=101.8mgL-1 and A0=0.00mgL-1.
The kinetic equation become
>0

= . + .

= . .

= .

= = . , = ,

= .

1- Use the Euler method of numerical integration to estimate P, A and S with time.
Answer:
Euler method;
To solve the differential equation of the form below using Euler method,

= (, )

Starting at the initial condition (x0,y0), we will have:


+1 = + (

) (
)
+1

Here we are given


dp
t>0
= 0.050SP + 0.25A
dt
dA
= 0.050SP 0.255A
dt
S = 220.00 A
Which can be written in the below form

>0
= k a SP + k d

== k a SP k d k r

= S0
This corresponds to the following numerical solution:

+1 = + ( ) ( )

+1 = + ( ) ( )

Sn = S0 A n

Ramin Shamshiri

ABE 6986, HW #9

Due 11/07/08

The calculations are done through the following MATLAB program using 500 n points and time steps of 0.01,
results are shown in Table 1.

% ABE6986 Homework #9 MATLAB program to solve Langmuir-Hinshelwood model of soil phosphorus kinetics
through Euler method (Author: Ramin Shamshiri UFID #90213353)
%Constants
ka=0.050; kd=0.25; kr=0.005; S0=220; P0=101.8; A0=0;npoints = 10000; dt = 0.01;
% Initialize vectors and set all cells to zeros
dp_dt= zeros(npoints,1);
dA_dt= zeros(npoints,1);
P = zeros(npoints,1);
A = zeros(npoints,1);
S = zeros(npoints,1);
t = zeros(npoints,1);

%Initial condition at t=0


dp_dt(1) =(-ka* S0*P0)+(kd* A0);
dA_dt(1)=(ka* S0*P0)-(kd* A0)-( kr* A0);
P(1) = P0;
A(1) = A0;
S(1) = S0;
% loop over the npoint and time steps dt
for step=1:npoints -1 ;
P(step+1) =(P(step) )+dp_dt(step)*dt;
A(step+1) =(A(step) )+ dA_dt(step)*dt;
S(step+1)= S0-A(step+1);
dp_dt(step+1) =(-ka* S(step+1)*P(step+1))+(kd* A(step+1));
dA_dt(step+1)=(ka* S(step+1)*P(step+1))-(kd* A(step+1))-( kr* A(step+1));
t(step+1)=step*dt;
end
%plotting results separately
plot(t,P,'r');
plot(t,A,'b');
%plotting results in the same graph
plot(t,P,'r');
hold on;
plot(t,A,'b');

Ramin Shamshiri

ABE 6986, HW #9

Due 11/07/08

t
h

Pn

An

Sn

(dp/dt)n

(dA/dt)n

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.
.
449
450
451
452
453
454
455
456
457

0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
0.11
0.12
0.13
0.14
0.15
0.16
0.17
0.18
0.19
0.2
0.21
0.22
0.23
0.24
0.25
0.26
0.27
0.28
0.29
0.3
0.31
0.32
0.33
0.34
0.35
0.36
0.37
0.38
0.39
0.4
0.41
0.42
0.43
0.44
0.45
0.46
0.47
0.48
0.49
.
.
.
.
4.5
4.51
4.52
4.53
4.54
4.55
4.56
4.57

101.8
90.602
81.171
73.131
66.207
60.191
54.926
50.288
46.18
42.524
39.254
36.32
33.677
31.289
29.127
27.162
25.374
23.743
22.252
20.888
19.637
18.488
17.432
16.46
15.565
14.739
13.976
13.271
12.619
12.016
11.457
10.94
10.46
10.014
9.6009
9.217
8.8604
8.529
8.2209
7.9343
7.6677
7.4195
7.1886
6.9735
6.7732
6.5865
6.4126
6.2506
6.0995
5.9587
.
.
.
.
3.8628
3.8625
3.8622
3.8618
3.8615
3.8612
3.8609
3.8606

0
11.198
20.628
28.667
35.59
41.604
46.867
51.502
55.608
59.262
62.528
65.46
68.099
70.483
72.643
74.603
76.388
78.015
79.502
80.862
82.109
83.254
84.305
85.273
86.165
86.986
87.745
88.445
89.093
89.691
90.246
90.759
91.234
91.675
92.084
92.463
92.815
93.142
93.445
93.727
93.989
94.233
94.459
94.669
94.865
95.047
95.216
95.373
95.519
95.655
.
.
.
.
95.814
95.809
95.805
95.8
95.796
95.791
95.787
95.782

220
208.8
199.37
191.33
184.41
178.4
173.13
168.5
164.39
160.74
157.47
154.54
151.9
149.52
147.36
145.4
143.61
141.99
140.5
139.14
137.89
136.75
135.69
134.73
133.84
133.01
132.26
131.55
130.91
130.31
129.75
129.24
128.77
128.32
127.92
127.54
127.18
126.86
126.55
126.27
126.01
125.77
125.54
125.33
125.14
124.95
124.78
124.63
124.48
124.34
.
.
.
.
124.19
124.19
124.2
124.2
124.2
124.21
124.21
124.22

-1119.8
-943.09
-804
-692.45
-601.56
-526.49
-463.76
-410.8
-365.68
-326.94
-293.44
-264.28
-238.75
-216.29
-196.44
-178.81
-163.1
-149.05
-136.45
-125.1
-114.86
-105.6
-97.198
-89.565
-82.615
-76.275
-70.483
-65.182
-60.324
-55.866
-51.77
-48.003
-44.533
-41.335
-38.385
-35.66
-33.142
-30.813
-28.658
-26.663
-24.813
-23.099
-21.508
-20.032
-18.662
-17.389
-16.206
-15.106
-14.084
-13.133
.
.
.
.
-0.03197
-0.03196
-0.03196
-0.03196
-0.03195
-0.03195
-0.03194
-0.03194

1119.8
943.04
803.9
692.31
601.38
526.28
463.52
410.54
365.41
326.65
293.13
263.95
238.41
215.94
196.08
178.44
162.72
148.66
136.05
124.7
114.45
105.18
96.776
89.138
82.184
75.84
70.044
64.74
59.879
55.418
51.319
47.549
44.077
40.877
37.924
35.198
32.678
30.348
28.191
26.194
24.343
22.628
21.036
19.559
18.188
16.914
15.73
14.629
13.606
12.654
.
.
.
.
-0.4471
-0.44708
-0.44706
-0.44705
-0.44703
-0.44701
-0.44699
-0.44697

Ramin Shamshiri

ABE 6986, HW #9

Due 11/07/08

458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499

Ramin Shamshiri

4.58
4.59
4.6
4.61
4.62
4.63
4.64
4.65
4.66
4.67
4.68
4.69
4.7
4.71
4.72
4.73
4.74
4.75
4.76
4.77
4.78
4.79
4.8
4.81
4.82
4.83
4.84
4.85
4.86
4.87
4.88
4.89
4.9
4.91
4.92
4.93
4.94
4.95
4.96
4.97
4.98
4.99

3.8602
3.8599
3.8596
3.8593
3.859
3.8586
3.8583
3.858
3.8577
3.8574
3.8571
3.8567
3.8564
3.8561
3.8558
3.8555
3.8551
3.8548
3.8545
3.8542
3.8539
3.8535
3.8532
3.8529
3.8526
3.8523
3.852
3.8516
3.8513
3.851
3.8507
3.8504
3.85
3.8497
3.8494
3.8491
3.8488
3.8485
3.8481
3.8478
3.8475
3.8472

95.778
95.773
95.769
95.764
95.76
95.756
95.751
95.747
95.742
95.738
95.733
95.729
95.724
95.72
95.715
95.711
95.706
95.702
95.697
95.693
95.689
95.684
95.68
95.675
95.671
95.666
95.662
95.657
95.653
95.648
95.644
95.639
95.635
95.63
95.626
95.622
95.617
95.613
95.608
95.604
95.599
95.595

124.22
124.23
124.23
124.24
124.24
124.24
124.25
124.25
124.26
124.26
124.27
124.27
124.28
124.28
124.28
124.29
124.29
124.3
124.3
124.31
124.31
124.32
124.32
124.32
124.33
124.33
124.34
124.34
124.35
124.35
124.36
124.36
124.37
124.37
124.37
124.38
124.38
124.39
124.39
124.4
124.4
124.41

ABE 6986, HW #9

-0.03194
-0.03193
-0.03193
-0.03193
-0.03192
-0.03192
-0.03192
-0.03191
-0.03191
-0.0319
-0.0319
-0.0319
-0.03189
-0.03189
-0.03189
-0.03188
-0.03188
-0.03188
-0.03187
-0.03187
-0.03186
-0.03186
-0.03186
-0.03185
-0.03185
-0.03185
-0.03184
-0.03184
-0.03184
-0.03183
-0.03183
-0.03182
-0.03182
-0.03182
-0.03181
-0.03181
-0.03181
-0.0318
-0.0318
-0.0318
-0.03179
-0.03179

-0.44695
-0.44693
-0.44692
-0.4469
-0.44688
-0.44686
-0.44684
-0.44682
-0.4468
-0.44678
-0.44677
-0.44675
-0.44673
-0.44671
-0.44669
-0.44667
-0.44665
-0.44663
-0.44662
-0.4466
-0.44658
-0.44656
-0.44654
-0.44652
-0.4465
-0.44649
-0.44647
-0.44645
-0.44643
-0.44641
-0.44639
-0.44637
-0.44635
-0.44634
-0.44632
-0.4463
-0.44628
-0.44626
-0.44624
-0.44622
-0.4462
-0.44619

Due 11/07/08

2- What happens to the values as time step t0.4?


Answer:
By changing dt from 0.01 to 0.4 and same npoints, we get the following results. It looks like that the values
diverge between alternating large positive and negative numbers.

n
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

499

t
h
0
0.4
0.8
1.2
1.6
2
2.4
2.8
3.2
3.6
4
4.4
4.8
5.2
5.6
.
.
199.6

Ramin Shamshiri

Pn

101.8
-346.12
-1879.1
-67824
-9.19E+07
-1.69E+14
-5.71E+26
-6.51E+51
########
########
#NAME?
NaN
NaN
NaN
NaN
.
.
NaN

An

Sn

(dp/dt)n

(dA/dt)n

0
447.92
1980
67921
9.19E+07
1.69E+14
5.71E+26
6.51E+51
########
########
Inf
NaN
NaN
NaN
NaN
.
.
NaN

220
-227.92
-1760
-67701
-9.19E+07
-1.69E+14
-5.71E+26
-6.51E+51
########
########
#NAME?
NaN
NaN
NaN
NaN
.
.
NaN

-1119.8
-3832.4
-1.65E+05
-2.30E+08
-4.22E+14
-1.43E+27
-1.63E+52
########
########
#NAME?
NaN
NaN
NaN
NaN
NaN
.
.
NaN

1119.8
3830.2
1.65E+05
2.30E+08
4.22E+14
1.43E+27
1.63E+52
########
########
Inf
NaN
NaN
NaN
NaN
NaN
.
.
NaN

ABE 6986, HW #9

Due 11/07/08

3- How do these results compare to Figure 2 of Overman and Scholtz (1999)?


Answer:
Comparison of results of this homework versus Figure 2 of Overman and Scholts (1999) are shown in Figure
below. As it can be seen, increasing value of S from 47.1mgL-1 in Overman (1999) to 220mgL-1 in this
homework decreases the solution P concentration from approximately 52.5mgL-1 to 3.84mgL-1.

Ramin Shamshiri

ABE 6986, HW #9

Due 11/07/08

Ramin Shamshiri

ABE 6986, HW #9

Due 11/07/08

4- Compare the values of ka, S0, kd and kr.


Answer:
The three values of ka, S0, kd and kr are the same in this homework and what has presented in Overman and
Scholtz (1999) work.
5- How does the Langmuir-Hinshelwood model explain the rapid drop in P with time during the initial
phase?
Answer:
The Langmuir-Hinshelwood model provides excellent simulation of batch kinetics for this system. The most
important concern in utilizing this model is being careful in choosing t which is required for this system of
equations. Different values of t leads to different results which in some cases divergence occur.

6- For the case of large S0 and small P0, is it reasonable to treat S as a constant? Explain.
Answer:
Yes, it is reasonable. To test this, the value of S 0 was selected 2200 and small P0 was set at 1.8. The results
showed that after 3 n points, the values of S became constant and equal to 2198.2. This is due to the nature of
the model and algorithm used to determine the answer. According to below:
Sn = S0 A n

+1 = + ( ) ( )

== k a SP k d k r

When S0 is very large and P0 is very small, the values of A0 also becomes small as number of n points increase,
which leads to small difference between S and S 0.

Ramin Shamshiri

ABE 6986, HW #9

Due 11/07/08

Vous aimerez peut-être aussi