Sie sind auf Seite 1von 6

Power Series Solution near Ordinary Points

Copyright Brian G. Higgins (2009)

Introduction
Consider the following linear differential equation
a2 HxL

2 y
x2

+ a1 HxL

y
x

+ a0 HxL y = 0

(1)

where ai HxLare polynomial coefficients with no common factors.


Suppose now we are interested in determining the solution at a point x0 . Let us suppose further that the
polynomial a2 Hx0 L 0. Then the point x0 is called an ordinary point. Since a2 is continuous in the
neighborhood of x0 we can divide through by a2 to obtain the reduced form
2 y
x2

+ p HxL

y
x

(2)

+ q HxL y = 0

From the existence and uniqueness theorems for ODEs, there is a unique solution to (2) about an
interval near x0 that satisfies the initial conditions y Hx0 L = C1 , y' Hx0 L = C2 . Further, since the
functions p(x) and q(x) are analytic at x0 , they can be expanded in a Maclaurin power series about x0 :

p HxL = An Hx - x0 Ln , q HxL = Bn Hx - x0 Ln
n= 0

(3)

n= 0

If Eqn(2) has a solution y=f(x), that has a Taylor series expansion

y HxL = f HxL = an Hx - x0 Ln

(4)

n=0

The coefficients an in (4) can be determined by substituting the series into the ODE and equating coefficients multiplying equal powers of Hx - x0 L. This procedure is shown in the next section.

Mathematica Solution
Example 1 : Linear equation with variable coefficients
Consider the following linear differential equation with variable coefficients:
2 y
t

+ 2 t3

y
t

+2 y = 0

(5)

with initial conditions


IC1 : y H0L = 1
(6)

IC2 : y' H0L = 2


Note a closed form analytical solution to this problem cannot be found by Mathematica's differential
equation solver DSolve. Instead, we will attempt to find a power series solution to this problem about an
ordinary point t0 . By inspection we can deduce that there are no singular points for t 0, It will be
convenient to have a numerical solution that we can used to assess the accuracy our power series
solution.

ODESeriesSoln.nb

Note a closed form analytical solution to this problem cannot be found by Mathematica's differential
equation solver DSolve. Instead, we will attempt to find a power series solution to this problem about an
ordinary point t0 . By inspection we can deduce that there are no singular points for t 0, It will be
convenient to have a numerical solution that we can used to assess the accuracy our power series
solution.
The numerical solution to this equation is shown below for 0t3
eqnBC = 9y @tD + t3 y @tD + 2 y@tD 0, y@0D 1, y @0D - 2=;
sol = NDSolve@eqnBC, y@tD, 8t, 0, 10<D;
myPlot1 = Plot@y@tD .sol, 8t, 0, 3<, PlotRange All,
AxesLabel 8"t", "yHtL"<, PlotStyle Blue, Frame True,
FrameLabel 8Style@"x", 10, "Label"D, Style@"yHxL", 10, "Label"D<D
1.0

0.5

yHxL

0.0

-0.5

-1.0

0.0

0.5

1.0

1.5

2.0

2.5

3.0

To show each step we will work with only a few terms in the series
Since we show each step of the analysis, it is convenient to work with only a few terms in the series.
The first step is to generate a power series expansion of the unknown function y(t), which we call
myPowerSeries, up to order 3, i.e., with a truncation error of O HtL4 .
myPowerSeries = Series@y@tD, 8t, 0, 3<D
y@0D + y @0D t +

1
2

y @0D t2 +

1
6

yH3L @0D t3 + O@tD4

Next we define our ODE and initial conditions (it will be convenient to define the initial conditions as
replacement rules)
myODE = y ''@tD + t3 y '@tD + 2 y@tD 0;
myIC = 8y@0D -> 1, y '@0D - 2<;

The next step is to substitute the power series expansion into the ODE. Recall myPowerSeries is a
special Mathematica object called a SeriesData object: it behaves like a pure function when it comes
to substituting into an ODE
myODESeries = myODE . y@tD -> myPowerSeries
H2 y@0D + y @0DL + I2 y @0D + yH3L @0DM t +
y @0D +

