Section 29-02.mws

Unit 5: Boundary Value Problems for Partial Differential Equations

Chapter 29: Separation of Variables in Non-Cartesian Coordinates

Section 29.2: Laplace's equation in a cylinder

Copyright

Copyright * 2001 by Addison Wesley Longman, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.

Initializations

> restart;

> with(linalg):
with(plots):
with(plottools):
with(student):
with(DEtools):

Warning, the protected names norm and trace have been redefined and unprotected

Warning, the name changecoords has been redefined

Warning, the names adjoint and translate have been redefined

> libname:="C:/Program Files/Maple 6.01/Fps",libname:

> with(FPS):

>

Problem Statement and Formulation

Find the steady-state, bounded temperatures inside a solid cylinder of radius sigma and height h , if the base is insulated, and the curved lateral surface and the top are maintained at temperatures of zero and f(r) , respectively.

Because none of the data depends on the angle theta , the temperature will be a function of the height z and radius r . Thus, the temperature function, which can be written as u(r,z) in cylindrical coordinates, satisfies Laplace's equation inside the cylinder. The insulation condition on the bottom of the cylinder, a homogeneous Neumann condition, is expressed by the vanishing of the temperature gradient, a partial derivative in the z -direction, on that face. The complete boundary value problem determining u(r,z) therefore consists of the partial differential equation

grad(u(r,z)) = u[rr](r,z)+1/r u[r](r,z)+u[zz](r,z) = 0

that is,

> q := expand(laplacian(u(r,z),[r,theta,z], coords=cylindrical)) = 0;

