SOUKUP, Rodney
Department of Electrical Engineering, University of Nebraska-Lincoln, Lincoln, NE 68588-0511, U.S.A., rsoukup@unl.edu, http://www.engr.unl.edu/ee
Abstract: Many engineering problems can be described by models which require the solution of partial differential equations. Although no computer program is yet available to solve these equations completely symbolically, the use of MAPLE with help from the user can make the problems tractable and the results meaningful. The material introduced here assists the students in simulating engineering systems by means of solving partial differential equations in rectangular, cylindrical, and spherical coordinates. The methods illustrated here include separation of variables and the use of Laplace Transforms. This is an extension of a paper delivered earlier this year1.
The problems solved here will delineate the usefulness of a program such as MAPLE in solving partial differential equations. The general, major advantages of using such a program are in keeping the algebra straight and the rapid plotting of very complicated functions. The disadvantage of MAPLE in solving partial differential equations is that the user must carry out some of the calculations as if doing them by hand. Another important advantage of MAPLE is that the solutions in other than rectangular coordinates are such things as Bessel function and Legendre polynomials. MAPLE handles these functions quite easily and takes away the fear of such mathematics for the students.
Specifically, this paper will illustrate the solution of an equation in rectangular coordinates that cannot be solved by separation of variables. This will require the use of Laplace transforms to find the solution. Problems in other coordinate systems will be very illustrative of the advantages of the use of MAPLE in assisting students to reach the correct solution and conclusions.
Keywords: MAPLE, symbolic, PDQ,s
The solution of partial differential equations can be quite intimidating to students and it is sometimes quite difficult to keep the algebra straight. This is where a symbolic computing program, such as MAPLE is useful. Ideally, the solution of such problems would be handled by inserting the problem into the program and request a solution. This type of program is not yet available. For now, the capabilities of a program such as MAPLE can reduce the difficulty considerably. The methodology of solution is the same as doing it by hand. The material is taken from a course on advanced mathematics for electrical engineers in which the textbook by Zill and Cullen2 is used.
The equations illustrated are the heat equation, the wave equation, and Laplace’s equation. Equations in rectangular, cylindrical, and spherical coordinates are discussed. The results to the solutions of these boundary value problems are infinite series which do not have a lot of meaning for the students until they see plots of the results. This is another place where MAPLE is extremely useful.
The first illustration of the method is the solution to Laplace’s equation which illustrates the steady state temperature in a very long block of material, with one end held at a fixed temperature. One side is perfectly insulated and the other has heat loss. That is, the equation to be solved is
![]()
The notation in MAPLE is such that the := identifies, in this case, eq1 with Laplace’s equation in two dimensions. Any time eq1 is desired after this it will be that as identified and need not be rewritten. The identification can be changed by the user if desired.
The boundary conditions described are
,
,
, and
. Separation of variables is the method of choice to solve this problem. If this is done, the two equations become
![]()
and
![]()
At this point it is just necessary to ask MAPLE to solve these two equations. This is accomplished with the dsolve command.
>dsolve(eq2,X(x));
![]()
>dsolve(eq3,(Y,y));
![]()
The boundary condition that u remains finite when x gets large tells us that the constant_C1 in the X equation is zero. We then rewrite the solutions as
![]()
and
![]()
Since the boundary conditions on the Y terms require the first derivative of Y we define this by differentiating Y,
>Yp:=diff(Y,y);
![]()
The boundary conditions are applied by substituting y = 0 into the derivative and setting equal to zero:
>eq4:=eval(subs(y=0,Yp))=0;
![]()
This eliminates _C2 from the Y equation and yields a solution for Y as
![]()
The boundary condition at y = 1 requires the derivative and the term Y1. The resulting equation is
>eq5:-subs(y=1,Yp1)=-h*subs(y=1,Y1);
![]()
This equation defines the
in the solution for the series terms, un as below
u[n]:=A[n]*exp(-l[n]*x)*cos(l[n]*y);
![]()
Here, we have already defined l as
by the command l:=lambda in order to avoid a lot of typing. The square brackets around the n, [n] in the above command defines n as a subscript. The series coefficients, An are found from
>A[n]:=int(u0*cos(l[n]*y),y=0..1)/int((cos(l[n]*y)^2,y=0..1));
![]()
and the entire solution is
>u:=sum(u[n],n=1..infinity);
![]()
The numerical values of u0 = 100 and h =1 are used in order to plot. Before any plotting can be accomplished the
n must be determined and then the An can be determined. A plot of
and cot(
) will indicate where the roots are located and then the MAPLE solve command can be used, for example
>lambda[1]:=fsolve(eq5,i,l=0..3);
![]()
finds the first of the
, the plot showed it to be between 0 and 3. A number of values are determined until a decent agreement between the series and the known values is found. The series coefficients can then be found from
>A[1]:=int(u0*cos(l[1]*y),y=0..1)/int(cos(l[1]*y)^2,y=0..1));
![]()
An attempt was made to put 10 terms into the series. In order to see if this was a valid series, a plot was made at the x = 0 boundary where the solution was to be exponential,