1
2

yH4L @0D t2 + y @0D +

1
3

yH3L @0D +

1
6

yH5L @0D t3 + O@tD4 0

We can use LogicalExpand to equate coefficients at each order of tn to zero which determines the
system of algebraic equations we need to solve for our unknown coefficients yHnL @0D . However the
initial conditions determine two of those coefficients: y[0] and y'[0]. Here is the result

ODESeriesSoln.nb

myAlgebraicEqns = LogicalExpand@myODESeriesD . myIC


2 + y @0D 0 && - 4 + yH3L @0D 0 && y @0D +

1
2

yH4L @0D 0 && - 2 +

1
3

yH3L @0D +

1
6

yH5L @0D 0

We can readily solve these algebraic equations using Solve


seriesCoef = First@Solve@myAlgebraicEqnsDD
9y @0D - 2, yH3L @0D 4, yH4L @0D 4, yH5L @0D 4=

Finally, we can substitute the values for our coefficients into our original power series expansion of y[t].
(We need also to substitute the values for y[0] and yH1L @0D which are determined from the initial
conditions)
mySeriesSol = myPowerSeries . seriesCoef . myIC
1 - 2 t - t2 +

2 t3
3

+ O@tD4

Please note that all these calculations were done in exact arithmetic. Thus there are no round-off errors
as we include higher orders of the expansion. Finally let us plot the results. Please note that our solution
is in the form of a SeriesData object. Hence, before we can plot is we must convert it to a normal
Mathematica expression by wrapping it with Normal and then with Evaluate to force evaluation within
the plot routine.
myPlot2 = Plot@Evaluate@Normal@mySeriesSolDD,
8t, 0, 2.3`<, PlotRange All, PlotStyle Red, Frame True,
FrameLabel 8Style@"x", 10, "Label"D, Style@"yHxL", 10, "Label"D<D
1.0
0.5

yHxL

0.0
-0.5
-1.0
-1.5
-2.0
0.0

0.5

1.0

1.5

2.0

We can compare our series solution with the numerical solution.

ODESeriesSoln.nb

Show@myPlot1, myPlot2D
1.0
0.5
t

0.0

yHxL

-0.5
-1.0
-1.5
-2.0
0.0

0.5

1.0

1.5

2.0

2.5

3.0

The above plots show that our series solution is accurate for t < 0.5. Clearly we can extend the range
of applicability by including more terms in the series. At this point it makes more sense to write a small
module that does the steps of the solution. We explore this option in the next example.

Example 2: Module for finding series solutions


Our goal here is to take the various steps outlined in the previous example and combine them into a
Module. The module will be written so that the user can specify the system of equations and ICs that we
seek a series solution. We will require the user to specify what are the independent and dependent
variables and the number of terms in the expansion.
This is not a general purpose module; for example, there is no error checking, and we assume that the
equations submitted by the user have a power series solution about its initial condition taken to be t=0,
that is t=0 is an ordinary point of the ODE. In this way we can focus on the essential programming
features of the module. Listed below is our module:
ODESeriesSoln@sys_, indvar_, depvar_, n_D :=
Module@8t = indvar, y = depvar, initconds, ODE, IC, PowerSeries,
ODESeries, AlgebraicEqns, SeriesCoef, SeriesSol, plt1<,
initconds = Flatten@Sort@Select@Flatten@8sys<D, D@, tD &DDD;
ODE = Complement@Flatten@8sys<D, initcondsD;
IC = initconds . Equal Rule;
PowerSeries = Series@y@tD, 8t, 0, n<D;
ODESeries = First@ODE . y@tD -> PowerSeriesD;
AlgebraicEqns = LogicalExpand@ODESeriesD . IC;
SeriesCoef = First@Solve@AlgebraicEqnsDD;
SeriesSol = PowerSeries . SeriesCoef . IC;
SeriesSolD

If we inspect the code for this module we see that many of the steps are identical to what we used
previously , with some slight changes for variable names. The first two statements are used to extract
the ODE from the initial conditions in the variable sys which the user supplies. The key is to first extract
out the initial conditions from the list sys using the select function with a rule that checks to see which
elements are initial conditions. Here is an explanation of the method: suppose our system of equations
was
sysTest = 8y@0D 1, y '@tD y@tD + 2<;

ODESeriesSoln.nb

Then if we take the derivative for each element of the list, the IC yields true
8D@y@0D 1, tD, D@y '@tD 1, tD<
8True, y @tD 0<

Thus if we use D@, tD & as our test function in Select we can extract out the ICs
ICTest = Select@sysTest, D@, tD &D
8y@0D 1<

Once we have the initial conditions we can use complement to get the ODE equations
Complement@sysTest, ICTestD
8y @tD 2 + y@tD<

The rest of the code is virtually identical to what we did previously. Once we have the ICs we convert
them to Rules and by asking the user to specify the independent and dependent variables we are able
to code the steps for a single set of independent and dependent variables.
Let us try out this module on the following system of equations
sys = 9x ''@xD + x3 x '@xD + 2 x@xD 0, x@0D == 1, x '@0D == - 2=
92 x@xD + x3 x @xD + x @xD 0, x@0D 1, x @0D - 2=

Here is the series solution with 5 terms in the expansion


ODESeriesSoln@sys, x, x, 5D
1 - 2 x - x2 +

2 x3
3

x4
6

x5
30

+ O@xD6

We can use the module to plot and compare the solution with the original numerical solution. Here is a
plot of the solution with 100 terms in the expansion
plt2 =
Plot@Evaluate@Normal@ODESeriesSoln@sys, x, x, 100DDD, 8x, 0, 4<, PlotStyle Red,
Frame True, FrameLabel 8Style@"x", 10, "Label"D, Style@"yHxL", 10, "Label"D<D;
Show@plt2, myPlot1, PlotRange 880, 3<, 8- 3, 1<<D
1

yHxL

-1

-2

-3
0.0

0.5

1.0

1.5

2.0

2.5

3.0

ODESeriesSoln.nb

Example 3: Series solution of Blasius Equation


Our next example is taken from fluid mechanics. The similarity solution for boundary layer flow over a
flat plate is given by the nonlinear Blasius equation:
sys2 = 8F '''@hD + F@hD F ''@hD 0,
F@0D == 0, F '@0D == 0<
9F@hD F @hD + FH3L @hD 0, F@0D 0, F @0D 0=

Note that this is a 3rd order nonlinear ODE. We have 2 "initial conditions" at h=0. The third condition is
specifies as h : F'@D 0. For our series solution we will use the initial conditions at h=0, taken to
be an ordinary point. Thus we will need to solve for the coefficients in terms of F''(0) . In fact we will
show that the solution is given in the form

F HhL ~ H-1Ln Cn h2 n+2

(7)

n=0

where
C0 =

1
2

F'' H0L, C1 = H1 5!L H2 C0 L2 , C2 = H11 8!L H2 C0 L3

(8)

This solution was found by Weyl (1942). Here is the solution found using our module:
ODESeriesSoln@sys2, h, F, 11D
Solve::svars : Equations may not give solutions for all "solve" variables.

1
2

F @0D h2 -

1
120

F @0D2 h5 +

11 F @0D3 h8
40 320

5 F @0D4 h11
532 224

+ O@hD12

References
These notes build on Mathematica programming methods that are discussed in the notebook;
ODESingularPoints.nb. I also found the following references most helpful.

1. Dennis G. Zill and Michael R. Cullen, Advanced Engineering Mathematics, PWS-KENT,


Boston, MA, 1992
2. Arvind Varma and Massimo Morbidelli, Mathematical Methods in Chemical Engineering,
Oxford University Press, 1997.
3. Martha L. Abell andJames P.Braselton, Differential Equations with Mathematica, 2nd Edition,
Academic Press, 1997
4. George Arfken, Mathematical Methods for Physicists, 3rd Edition, Academic Press, 1985
5. Michael D. Greenberg, Foundations of Applied Mathematics, Prentice-Hall, Englewood Cliffs,
NJ, 1978

Das könnte Ihnen auch gefallen