Example Problem 19.1-2 in BS&L

Solution by James Bradley Aimone

CENG 402 – April 2000

Interpretation of Problem –

Substance A is diffusing

from a surface up into a

liquid medium B.  Once in

this medium, A begins to

react with B to form a third product – C.  To model

the concentration of A, the basic law of diffusion is

applied and a loss term due to the reaction is taken

as well. 

 

BS&L proposes a solution to the problem which is to be

tested here.  The first method shown took the proposed

solution and plugged it into the original equation,

and the second method had Maple solve the equation and

compared Maple’s solution to BS&L’s. 

 

 

> restart;with(PDEtools); Restarts and activates Partial Differential Eqn. functions

[Maple Math]

> Diffgain:=Dab*diff(Ca(x,t),x,x);Rxnloss:=-k*Ca(x,t); Amount gained by diffusion into system, and amount lost by conversion from A->B

[Maple Math]

[Maple Math]

> In:=Diffgain:Out:=Rxnloss:

> Acc:=In-Out;consv:=Acc=diff(Ca(x,t),t): Balanced equation of conservation of mass - equal to eq. 19.1-23

[Maple Math]

>

> sltn:=pdsolve(Acc=diff(Ca(x,t),t),build); Maple's solution of equation 19.1-23

[Maple Math]
[Maple Math]

> sltneq:=Ca(x,t)=C*exp(t*Dab*a)*exp(t*k)*A*sinh(a^.5*x)+C*exp(t*Dab*a)*exp(t*k)*B*cosh(a^.5*x); Allows us to test the solution Maple gives us

[Maple Math]
[Maple Math]

> pdetest(sltneq,consv); A test of Maple's solution If 0, then it is correct

[Maple Math]

Yep, Maple's solution is correct...of course.

> sltneq:=(x,t)->C*exp(t*Dab*a)*exp(t*k)*A*sinh(a^.5*x)+C*exp(t*Dab*a)*exp(t*k)*B*cosh(a^.5*x); Making Maple's solution a function we can work with

[Maple Math]

> sltneq(x,0);

[Maple Math]

Note - if the solution sltneq=0 when t=0, then either C=0 or A=B=0, either of which would make the problem trivial.

therefore the boundary conditions will not be applied at this moment.

Anyway, the above solution is Maple's solution to the differential equation that was introduced.

Now the test of BS&L's solution

> pdsolve(diff(Ca(x,t),t)=Dab*diff(Ca(x,t),x,x),build); Solving eq. 19.1-23 for k=0

[Maple Math]

> f:=(x,t)->C*exp(Dab*a*t)*A*sinh(a^.5*x)+C*exp(Dab*a*t)*B*cosh(a^.5*x); f(x,t) is obtained from the equality Dab*d2f/dx2=df/dt

[Maple Math]

> BSLsln:=(x,t)->-k*(int(f(x,t1)*exp(k*t1),t1=0...t))+f(x,t)*exp(k*t); From eq 19.1-26, which BS&L claim is the solution

[Maple Math]

> consv;

[Maple Math]

> Ca(x,t):=BSLsln(x,t);

[Maple Math]
[Maple Math]

> consv;

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> simplify(consv); Reduced equality shows that the equation is not entirely equal - that there is a leftover set of terms

[Maple Math]
[Maple Math]
[Maple Math]

> solve(consv,A); An equality in the leftover set of terms allows a value for A to be found - which shows this calculation is wrong

[Maple Math]

First method of plugging in BS&L into original equation did not work… Now for the second method –

> BSLsln(x,t);BSL0t:=BSLsln(x,0):BSL0x:=BSLsln(0,t):

[Maple Math]
[Maple Math]

> testeqn:=BSLsln(x,t)=sltneq(x,t); Second test is to try to equate BS&L's solution to the one Maple gave us earlier.

[Maple Math]
[Maple Math]
[Maple Math]

> t1:=simplify(testeqn/C*(Dab*a+k)); This solution to the equality is similar but not exactly equal to the result from previous test.

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> solve(t1,A); Maple cannot determine a value for A, showing that no equality is found in t1. Therefore, the solution can be considered complete.

> h:=BSL0t=sltneq(x,0); When t=0, the equality can be seen easily

[Maple Math]

Proof that BS&L solutions abide by the boundary conditions....

Since it is known that f=Cas on the surface, we'll test the original BS&L solution for this quality-

> Casu:=-k*int(fs(x,t2)*exp(k*t2),t2=0...t)+fs(x,t)*exp(k*t); fs(x,t):=Casur;fs(x,t2):=Casur;Casu;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> simplify(Casu); Simplifying the answer shows us that the concentration at the surface is really independent of time. Therefore the BS&L solution matches this boundary condition as well.

[Maple Math]

> Cat:=-k*int(ft(x,t2)*exp(k*t2),t2=0...t)+ft(x,t)*exp(k*t); ft(x,t2):=0: ft(x,t):=0: Cat;

[Maple Math]

[Maple Math]

It is shown here that the BS&L solution for 19.1-23 abides by the initial condition of Ca=0.

The second method of equating the Maple solution to the BS&L solution worked, and when the BS&L solution was tested for boundary conditions it passed.