# Example 25- Boundary Value ODE System # Diffusion with Reaction # Verified Final Values: CA = 0.140461, y = 2.76438 # Ref.: Comput. Appl. Eng. Educ. 6: 175-176, 1998 d ( CA ) / d ( z ) = y d ( y ) / d ( z ) = k * CA / DAB d ( CA1 ) / d ( z ) = y1 d ( y1 ) / d ( z ) = k * CA1 / DAB k = 0.001 DAB = 1.2E-9 err = y - 0 err1 = y1 - 0 y0 = -130 L = .001 delta = 0.0001 CAanal = 0.2 * cosh ( L * ( k / DAB ) ^ .5 * ( 1 - z / L ) ) / ( cosh ( L * ( k / DAB ) ^ .5 ) ) derr = ( err1 - err ) / ( delta * y0 ) ynew = y0 - err / derr z ( 0 ) = 0 CA ( 0 ) = 0.2 y ( 0 ) = -130 CA1 ( 0 ) = 0.2 y1 ( 0 ) = -130.013 z ( f ) = 0.001
Calculated values
Variable
Initial value
Minimal value
Maximal value
Final value
1
CA
0.2
0.14044176
0.2
0.14046056
2
CA1
0.2
0.1404276
0.2
0.14044568
3
CAanal
0.2
0.13827265
0.2
0.13827265
4
DAB
1.2E-09
1.2E-09
1.2E-09
1.2E-09
5
delta
0.0001
0.0001
0.0001
0.0001
6
derr
1
1
1.4464177
1.4464177
7
err
-130
-130
2.7643829
2.7643829
8
err1
-130.013
-130.013
2.7455795
2.7455795
9
k
0.001
0.001
0.001
0.001
10
L
0.001
0.001
0.001
0.001
11
y
-130
-130
2.7643829
2.7643829
12
y0
-130
-130
-130
-130
13
y1
-130.013
-130.013
2.7455795
2.7455795
14
ynew
-5.2268E-11
-131.91119
-5.2268E-11
-131.91119
15
z
0
0
0.001
0.001
Integration chart 
-140
-120
-100
-80
-60
-40
-20
0
20
0
0.0002
0.0004
0.0006
0.0008
0.001
z
CA
y
CA1
y1
Formatted equations
d
C
A
(
)
d
z
(
)
=
y
d
y
(
)
d
z
(
)
=
∙
k
C
A
D
A
B
d
C
A
1
(
)
d
z
(
)
=
y
1
d
y
1
d
z
(
)
=
∙
k
C
A
1
D
A
B
k
=
0
.
0
0
1
D
A
B
=
1
.
2
E
-
9
e
r
r
=
−
y
0
e
r
r
1
=
−
y
1
0
y
0
=
−
1
3
0
L
=
.
0
0
1
δ
=
0
.
0
0
0
1
C
A
a
n
a
l
=
0
.
2
c
o
s
h
∙
∙
L
k
D
A
B
.
5
−
1
z
L
c
o
s
h
∙
L
k
D
A
B
.
5
d
e
r
r
=
−
e
r
r
1
e
r
r
∙
δ
y
0
y
n
e
w
=
−
y
0
e
r
r
d
e
r
r
Differential equations
1
d(CA)/d(z) = y
2
d(y)/d(z) = k*CA/DAB
3
d(CA1)/d(z) = y1
4
d(y1)/d(z) = k*CA1/DAB
Explicit equations
1
k = 0.001
2
DAB = 1.2E-9
3
err = y-0
4
err1 = y1-0
5
y0 = -130
6
L = .001
7
delta = 0.0001
8
CAanal = 0.2*cosh(L*(k/DAB)^.5*(1-z/L))/(cosh(L*(k/DAB)^.5))
9
derr = (err1-err)/(delta*y0)
10
ynew = y0-err/derr
General
Total number of equations
14
Number of differential equations
4
Number of explicit equations
10
Reporting digits
10
Elapsed time
0.00 sec
Solution method
RKF_45
Step size guess. h
1E-06
Truncation error tolerance. eps
1E-06
Calculated Intermediate data points
50
Calculated data points
z
CA
y
CA1
y1
k
DAB
err
err1
y0
L
delta
CAanal
derr
ynew
1
0
0.2
-130
0.2
-130.013
0.001
1.2E-09
-130
-130.013
-130
0.001
0.0001
0.2
1
-5.2268E-11
2
0.000049
0.19382799
-121.96069
0.19382736
-121.9737
0.001
1.2E-09
-123.25617
-123.26918
-130
0.001
0.0001
0.19473048
1.0007005
-6.8301088
3
0.000065
0.19189723
-119.38923
0.19189638
-119.40225
0.001
1.2E-09
-120.67177
-120.68479
-130
0.001
0.0001
0.19274848
1.001354
-9.4914001
4
0.000081
0.1900074
-116.84324
0.19000635
-116.85628
0.001
1.2E-09
-118.11312
-118.12615
-130
0.001
0.0001
0.1908076
1.0022212
-12.148653
5
0.000113
0.18634896
-111.82552
0.18634749
-111.83859
0.001
1.2E-09
-113.07087
-113.08393
-130
0.001
0.0001
0.18704756
1.0045973
-17.446567
6
0.000129
0.18457957
-109.3527
0.18457789
-109.36579
0.001
1.2E-09
-110.58619
-110.59927
-130
0.001
0.0001
0.18522759
1.0061066
-20.085013
7
0.000145
0.18284955
-106.90322
0.18284766
-106.91633
0.001
1.2E-09
-108.12511
-108.13821
-130
0.001
0.0001
0.18344714
1.0078306
-22.714994
8
0.000161
0.18115854
-104.47654
0.18115644
-104.48968
0.001
1.2E-09
-105.68709
-105.70022
-130
0.001
0.0001
0.18170583
1.0097696
-25.335435
9
0.000193
0.17789212
-99.68954
0.1778896
-99.702743
0.001
1.2E-09
-100.87819
-100.89137
-130
0.001
0.0001
0.17833913
1.0142943
-30.543474
10
0.000209
0.176316
-97.328195
0.17631327
-97.341432
0.001
1.2E-09
-98.506272
-98.519492
-130
0.001
0.0001
0.17671303
1.016881
-33.129007
11
0.000225
0.1747775
-94.987613
0.17477456
-95.000888
0.001
1.2E-09
-96.155371
-96.168627
-130
0.001
0.0001
0.17512463
1.0196846
-35.700872
12
0.000241
0.17327629
-92.667296
0.17327313
-92.680611
0.001
1.2E-09
-93.824983
-93.838278
-130
0.001
0.0001
0.17357358
1.0227058
-38.258089
13
0.000273
0.17038445
-88.085478
0.17038087
-88.098884
0.001
1.2E-09
-89.223764
-89.237146
-130
0.001
0.0001
0.17058227
1.0294033
-43.324777
14
0.000289
0.16899321
-85.823001
0.16898941
-85.836456
0.001
1.2E-09
-86.951951
-86.965381
-130
0.001
0.0001
0.16914135
1.0330812
-45.832411
15
0.000305
0.16763802
-83.578832
0.167634
-83.592339
0.001
1.2E-09
-84.698688
-84.712169
-130
0.001
0.0001
0.16773652
1.0369794
-48.321725
16
0.000321
0.16631859
-81.352494
0.16631436
-81.366057
0.001
1.2E-09
-82.463494
-82.477028
-130
0.001
0.0001
0.16636748
1.0410988
-50.791868
17
0.000353
0.16378591
-76.951414
0.16378124
-76.965095
0.001
1.2E-09
-78.045411
-78.059061
-130
0.001
0.0001
0.16373558
1.050005
-55.671389
18
0.000369
0.16257211
-74.775733
0.16256723
-74.789477
0.001
1.2E-09
-75.861579
-75.875292
-130
0.001
0.0001
0.16247216
1.0547936
-58.079216
19
0.000385
0.161393
-72.616004
0.16138789
-72.629815
0.001
1.2E-09
-73.693932
-73.707709
-130
0.001
0.0001
0.16124341
1.0598072
-60.464773
20
0.000401
0.16024832
-70.471766
0.16024299
-70.485647
0.001
1.2E-09
-71.542006
-71.555851
-130
0.001
0.0001
0.16004906
1.0650469
-62.827365
21
0.000433
0.15806128
-66.22794
0.1580555
-66.241969
0.001
1.2E-09
-67.283486
-67.297476
-130
0.001
0.0001
0.15776253
1.0762091
-67.48103
22
0.000449
0.15701845
-64.127446
0.15701245
-64.141553
0.001
1.2E-09
-65.175983
-65.190051
-130
0.001
0.0001
0.15666988
1.082134
-69.770877
23
0.000465
0.15600913
-62.040632
0.1560029
-62.054821
0.001
1.2E-09
-63.082385
-63.096533
-130
0.001
0.0001
0.15561065
1.0882898
-72.035305
24
0.000481
0.15503308
-59.967054
0.15502663
-59.981328
0.001
1.2E-09
-61.002244
-61.016475
-130
0.001
0.0001
0.15458461
1.0946777
-74.273786
25
0.000513
0.15318002
-55.857839
0.1531731
-55.87229
0.001
1.2E-09
-56.880565
-56.894971
-130
0.001
0.0001
0.15263127
1.1081556
-78.670958
26
0.000529
0.1523026
-53.821324
0.15229545
-53.83587
0.001
1.2E-09
-54.838146
-54.852644
-130
0.001
0.0001
0.15170354
1.1152484
-80.828761
27
0.000545
0.15145767
-51.796292
0.15145029
-51.810934
0.001
1.2E-09
-52.807427
-52.82202
-130
0.001
0.0001
0.15080817
1.1225792
-82.958839
28
0.000561
0.15064506
-49.782309
0.15063744
-49.797051
0.001
1.2E-09
-50.787973
-50.802665
-130
0.001
0.0001
0.14994498
1.1301494
-85.060833
29
0.000593
0.14911608
-45.785778
0.14910799
-45.80073
0.001
1.2E-09
-46.781142
-46.79604
-130
0.001
0.0001
0.14831439
1.1460149
-89.179288
30
0.000609
0.14839939
-43.802377
0.14839106
-43.817438
0.001
1.2E-09
-44.79291
-44.807916
-130
0.001
0.0001
0.14754664
1.1543134
-91.195194
31
0.000625
0.14771435
-41.82832
0.14770578
-41.843494
0.001
1.2E-09
-42.814233
-42.829351
-130
0.001
0.0001
0.14681037
1.1628583
-93.1819
32
0.000641
0.14706083
-39.863188
0.14705202
-39.878477
0.001
1.2E-09
-40.844691
-40.859923
-130
0.001
0.0001
0.14610542
1.1716512
-95.139207
33
0.000673
0.14584778
-35.958017
0.14583847
-35.973549
0.001
1.2E-09
-36.931329
-36.946799
-130
0.001
0.0001
0.14478888
1.1899889
-98.96498
34
0.000689
0.14528799
-34.017146
0.14527843
-34.032804
0.001
1.2E-09
-34.986675
-35.002269
-130
0.001
0.0001
0.14417701
1.1995376
-100.8332
35
0.000705
0.14475919
-32.083533
0.14474938
-32.099319
0.001
1.2E-09
-33.049484
-33.065206
-130
0.001
0.0001
0.1435959
1.2093421
-102.67152
36
0.000721
0.14426128
-30.156764
0.14425121
-30.172683
0.001
1.2E-09
-31.119344
-31.135197
-130
0.001
0.0001
0.14304543
1.2194047
-104.47989
37
0.000753
0.14335768
-26.322117
0.1433471
-26.338311
0.001
1.2E-09
-27.278571
-27.294695
-130
0.001
0.0001
0.14203592
1.2403124
-108.00669
38
0.000769
0.1429518
-24.413421
0.14294097
-24.429758
0.001
1.2E-09
-25.367118
-25.383383
-130
0.001
0.0001
0.14157667
1.251162
-109.72515
39
0.000785
0.14257642
-22.509934
0.14256532
-22.526417
0.001
1.2E-09
-23.461077
-23.477487
-130
0.001
0.0001
0.14114762
1.2622786
-111.41371
40
0.000801
0.14223146
-20.611248
0.14222009
-20.627881
0.001
1.2E-09
-21.560041
-21.576599
-130
0.001
0.0001
0.14074869
1.2736645
-113.07243
41
0.000833
0.1416325
-16.826665
0.14162059
-16.843608
0.001
1.2E-09
-17.771364
-17.788228
-130
0.001
0.0001
0.14004082
1.2972538
-116.30078
42
0.000849
0.14137837
-14.939959
0.14136619
-14.957063
0.001
1.2E-09
-15.882913
-15.899936
-130
0.001
0.0001
0.13973173
1.3094624
-117.87066
43
0.000865
0.1411544
-13.056441
0.14114195
-13.073709
0.001
1.2E-09
-13.997852
-14.015037
-130
0.001
0.0001
0.13945246
1.3219503
-119.41121
44
0.000881
0.14096055
-11.175708
0.14094782
-11.193144
0.001
1.2E-09
-12.115776
-12.133128
-130
0.001
0.0001
0.13920294
1.3347202
-120.92261
45
0.000913
0.14066302
-7.4209939
0.14064973
-7.4387766
0.001
1.2E-09
-8.3589786
-8.3766732
-130
0.001
0.0001
0.13879293
1.361117
-123.85874
46
0.000929
0.14055928
-5.5462119
0.14054571
-5.5641737
0.001
1.2E-09
-6.483455
-6.5013268
-130
0.001
0.0001
0.13863237
1.3747496
-125.2839
47
0.000945
0.14048554
-3.6726131
0.14047167
-3.6907578
0.001
1.2E-09
-4.6093145
-4.6273673
-130
0.001
0.0001
0.13850138
1.3886754
-126.68078
48
0.000961
0.14044176
-1.7997977
0.1404276
-1.8181293
0.001
1.2E-09
-2.7361574
-2.7543951
-130
0.001
0.0001
0.13839993
1.4028976
-128.04964
49
0.000993
0.14044408
1.9450805
0.14042933
1.9263635
0.001
1.2E-09
1.0088052
0.99018604
-130
0.001
0.0001
0.13828561
1.4322427
-130.70435
50
0.001
0.14046056
2.7643829
0.14044568
2.7455795
0.001
1.2E-09
2.7643829
2.7455795
-130
0.001
0.0001
0.13827265
1.4464177
-131.91119