q := diff(u(r,z),r)/r+diff(u(r,z),`$`(r,2))+diff(u(...

>

and the boundary conditions

u(sigma,z) = 0

u[z](r,0) = 0

u(r,h) = f(r)

u(r,z) bounded

>

Statement and Analysis of the Solution

The solution is given by

u(r,z) = Sum(A[k]*J[0](lambda[k]*r)*cosh(lambda[k]*...

A[k] = Int(r*f(r)*J[0](lambda[k]*r),r = 0 .. sigma)... = 2*Int(r*f(r)*J[0](lambda[k]*r),r = 0 .. sigma)/(sig...

where J[0](x) is the Bessel function of order zero, and lambda[k] is the k th zero of J[0](sigma*x) .

The functions J[nu](x) satisfy Bessel's equation

x^2*`y''`(x)+x*`y'`(x)+(x^2-nu^2)*y(x) = 0

that is,

> Bessel_eqn := x^2*diff(y(x),x,x) + x*diff(y(x),x) + (x^2-nu^2)*y(x) = 0;

Bessel_eqn := x^2*diff(y(x),`$`(x,2))+x*diff(y(x),x...

>

and are called Bessel functions of order nu . As seen in Section 16.2, two linearly independent solutions of Bessel's equation are J[nu](x) and Y[nu](x) , as we see from the Maple solution

> dsolve(Bessel_eqn,y(x), output=basis);

[BesselJ(nu,x), BesselY(nu,x)]

>

Only one of these solutions, J[nu](x) , is bounded at the origin. The Bessel function of the second kind, Y[nu](x) , has a logarithmic singularity at x = 0 .

Series expansions for J[0](x) and J[1](x) , the Bessel functions of order zero and one, respectively, can be found with the FormalPowerSeries command from the FPS package. The series expansion of J[0](x) is

> FormalPowerSeries(BesselJ(0,x),x);

Sum((-1)^k*4^(-k)*x^(2*k)/(k!^2),k = 0 .. infinity)...

>

while the series expansion of J[1](x) is

> FormalPowerSeries(BesselJ(1,x),x);

1/2*Sum((-1)^k*4^(-k)*x^(2*k+1)/(k!^2*(k+1)),k = 0 ...

>

In Figure 29.4, J[0](x) is the black curve, and J[1](x) is the red curve.

> plot([BesselJ(0,x),BesselJ(1,x)],x=0..10, color=[black,red], scaling=constrained, xtickmarks=5, ytickmarks=2, labels=[x,``], labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

It should be recalled from Section 16.2 that if lambda[k], k = 1, 2, `...` , are the roots of J[0](sigma*x) , then the functions J[0](lambda[k]*x) are, on the interval 0 <= x `` <= sigma , orthogonal with respect to the weight function x . Thus, for lambda[k] <> lambda[j] , we have

Int(x*J[0](lambda[k]*x)*J[0](lambda[j]*x),x = 0 .. ...

>

Example 29.2

For the cylinder described above, let sigma = 2 , h = 3 , and f(r) = 1 . Then, the first ten eigenvalues lambda[k] are the first ten zeros of J[0](2*x) , listed as mu[k] in Table 16.1 in Section 16.2.

For the convenience of the reader executing these calculations in Maple, we reconstruct these first ten eigenvalues as follows.

As seen in Section 16.2, J[0](2*x) is asymptotic to cos(2*x-Pi/4)/sqrt(Pi*x) , so the eigenvalues lambda[k] , the first ten roots of J[0](2*x) = 0 , are computed by

> for k from 1 to 10 do
m[k] := fsolve(BesselJ(0,2*x)=0, x, (4*k-1)*Pi/8-.1 .. (4*k-1)*Pi/8+.1);
od;

m[1] := 1.202412779

m[2] := 2.760039055

m[3] := 4.326863956

m[4] := 5.895767220

m[5] := 7.465458854

m[6] := 9.035531984

m[7] := 10.60581831

m[8] := 12.17623577

m[9] := 13.74673957

m[10] := 15.31730323

>

The coefficients A[k] , given by

A[k] = Int(r*J[0](lambda[k]*r),r = 0 .. 2)/2/cosh(3...

can be evaluated with numeric integration, yielding, for example, A[1] as

> evalf(Int(r*BesselJ(0,m[1]*r),r=0..2))/2/ cosh(3*m[1])/BesselJ(1,2*m[1])^2;

.8684853220e-1

>

Alternatively, because f(r) = 1 , the integral in the numerator can be evaluated exactly via the formula

Int(x*J[0](x),x = 0 .. alpha) = alpha*J[1](alpha)

if the change of variables lambda[k]*r = x is made in the integral in the numerator of A[k] , as summarized by

{Int(r*J[0](lambda[k]*r),r = 0 .. 2)}*`|`[x = lambd... Int(x*J[0](x),x = 0 .. 2*lambda[k]) `` = 2/lambda[k] J[1](2*lambda[k])

In fact, the integral

> unassign('k'):
X := Int(r*BesselJ(0,lambda[k]*r),r=0..2);

X := Int(r*BesselJ(0,lambda[k]*r),r = 0 .. 2)

>

under that change of variables, becomes

> Y := changevar(x=lambda[k]*r,X,x);

Y := Int(x*BesselJ(0,x)/(lambda[k]^2),x = 0 .. 2*la...

>

Maple knows the value of this integral, and gives

> value(Y);

2*BesselJ(1,2*lambda[k])/lambda[k]

>

In fact, Maple can also evaluate the original integral, giving

> value(X);

2*BesselJ(1,2*lambda[k])/lambda[k]

>

Consequently, the expression for A[k]

> Ak := Int(r*BesselJ(0,lambda[k]*r),r=0..2)/2/ cosh(3*lambda[k])/BesselJ(1,2*lambda[k])^2;

Ak := 1/2*Int(r*BesselJ(0,lambda[k]*r),r = 0 .. 2)/...

>

simplifies to

> AAk := value(Ak);

AAk := 1/(lambda[k]*BesselJ(1,2*lambda[k])*cosh(3*l...

>

that is, to

A[k] = sech(3*lambda[k])/lambda[k]/J[1](2*lambda[k]...

Hence, the first ten coefficients are

> for k from 1 to 10 do
A[k] := evalf(subs(lambda[k]=m[k],AAk));
od;

A[1] := .8684853215e-1

A[2] := -.5398691530e-3

A[3] := .3924314531e-5

A[4] := -.3038395040e-7

A[5] := .2434069842e-9

A[6] := -.1992050358e-11

A[7] := .1654350869e-13

A[8] := -.1388630649e-15

A[9] := .1175086478e-17

A[10] := -.1000746530e-19

>

The coefficients rapidly decrease in magnitude, so the convergence is rapid, and the partial sum

u[10](r,z) = sum(A[k]*J[0](lambda[k]*r)*cosh(lambda...

that is,

> U10 := add(A[k]*BesselJ(0,m[k]*r)*cosh(m[k]*z),k=1..10);

U10 := .8684853215e-1*BesselJ(0,1.202412779*r)*cosh...
U10 := .8684853215e-1*BesselJ(0,1.202412779*r)*cosh...
U10 := .8684853215e-1*BesselJ(0,1.202412779*r)*cosh...
U10 := .8684853215e-1*BesselJ(0,1.202412779*r)*cosh...
U10 := .8684853215e-1*BesselJ(0,1.202412779*r)*cosh...

>

is adequate, except on the boundary z = 3 where a much slower convergence is evident, as seen in Figure 29.5.

> p1 := plot3d(U10,r=0..2,z=0..3, color=red):
display(p1, scaling=constrained, labels=[r,z,u], labelfont=[TIMES,ITALIC,12], axes=frame, tickmarks=[2,3,2], orientation=[-40,60]);

[Maple Plot]

>

The surface represents the temperatures on the rectangle R = { 0 <= r `` <= 2 , 0 <= z `` <= 3 }, half a plane section through the axis of the cylinder. It is impossible to draw a graph of the temperatures inside the cylinder. Every representation of these temperatures will require some visual compromise.

In Figure 29.6, the temperatures are graphed on the rectangle R , shown supporting the temperature surface inside the cylinder.

> p2 := cylinderplot(2,theta=Pi/2..2*Pi,z=0..3):
p3 := display(rotate(p1,-Pi/2,0,-Pi/2)):
display([p2,p3], orientation=[30,70], axes=frame, tickmarks=[5,5,4], labels=[` x`,` y`,`z `], labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

The rectangle rotates about the axis of the cylinder, supporting the same temperatures for all values of the angle theta .

Figure 29.7 gives another view of the temperatures inside the cylinder, the isothermal surface on which u(r,z) = .1 .

> PP := implicitplot3d(U10=.1,r=0..2,theta=0..2*Pi,z=0..3, coords=cylindrical, scaling=constrained, orientation=[35,60], color=yellow, style=patchcontour, axes=frame, tickmarks=[5,5,4], grid=[20,20,20]):
PP1 := spacecurve({[[0,0,0],[2,0,0]],[[0,0,0],[0,-2,0]],[[0,0,0], [0,0,1]]}, color=black, linestyle=2):
PP2 := textplot3d([-.1,-.1,.1,`O`]):
display([PP,PP1,PP2],labels=[` x`,`y `,`z `], labelfont=[TIMES,ITALIC,12], orientation=[-45,65]);

[Maple Plot]

>

In fact, the level surfaces u(r,z) = k/10, k = 1, 2, `...`, 9 , are each bowl-shaped, with the same circle bounding the open top. This corresponds to the discontinuity in temperatures at the junction of the top of the cylinder with the curved lateral wall of the cylinder. At this juncture, all level surfaces intersect.

Executing the following Maple commands will generate an animation of this sequence of level surfaces through the interior of the cylinder.

> for k from 1 to 9 do
P||k := implicitplot3d(U10 = .1*k, r=0..2, theta=0..2*Pi, z=0..3, coords=cylindrical, color=COLOR(HUE,k/10)):
od:
display([P||(1..9)], insequence=true, orientation=[25,80], style=patchcontour, scaling=constrained, lightmodel=light3);

[Maple Plot]

>

Solution by Separation of Variables

Assuming a separated solution of the form

> U := R(r)*Z(z);

U := R(r)*Z(z)

>

and substituting it into the boundary data u(sigma,z) = 0 and u[z](r,0) = 0 leads to

R(sigma)*Z(z) = 0 => R(sigma) = 0

and

R(r) Z'(0) = 0 => Z'(0) = 0

Application of the separation assumption to Laplace's equation

> q;

diff(u(r,z),r)/r+diff(u(r,z),`$`(r,2))+diff(u(r,z),...

>

results in

> q1 := eval(subs(u(r,z)=U,q));

q1 := diff(R(r),r)*Z(z)/r+diff(R(r),`$`(r,2))*Z(z)+...

>

As usual, division by u(r,z)

> q2 := expand(q1/U);

q2 := diff(R(r),r)/(R(r)*r)+diff(R(r),`$`(r,2))/R(r...

>

leads to a separation of variables if the term containing Z(z) is brought to the righthand side via

> q3 := q2 - (op(3,lhs(q2))=op(3,lhs(q2)));

q3 := diff(R(r),r)/(R(r)*r)+diff(R(r),`$`(r,2))/R(r...

>

Introducing the Bernoulli separation constant mu leads to

`R''`(r)/r/R(r)+`R'`(r)/R(r) = -`Z''`(z)/Z(z) = mu

Overlooking the abuse of notation whereby prines denote differentiation with respect to both r and z , we have the two ODEs

r*`R''`(r)+`R'`(r)-mu*r*R(r) = 0

and

`Z''`(z)+mu*Z(z) = 0

which follow from

> q4 := lhs(q3) = mu;
q5 := rhs(q3) = mu;

q4 := diff(R(r),r)/(R(r)*r)+diff(R(r),`$`(r,2))/R(r...

q5 := -diff(Z(z),`$`(z,2))/Z(z) = mu

>

and the rearrangements

> q6 := numer(normal(lhs(q4) - rhs(q4))) = 0;
q7 := -numer(normal(lhs(q5) - rhs(q5))) = 0;

q6 := diff(R(r),r)+diff(R(r),`$`(r,2))*r-mu*R(r)*r ...

q7 := diff(Z(z),`$`(z,2))+mu*Z(z) = 0

>

The r -equation is a modified form of Bessel's equation. In fact, the solution is

R(r) = c[1]*J[0](sqrt(-mu)*r)+c[2]*Y[0](sqrt(-mu)*r...

that is,

> dsolve(q6,R(r));

R(r) = _C1*BesselY(0,sqrt(-mu)*r)+_C2*BesselJ(0,sqr...

>

The appearance of sqrt(-mu) suggests renaming the separation constant to -lambda^2 so that the two ordinary differential equations become

r*`R''`(r)+`R'`(r)+lambda^2*r*R(r) = 0

and

`Z''`(z)-lambda^2*Z(z) = 0

that is,

> q8 := subs(mu=-lambda^2,q6);
q9 := subs(mu=-lambda^2,q7);

q8 := diff(R(r),r)+diff(R(r),`$`(r,2))*r+lambda^2*R...

q9 := diff(Z(z),`$`(z,2))-lambda^2*Z(z) = 0

>

Then, the solution of the r -equation is

R(r) = c[1]*J[0](lambda*r)+c[2]*Y[0](lambda*r)

that is

> dsolve(q8,R(r));

R(r) = _C1*BesselY(0,csgn(lambda)*lambda*r)+_C2*Bes...

>

Since we know Y[0](x) , the zero-order Bessel function of the second kind, is not bounded at the origin, its coefficient is taken as zero, and the solution for R(r) is a multiple of J[0](lambda*r) .

To transform the r -equation to Bessel's equation

x^2*`y''`(x)+x*`y'`(x)+(x^2-nu^2)*y(x) = 0

that is,

> Bessel_eqn;

x^2*diff(y(x),`$`(x,2))+x*diff(y(x),x)+(x^2-nu^2)*y...

>

make the change of variables r = x/lambda so that R(r) becomes R(x/lambda) = y(x) . Done in Maple, we obtain

> q10 := Dchangevar(r=x/lambda,R(r)=y(x),q8,r,x);

q10 := lambda*diff(y(x),x)+lambda*diff(y(x),`$`(x,2...

>

Factoring and "cancelling" lambda via

> expand(q10/lambda);

diff(y(x),x)+diff(y(x),`$`(x,2))*x+y(x)*x = 0

>

gives precisely Bessel's equation of order zero.

Incidentally, the change of variables was accomplished by a careful use of the chain rule starting with the definitions x = lambda*r and

R(r) = R(x/lambda) = y(x) = y(lambda*r)

Then,

dR/dr = dy/dx dx/dr = dy/dx lambda

and

d^2*R/(dr^2) = d/dx ``(dy/dx) dx/dr lambda

= d^2*y/(dx^2) lambda^2

so that

r R'' + R' + lambda^2 r R = 0

becomes

x/lambda y'' lambda^2 + y' lambda + lambda^2 x/lambda y = 0

and hence

x y'' + y' + x y = 0

when r is replaced by x/lambda .

Since R(r) = J[0](lambda*r) , the boundary condition R(sigma) = 0 requires the solution of J[0](lambda*sigma) = 0 for the eigenvalues lambda[k] .

The z -equation

`Z''`(z)-lambda^2*Z(z) = 0

that is,

> q9;

diff(Z(z),`$`(z,2))-lambda^2*Z(z) = 0

>

now inherits the known eigenvalues, and becomes

`Z''`[k](z)-lambda[k]^2*Z[k](z) = 0

that is,

> unassign('k');
q11 := subs(lambda=lambda[k],q9);

q11 := diff(Z(z),`$`(z,2))-lambda[k]^2*Z(z) = 0

>

which has exponential solutions. The solution satisfying the Neumann boundary condition Z'(0) = 0 is

> q12 := dsolve({q11,D(Z)(0)=0},Z(z));

q12 := Z(z) = _C2*exp(lambda[k]*z)+_C2*exp(-lambda[...

>

which is a multiple of a hyperbolic cosine, as seen by

> simplify(convert(q12,trig));

Z(z) = 2*_C2*cosh(lambda[k]*z)

>

Consequently, a single eigensolution is

u[k](r,z) = A[k]*J[0](lambda[k]*r)*cosh(lambda[k]*z...

that is,

> Uk := A[k]*BesselJ(0,lambda[k]*r)*cosh(lambda[k]*z);

Uk := A[k]*BesselJ(0,lambda[k]*r)*cosh(lambda[k]*z)...

>

and the general solution, a sum over all such eigensolutions, is

u(r,z) = sum(A[k]*J[0](lambda[k]*r)*cosh(lambda[k]*...

that is,

> U := Sum(Uk,k=1..infinity):
u(r,z) = U;

u(r,z) = Sum(A[k]*BesselJ(0,lambda[k]*r)*cosh(lambd...

>

Application of u(r,h) = f(r) , the final nonhomogeneous Dirichlet boundary condition at the top of the cylinder, leads to the equation

f(r) = sum(A[k]*J[0](lambda[k]*r)*cosh(lambda[k]*h)...

that is,

> f(r) = subs(z=h,U);

f(r) = Sum(A[k]*BesselJ(0,lambda[k]*r)*cosh(lambda[...

>

from which the coefficients A[k] are determined via multiplication by r*J[0](lambda[j]*r) and integrating with respect to r over the interval 0 <= r `` <= sigma . The orthogonality of the eigenfunctions J[0](lambda[k]*r) with respect to the weighting function r causes all terms but one on the right side to vanish. The one surviving term is the one for which k = j . Hence, what results is the equation

> q13 := Int(r*f(r)*J[0](lambda[j]*r),r=0..sigma) = A[j]*cosh(lambda[j]*h)*Int(r*J[0](lambda[j]*r)^2,r=0..sigma);

q13 := Int(r*f(r)*J[0](lambda[j]*r),r = 0 .. sigma)...

>

from which A[j] is determined to be

> isolate(q13,A[j]);

A[j] = Int(r*f(r)*J[0](lambda[j]*r),r = 0 .. sigma)...

>

In Section 16.2, the equivalence of the integral in the denominator with sigma^2/2 J[1] ``^2 ( lambda[j]*sigma ) was explored in Maple..

>