Example 3.8  Cylindrical Catalyst Pellet 

In the example discussed above, both the boundary conditions are of the Neumann type.  However, many problems involve derivative boundary conditions.  These problems can be handled by using the three point forward and backward differences at x = 0 and x = 1, respectively.  This is illustrated by solving the cylindrical pellet problem solved in example 3.6 with a different boundary condition at the surface (x = 1): 

 

Typesetting:-mrow(Typesetting:-mo(Typesetting:-mrow(Typesetting:-mi(                                                     (3.67) 

 

The Maple program developed for the previous example can be modified to handle the derivative boundary conditions. 

> restart:
 

> with(linalg):with(plots):
 

> N:=4;
 

4 (1)
 

> L:=1;
 

1 (2)
 

> eq:=diff(y(x),x$2)+1/x*diff(y(x),x)-phi^2*y(x);
 

`+`(diff(diff(y(x), x), x), `/`(`*`(diff(y(x), x)), `*`(x)), `-`(`*`(`^`(phi, 2), `*`(y(x))))) (3)
 

> bc1:=diff(y(x),x);
 

diff(y(x), x) (4)
 

> bc2:=diff(y(x),x)-1+y(x);
 

`+`(diff(y(x), x), `-`(1), y(x)) (5)
 

The central difference expression for the second and first derivatives are 

> d2ydx2:=(y[m+1]-2*y[m]+y[m-1])/h^2;
 

`/`(`*`(`+`(y[`+`(m, 1)], `-`(`*`(2, `*`(y[m]))), y[`+`(m, `-`(1))])), `*`(`^`(h, 2))) (6)
 

> dydx:=(y[m+1]-y[m-1])/2/h;
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(y[`+`(m, 1)], `-`(y[`+`(m, `-`(1))])))), `*`(h))) (7)
 

The three point forward and backward difference expressions for the derivative are: 

> dydxf:=(-y[2]+4*y[1]-3*y[0])/(2*h);
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(`-`(y[2]), `*`(4, `*`(y[1])), `-`(`*`(3, `*`(y[0])))))), `*`(h))) (8)
 

> dydxb:=(y[N-1]-4*y[N]+3*y[N+1])/(2*h);
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(y[3], `-`(`*`(4, `*`(y[4]))), `*`(3, `*`(y[5]))))), `*`(h))) (9)
 

The governing equation in finite difference form is: 

> Eq[m]:=subs(diff(y(x),x$2)=d2ydx2,diff(y(x),x)=dydx,y(x)=y[m],x=m*h,eq);
 

`+`(`/`(`*`(`+`(y[`+`(m, 1)], `-`(`*`(2, `*`(y[m]))), y[`+`(m, `-`(1))])), `*`(`^`(h, 2))), `/`(`*`(`/`(1, 2), `*`(`+`(y[`+`(m, 1)], `-`(y[`+`(m, `-`(1))])))), `*`(m, `*`(`^`(h, 2)))), `-`(`*`(`^`(phi... (10)
 

The boundary conditions in finite difference form are: 

> Eq[0]:=subs(diff(y(x),x)=dydxf,y(x)=y[0],bc1);
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(`-`(y[2]), `*`(4, `*`(y[1])), `-`(`*`(3, `*`(y[0])))))), `*`(h))) (11)
 

> Eq[N+1]:=subs(diff(y(x),x)=dydxb,y(x)=y[N+1],bc2);
 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(y[3], `-`(`*`(4, `*`(y[4]))), `*`(3, `*`(y[5]))))), `*`(h)), `-`(1), y[5]) (12)
 

A 'for loop' can be written for the interior node points as 

> for i to N do Eq[i]:=subs(m=i,Eq[m]);od;
 

 

 

 

`+`(`/`(`*`(`+`(y[2], `-`(`*`(2, `*`(y[1]))), y[0])), `*`(`^`(h, 2))), `/`(`*`(`/`(1, 2), `*`(`+`(y[2], `-`(y[0])))), `*`(`^`(h, 2))), `-`(`*`(`^`(phi, 2), `*`(y[1]))))
`+`(`/`(`*`(`+`(y[3], `-`(`*`(2, `*`(y[2]))), y[1])), `*`(`^`(h, 2))), `/`(`*`(`/`(1, 4), `*`(`+`(y[3], `-`(y[1])))), `*`(`^`(h, 2))), `-`(`*`(`^`(phi, 2), `*`(y[2]))))
`+`(`/`(`*`(`+`(y[4], `-`(`*`(2, `*`(y[3]))), y[2])), `*`(`^`(h, 2))), `/`(`*`(`/`(1, 6), `*`(`+`(y[4], `-`(y[2])))), `*`(`^`(h, 2))), `-`(`*`(`^`(phi, 2), `*`(y[3]))))
`+`(`/`(`*`(`+`(y[5], `-`(`*`(2, `*`(y[4]))), y[3])), `*`(`^`(h, 2))), `/`(`*`(`/`(1, 8), `*`(`+`(y[5], `-`(y[3])))), `*`(`^`(h, 2))), `-`(`*`(`^`(phi, 2), `*`(y[4])))) (13)
 

> y[0]:=solve(Eq[0],y[0]);
 

`+`(`-`(`*`(`/`(1, 3), `*`(y[2]))), `*`(`/`(4, 3), `*`(y[1]))) (14)
 

> y[N+1]:=solve(Eq[N+1],y[N+1]);
 

`/`(`*`(`+`(`-`(y[3]), `*`(4, `*`(y[4])), `*`(2, `*`(h)))), `*`(`+`(3, `*`(2, `*`(h))))) (15)
 

