33hotSfer.mws

Partial Differential Equations PowerTool

by Dr. Jim Herod

Section 7.5: Warm Spheres

Maple Packages needed in Section 7.5

>    restart:

>    with(plots):

Warning, the name changecoords has been redefined

>    with(orthopoly);

[G, H, L, P, T, U]

>   

Another important coordinate system is that of a sphere.  In that coordinate system we have

      rho   is the distance from the origin,

      theta   is the angle in the x - y plane; that is, it measures longitude.

      phi   is the angle from the top; that is, it measures latitude.

Thus, rho  = 1,   0 < theta  < 2 Pi ,    0 < phi  < Pi     is a sphere with radius 1.

The connection with rectangular coordinates is

     x = rho  sin( phi ) cos( theta  )

     y = rho  sin( phi  ) sin( theta  )

     z = rho  cos( phi  )

 

>    plot3d(1,theta=0..2*Pi,phi=0..Pi, coords=spherical,    style=wireframe,axes=NORMAL,orientation=[35,70]);

[Maple Plot]

Also, rho  = 1,    theta  = Pi/4  ,   0 < phi  < Pi   is a half ring running from the north pole to the south pole of the sphere. I draw the rho  fat so you can see it. You might experiment by making r just 1 to see what I avoided.

>    plot3d([r,Pi/4,phi],r = 1..1.2,phi=0..Pi, coords=spherical,axes=NORMAL,orientation=[15,75],style=patchnogrid,scaling=constrained);

[Maple Plot]

Finally, rho  = 1, phi  = 49 degrees, defines a part of the boundary between Western Canada and Western United States.

In this coordinate system, the Laplacian Operator is

       Delta  u = 1/(rho^2)    {    diff(rho^2*diff(u,rho),rho)   +   1/sin(phi)   diff(sin(phi)*diff(u,phi),phi)    +   1/(sin(phi)^2)   diff(u,`$`(theta,2))   }

We solve   0 = Delta  u,  u(1, phi) = f( phi  ), where u is independent of theta  . From the assumption that

          u( rho  , phi  ) = R( rho  ) Phi(phi)  ,