Figure1. Temperature at y = 0
The plot looks very good. A plot of the temperature at x = 0 should be a constant value of 100 and it is a very good match, with a slight amount of ripple, due to the low number of terms used. To determine the shape of the values throughout the solid a three dimensional plot is used, as shown in figure 2. The series up to 10 terms was labeled u10 and the plot command for figure 2 is the next MAPLE command line. Because the plot looked like it might be a uniform temperature as a function of y, another three dimensional view was examined from the y = 0 plane. As shown in figure 3, the temperature has some variation as a function of y.
>plot3d(u10,x=0..5,y=0..1,axes=box,orientation=[-45,45]);
|
Figure 2. Two dimensional view |
Figure 3. Two dimensional view from the side |
One of the special features of MAPLE is this three dimensional plotting capability which allows the students to get a feel for the solutions.
Another valuable feature for the students is the ease at which MAPLE solves problems in other coordinate systems. In cylindrical coordinates the solutions are normally Bessel functions. An example of a relatively simple, for MAPLE, problem is illustrated below. The problem is not so simple for undergraduate students if left to solve by hand. The problem illustrated here is very similar, except that the steady state temperature to be found is that in a cylinder. Laplace’s equation in cylindrical coordinates with radial symmetry is

When this is separated by u(r,z) = R(r)Z(z) we get the two equations
![]()
and
![]()
The boundary conditions chosen for this example are u(2,z) = 0, u(r,0) = 0, and u(r,4) = uo. The solutions are found by using MAPLE’s dsolve command again. We get
>dsolve(eq2,R(r));
![]()
Knowing that the temperature on the axis of the cylinder remains finite we realize that _C2 = 0 and the boundary condition at r = 0 along with the solution to eq3 yields
![]()
for each term of the series. In these expressions the Bessel functions are written out as BesselJ or BesselY, etc. These are actually, in general, BesselJ(n,x) = Jn(x). The boundary condition at z = 0 defines our
,
![]()
and then the boundary condition at z = 4 yields our An, from
![]()
at z = 4
>subs(z=4,u)=0;
![]()
From this we know that we must have a series of Bessel functions of the first kind of order zero. These are found from

which yields
![]()
or a solution of the form
![]()
Unfortunately, MAPLE’s plotting in cylindrical or spherical coordinates are not as good as for rectangular or Cartesian coordinates and no attempt will be made to plot this series.
Spherical coordinates yield another interesting set of solutions. After separation of variables for a system which has no dependence on φ we have the following equations to solve.
![]()
and
![]()
This second equation can be solved if
2 = n(n+1) where n is an integer, the result are the Legendre polynomials, Pn(cos(
)). This results in a solution for R(r) from
>dsolve(eq1,R(r));
![]()
where the ~ indicates that we have assumed that n is an integer. This equation was used to solve the problem of the electrostatic potential around a grounded sphere placed in a uniform electric field E directed in the positive z direction. The electrostatic potential at a great distance from the sphere must be that of the uniform field, i.e. u(r,
) = -Ez = -Ercos(
). We can use MAPLE to determine which of the Legendre polynomials we need. We need to call up the orthopoly subprogram with the command, with(orthopoly); and then evaluate the polynomials until we get one that matches our solution. This is accomplished rapidly as follows,
>P(0,cos(
));
1
>P(1,cos(
);
cos(
)
>P(2,cos(
);
![]()
We see that the second of these is the one we need, therefore n = 1. The solution is thus
![]()
At a long distance from the sphere u = _C1rcos(
) which yields _C1.
![]()
>solve(eq3,C1):
![]()
At the surface of the grounded sphere, R, the electrostatic potential must be zero,
>subs(r=R,u(r,
)=0;
![]()
Even though the above equation still contains C1, it will be evaluated when this is solved for C2.
>solve(”,C2);
C2:=ER2
The solution is thus
>u(r,
):=eval(u(r,
));
![]()
Of course, more difficult problems can be solved, but a simpler one was illustrated her for lack of space.
MAPLE will handle Laplace transforms quite well also and the use of Laplace transforms may be quite useful in solving partial differential equations also. A relatively simple example will again be illustrated. This time the heat equation will be solved. In order to use Laplace Transforms to solve these equations, we must call up the integral transform sub program, by
>with(inttrans):
Equation 1 is typed in as
>diff(u(x,t),x,x)=diff(u(x,t),t);
![]()
with the boundary conditions u(0,t) = 1, and as x gets very large, u(x,t) goes to zero. The initial condition, u(x,0) = 0 is input immediately so that the Laplace transformed equation can use it, e.g.
>u(x,0):=0;
u(x,0):=0
The entire equation is then Laplace transformed
>laplace(eq1,t,s);
![]()
The laplace command tells MAPLE to Laplace transform from the time domain to the s plane. Note that the initial condition was evaluated in the transform step. This equation is cumbersome and it is easier to rewrite it before trying to solve,
>eq2:=diff(U(x),x,x)-s*U(x)=0;
Using the dsolve command and realizing that the positive exponential must not be part of the solution, we get
![]()
and we can determine _C1 from the Laplace transform of the boundary condition at x = 0,
>laplace(bc1,t,s);
![]()
>eval(subs(x=0,U(x,s))=rhs(”);
![]()
We now redefine our solution so that we get the correct transform,
>U1(x,s):=eval(U(x,s));
![]()
MAPLE will not inverse Laplace transform this expression. However, the solution
![]()
can be found in most Laplace transform pairs tables.
It has been shown that, even though MAPLE’s partial differential equation solver is not of much use, MAPLE can be very beneficial in solving partial differential equations. The user must have some idea of what in going on because most of the problems need the insertion of a step or more by the user in order to solve the problem.
Solutions in rectangular, cylindrical, and spherical coordinates were illustrated. In addition, a problem using the Laplace transform to assist in the solution of a partial differential equation was demonstrated.
1 SOUKUP, R. J. The Use of MAPLE and Partial Differential Equations in the Simulation of Engineering Systems. Proceedings of the International Conference on Simulation and Multimedia in Engineering Education (1999), pp. 43-48.
2 ZILL, D. G. & CULLEN, M. R. Advanced Engineering Mathematics. Sudbury, MA USA: Jones and Bartlett Publishers, 1998.