> h:=L/(N+1);
 

`/`(1, 5) (16)
 

> for i to N do Eq[i]:=eval(Eq[i]);od;
 

 

 

 

`+`(`*`(`/`(100, 3), `*`(y[2])), `-`(`*`(`/`(100, 3), `*`(y[1]))), `-`(`*`(`^`(phi, 2), `*`(y[1]))))
`+`(`*`(`/`(125, 4), `*`(y[3])), `-`(`*`(50, `*`(y[2]))), `*`(`/`(75, 4), `*`(y[1])), `-`(`*`(`^`(phi, 2), `*`(y[2]))))
`+`(`*`(`/`(175, 6), `*`(y[4])), `-`(`*`(50, `*`(y[3]))), `*`(`/`(125, 6), `*`(y[2])), `-`(`*`(`^`(phi, 2), `*`(y[3]))))
`+`(`*`(`/`(925, 68), `*`(y[3])), `-`(`*`(`/`(575, 34), `*`(y[4]))), `/`(225, 68), `-`(`*`(`^`(phi, 2), `*`(y[4])))) (17)
 

> eqs:=[seq(Eq[i],i=1..N)];
 

[`+`(`*`(`/`(100, 3), `*`(y[2])), `-`(`*`(`/`(100, 3), `*`(y[1]))), `-`(`*`(`^`(phi, 2), `*`(y[1])))), `+`(`*`(`/`(125, 4), `*`(y[3])), `-`(`*`(50, `*`(y[2]))), `*`(`/`(75, 4), `*`(y[1])), `-`(`*`(`^`...
[`+`(`*`(`/`(100, 3), `*`(y[2])), `-`(`*`(`/`(100, 3), `*`(y[1]))), `-`(`*`(`^`(phi, 2), `*`(y[1])))), `+`(`*`(`/`(125, 4), `*`(y[3])), `-`(`*`(50, `*`(y[2]))), `*`(`/`(75, 4), `*`(y[1])), `-`(`*`(`^`...
(18)
 

> vars:=[seq(y[i],i=1..N)];
 

[y[1], y[2], y[3], y[4]] (19)
 

> A:=genmatrix(eqs,vars,'B1');
 

`:=`(A, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mverbatim( (20)
 

> evalm(B1);
 

Typesetting:-mfenced(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn( (21)
 

Maple generates a row vector, which can be converted to a column vector as: 

> B:=matrix(N,1):for i to N do B[i,1]:=B1[i]:od:evalm(B);
 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mn( (22)
 

The solution is obtained as 

> X:=evalm(inverse(A)&*B);
 

`:=`(X, Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mfrac(Typesetting:-mverbatim( (23)
 

> for i to N do y[i]:=X[i,1];od;
 

 

 

 

`+`(`/`(`*`(82031250), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`^`(phi, 4))), `*`(122600, `*`(`^`(phi, 6))), `*`(816, `*`(`^`(phi, 8)))))))
`+`(`/`(`*`(`/`(1640625, 2), `*`(`+`(100, `*`(3, `*`(`^`(phi, 2)))))), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`^`(phi, 4))), `*`(122600, `*`(`^`(phi, 6))), `*`(816, `*`(`^...
`+`(`/`(`*`(26250, `*`(`+`(3125, `*`(250, `*`(`^`(phi, 2))), `*`(3, `*`(`^`(phi, 4)))))), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`^`(phi, 4))), `*`(122600, `*`(`^`(phi, 6)...
`+`(`/`(`*`(`/`(75, 2), `*`(`+`(2187500, `*`(328125, `*`(`^`(phi, 2))), `*`(9600, `*`(`^`(phi, 4))), `*`(72, `*`(`^`(phi, 6)))))), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`... (24)
 

> y[0]:=eval(y[0]);y[N+1]:=eval(y[N+1]);
 

 

`+`(`-`(`/`(`*`(`/`(546875, 2), `*`(`+`(100, `*`(3, `*`(`^`(phi, 2)))))), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`^`(phi, 4))), `*`(122600, `*`(`^`(phi, 6))), `*`(816, `*`...
`+`(`-`(`/`(`*`(`/`(546875, 2), `*`(`+`(100, `*`(3, `*`(`^`(phi, 2)))))), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`^`(phi, 4))), `*`(122600, `*`(`^`(phi, 6))), `*`(816, `*`...
`+`(`-`(`/`(`*`(`/`(131250, 17), `*`(`+`(3125, `*`(250, `*`(`^`(phi, 2))), `*`(3, `*`(`^`(phi, 4)))))), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`^`(phi, 4))), `*`(122600, `...
`+`(`-`(`/`(`*`(`/`(131250, 17), `*`(`+`(3125, `*`(250, `*`(`^`(phi, 2))), `*`(3, `*`(`^`(phi, 4)))))), `*`(`+`(82031250, `*`(60703125, `*`(`^`(phi, 2))), `*`(5235000, `*`(`^`(phi, 4))), `*`(122600, `...
(25)
 

Now the result obtained is plotted for different values of Thiele modulus Φ: 

> pars:=[0.1,0.5,1,2,5];
 

[.1, .5, 1, 2, 5] (26)
 

> clr:=[black,red,green,gold,blue];
 

[black, red, green, gold, blue] (27)
 

> for j from 1 to 5 do p[j]:=plot([seq([i*h,subs(phi=pars[j],y[i])],i=0..N+1)],thickness=3,title="Figure Exp 3.1.13.",axes=boxed,color=clr[j]):od:
 

> display({seq(p[i],i=1..5)});
 

Plot_2d
 

>