we are led to this separation of variables situation:

          ( rho^2  R '( rho ) ) ' / R  +  ( sin( phi  ) Phi  ' ) '/ sin( phi ) Phi   = 0.

This suggests the ordinary differential equations

          ( rho^2  R '( rho ) ) '  - mu^2  R( rho ) = 0,  0 < rho  < 1,

          ( sin( phi  ) Phi  ' ) '  +   mu^2  sin( phi  ) Phi   = 0,  0 < phi  < Pi  .

Neither equation has a boundary condition. We have conditions of boundedness. In the second equation, we take x = cos( phi  ) changing the equation as follows:

     

>    x:=phi->cos(phi);

x := cos

>    Phi:=phi->y(x(phi));

Phi := proc (phi) options operator, arrow; y(x(phi)) end proc

>    diff(sin(phi)*diff(Phi(phi),phi),phi);

-2*sin(phi)*D(y)(cos(phi))*cos(phi)+sin(phi)^3*`@@`(D,2)(y)(cos(phi))

Hence,  ( sin( phi  ) Phi  ' ) '  =   sin(phi)^3  y ''(x)  -  2 sin( phi ) cos( phi  ) y '(x).

The second differential equation above becomes

      sin(phi)^2  y ''(x) - 2 cos( phi  ) y '(x) + mu^2  y(x) = 0.

In terms of x alone,

     (1 - x^2 ) y ''(x) - 2 x y '(x) +   mu^2  y(x) = 0,   -1 < x < 1.  

We examine solutions of this differential equation.

>    x:='x':

>    dsolve((1-x^2)*diff(y(x),x,x)- 2*x*diff(y(x),x)+mu^2*y(x)=0,y(x));

y(x) = _C1*LegendreP(1/2*(1+4*mu^2)^(1/2)-1/2,x)+_C2*LegendreQ(1/2*(1+4*mu^2)^(1/2)-1/2,x)

>   

There is the suggestion that we consider Legendre Polynomials. We digress to recall these functions.

A recollection of Legendre Polynomials

Here are three ways to conceive of the Legendre Polynomials -- four, if we include Maple.

Method 1:  solve the differential equation.

>    dsolve((1-x^2)*diff(y(x),x,x)- 2*x*diff(y(x),x)+n*(n+1)*y(x)=0,y(x));

y(x) = _C1*LegendreP(n,x)+_C2*LegendreQ(n,x)

>    plot([LegendreP(1,x),LegendreQ(1,x)],x=-1..1,color=[red,black]);

[Maple Plot]

We got only the first graph. The following shows that the second graphs are not defined on the interval of interest.

>    plot([LegendreQ(1,x),LegendreQ(2,x),LegendreQ(3,x)],x=0..5,y=0..1/2);

[Maple Plot]

>   

Here are the first three Legendre Polynomials with an easier calling.

>    plot([P(0,x),P(1,x),P(2,x)],x=-1..1);

[Maple Plot]

Here is a check that, for example, the 5th one satisfies the differential equation.

>    y:=x->P(5,x);
(1-x^2)*diff(y(x),x,x)- 2*x*diff(y(x),x)+5*(5+1)*y(x);
simplify(%);

y := proc (x) options operator, arrow; P(5,x) end proc

(1-x^2)*(315/2*x^3-105/2*x)-2*x*(315/8*x^4-105/4*x^2+15/8)+945/4*x^5-525/2*x^3+225/4*x

0

>   

Method 2:  We could apply the Gramm Schmidt Process to 1, x, x^2 , ... .

We examined these ideas earlier. Here, we illustrate that the Legendre polynomials are orthogonal.

>    int(P(3,x)*P(5,x),x=-1..1);

0

>   

Method 3.   We could generate these by taking the appropriate derivatives.

   We show that 1/(2^n*n!)    d^n*(x^2-1)^n/(d*x^n)   is the n^th  polynomial.

>    f:=(n,x)->(x^2-1)^n;
Q:=(n,x)->1/(2^n*n!)*diff(f(n,x),x$n);

f := proc (n, x) options operator, arrow; (x^2-1)^n end proc

Q := proc (n, x) options operator, arrow; 1/(2^n)/n!*diff(f(n,x),`$`(x,n)) end proc

>    for n from 1 to 3 do
   expand(Q(n,x)),`and`, P(n,x);
od;

x, `and`, x

-1/2+3/2*x^2, `and`, -1/2+3/2*x^2

5/2*x^3-3/2*x, `and`, 5/2*x^3-3/2*x

>   

Method 4:  Use the recursion formulas  (n+1) P[n+1](x)    +  n P[n-1](x)   =  (2 n + 1) P[n](x)   x.

With this method, we assume you know the first two.

>    P3[0]:=1;
P3[1]:=x;
for n from 1 to 3 do
    P3[n+1]:=expand(1/(n+1)*((2*n+1)*P3[n]*x-n*P3[n-1]));
od;
n:='n';

P3[0] := 1

P3[1] := x

P3[2] := -1/2+3/2*x^2

P3[3] := 5/2*x^3-3/2*x

P3[4] := 35/8*x^4-15/4*x^2+3/8

n := 'n'

>    for n from 0 to 4 do
   P3[n]/P(n,x);
od;
n:='n';

1

1

1

1

1

n := 'n'

>   

Observation 1:   if 0 < m < n, then   int(x^m*P(n,x),x = -1 .. 1)   = 0. We check this for a special case.

>    int(x^3*P(5,x),x=-1..1);

0

>   

Observation 2:   We have a formula for the norm of P(n,x):   int(P(n,x)^2,x = -1 .. 1)   = 2/(2 n + 1).

We check three cases by comparing the integral with 2/(2 n + 1).

>    for n from 0 to 5 do
   int(P(n,x)^2,x=-1..1)-2/(2*n+1);
od;
n:='n';

0

0

0

0

0

0

n := 'n'

>   

Observation 3:  We can make polynomial approximations for functions on [-1, 1]. We approximate cos( Pi/2  x ) with the first three Legendre polynomials.

>    for n from 0 to 2 do
   a[n]:=int(cos(Pi/2*x)*P(n,x),x=-1..1)*(2*n+1)/2;
od;
n:='n';

a[0] := 2/Pi

a[1] := 0

a[2] := 10*(Pi^2-12)/Pi^3

n := 'n'

>    plot([a[0]+a[1]*P(1,x)+a[2]*P(2,x),cos(Pi/2*x)],x=-1..1,
     color=[black,red]);

[Maple Plot]

>   

This completes our discourse on Legendre Polynomials. We return to the partial differential equation.

Recall where we were. The partial differential equation led to two ordinary differential equations.

The second differential equation  became

      sin(phi)^2  y ''(x) - 2 cos( phi  ) y '(x) + mu^2  y(x) = 0.

In terms of x alone,

     (1 - x^2 ) y ''(x) - 2 x y '(x) +   mu^2  y(x) = 0,   -1 < x < 1.  

This led to

          (1 - x^2 ) y ''(x) - 2 x y '(x) +   n*(n+1)  y(x) = 0,   -1 < x < 1

and Legendre Polynomials.

Here is the first of the differential equations from above, with this mu  :

          ( rho^2  R '( rho ) ) '  - n*(n+1)  R( rho ) = 0,  0 < rho  < 1,

or

           rho^2  R '' + 2 rho  R ' - n*(n+1)  R( rho ) = 0,  0 < rho  < 1.

We solve this.

>    dsolve(r^2*diff(R(r),r,r)+2*r*diff(R(r),r)-n*(n+1)*R(r)=0,R(r));

R(r) = _C1*r^n+_C2*r^(-n-1)

>   

We see that the only bounded solutions are r^n  . Hence, we are ready to make up the general solution for the partial differential equation.

General Solution:

First, we verify that products of solutions are solutions.

>    n:=4;
u:=(r,phi)->r^n*P(n,cos(phi));

n := 4

u := proc (r, phi) options operator, arrow; r^n*P(n,cos(phi)) end proc

>    diff(r^2*diff(u(r,phi),r),r)+
   1/sin(phi)*diff(sin(phi)*diff(u(r,phi),phi),phi):
simplify(%);

0

>   

I checked this with n = 4. You check it at other places. What about sums?

>    n:='n';
u:=(r,phi)->sum(a[n]*r^n*P(n,cos(phi)),n=0..4);

n := 'n'

u := proc (r, phi) options operator, arrow; sum(a[n]*r^n*P(n,cos(phi)),n = 0 .. 4) end proc

>    diff(r^2*diff(u(r,phi),r),r)+
   1/sin(phi)*diff(sin(phi)*diff(u(r,phi),phi),phi):
simplify(%);

0

>   

We are now ready to compute the coefficients for a boundary condition. We solve

          0 = Delta u  with 0 < rho  < 1,  0 < phi  < Pi , 0 < theta  < 2 Pi  with boundary condition u(1, phi  ) = f( phi  ).

The coefficients will be

           a[n]  = (2*n+1)/2    int(f(phi)*P(n,cos(phi))*sin(phi),phi = 0 .. Pi) .

Let's take the special case that f( phi  ) = cos( phi  ).

>    for n from 0 to 4 do
     a[n]:=(2*n+1)/2*int(cos(phi)*P(n,cos(phi))*sin(phi),phi=0..Pi);
od;

a[0] := 0

a[1] := 1

a[2] := 0

a[3] := 0

a[4] := 0

Thus, the solution for this problem is
     u(r,
phi  ) = r* P(1,cos( phi )) = r cos( phi ).

How can we illustrate what we have?

(1) On each cross sectional plane parallel to the x-y plane, u has the same value, namely u(r, phi ) = z. We draw a portion of the sphere where all the points have the same temperature.

>    addcoords(z_cylindrical,[z,r,theta],[r*cos(theta),r*sin(theta),z]);
dis:=plot3d(1/2,r=0..0.86,theta=0..2*Pi,coords=z_cylindrical, orientation=[35,70],axes=normal):
sph:=plot3d(1,theta=0..2*Pi,phi=0..Pi, coords=spherical,    style=wireframe,axes=NORMAL,orientation=[35,70]):
display3d({dis,sph});

[Maple Plot]

(2) If we hold r fixed between 0 and 1, and if we let phi  go from 0 to Pi , we get imbedded spheres. Here are three of these where only half of the middle one is drawn so that the innermost can be seen.

>    S1:=plot3d(1,theta=0..2*Pi,phi=0..Pi, coords=spherical,    style=wireframe,axes=NORMAL,orientation=[-35,70]):
S2:=plot3d(3/4,theta=0..Pi,phi=0..Pi, coords=spherical,axes=NORMAL,orientation=[-35,70]):
S3:=plot3d(1/2,theta=0..2*Pi,phi=0..Pi, coords=spherical,axes=NORMAL,orientation=[-35,70],color=black):
display({S1,S2,S3});

[Maple Plot]

The temperature on each such sphere varies from the hottest point at the top and the coldest at the bottom. Here are graphs of u on the three embedded spheres as phi  changes from 0 to Pi  ... from the north pole to the south pole.

>    u:=(r,phi)->r*P(1,cos(phi));

u := proc (r, phi) options operator, arrow; r*P(1,cos(phi)) end proc

>    plot([u(1,phi),u(3/4,phi),u(1/2,phi)],phi=0..Pi,color=[black,red,green]);

[Maple Plot]

In this Section, we have made analytic what we know intuitively: if we know the temperature distribution on the surface of a sphere which has no sources or sinks, then we can determine the temperature distribution on the inside of the sphere.

EMAIL: herod@math.gatech.edu   or   jherod@tds.net

URL: http://www.math.gatech.edu/~herod

Copyright ©  2003  by James V. Herod

All rights reserved