Frobenius and power series solutions to ODEs in Wolfram
Frobenius and power series solutions to ODEs in Wolfram
Not all ordinary differential equations, or ODEs, can be solved analytically, and power series or Frobenius series solutions can then be extremely helpful. The current essay provides Wolfram Language function to help automate power and Frobenius series solutions, a manual work that is done much better by computer than by human. The essay looks at linear homogenous ODEs with polynomial coefficients. A major disadvantage of series solutions is that generally, they only converge within a limited region, which severely restricts their usage; in this essay, a method for piecewise Frobenius/power series is given, that allows to overcome the challenge of limited convergence radius by sewing Frobenius series solution with several power series solutions.
In[]:=
SaveDefinitions True;
Quick demonstration of the results
Quick demonstration of the results
Solve the equation near the singular point step-by-step using Frobenius’s method:
2y''+7x(x+1)y'-3y=0
2
x
x=0
In[]:=
frobeniusDSolve[2y''[x]+7x(x+1)y'[x]-3y[x],y,x,0,"StepByStep"True]
2
x
Out[]=
-3,,{},a[n]-
1
2
7(-1+n+r)a[-1+n]
-3+7(n+r)+2(-1+n+r)(n+r)
The output tells us that is either or and that =-. The function can also solve equations that don’t have a singular point; in that case, the solution reduces to a power series solution:
r
-3
1/2
a
n
7(-1+n+r)
a
n-1
-3+7(n+r)+2(-1+n+r)(n+r)
In[]:=
frobeniusDSolve[f''[x]+f[x],f,x,0]
Out[]=
{0,1},{r(1+r)a[1]0},a[n]-
a[-2+n]
(-1+n+r)(n+r)
r
0
x
1
x
2y''+7x(x+1)y'-3y=0
2
x
10
In[]:=
frobeniusNDSolve[2y''[x]+7x(x+1)y'[x]-3y[x],y,x,0,10]
2
x
Out[]=
,+-+-+-+-+
1-+-
21x
5
49
2
x
5
343
3
x
15
3
x
x
1-7x
18
49
2
x
264
1715
3
x
20592
16807
4
x
494208
117649
5
x
9335040
823543
6
x
193489920
117649
7
x
89303040
823543
8
x
2190901248
5764801
9
x
57994444800
40353607
10
x
1648263168000
In[]:=
{Plot[%[[1]],{x,0,2},ImageSizeMedium],Plot[%[[2]],{x,0,2},ImageSizeMedium]}
Out[]=
,
The more terms we compute, the more accurate the solution becomes. Here is what the second solution (++...) looks like for different ncoefs:
x
1-7x
18
49
2
x
264
Out[]=
|
With ncoefs = 100, it is possible to reduce the error to be of order . Obtain a piecewise Frobenius solution to an equation whose Frobenius series solution has a limited convergence radius:
-15
10
Out[]=
Solutions to 2 2 x 2 ) |
While the ‘regular’ Frobenius solution seems to start diverging at (since is a singular point of the equation, from Fuchs’ theorem we would expect the radius of convergence to be around 3), the piecewise solution continues to be accurate. We can assess the accuracy of the piecewise solution by plotting the absolute value of the right-hand-side of the equation, , which is zero for an exact solution.
x=3
x=-3
2y''+7x(x+3)y'-3y
2
x
2
(x+3)
Out[]=
Solutions to 2 2 x 2 ) |
Step-by-step solutions
Step-by-step solutions
Numerically computing the coefficients
Numerically computing the coefficients
Piecewise solutions
Piecewise solutions
The overall principle
The overall principle
Placing the nodes
Placing the nodes
Gluing two solutions together
Gluing two solutions together
Assembling the piecewise solution
Assembling the piecewise solution
Results
Results
Comparison to frobeniusNDSolve
Comparison to frobeniusNDSolve
Options
Options
Open questions
Open questions
Bibliography
Bibliography
http://dslavsk.sites.luc.edu/courses/other/classnotes/frobenius.pdf
https://www.math.mcgill.ca/gantumur/math315w14/downloads/frobenius.pdf
https://ir.library.oregonstate.edu/downloads/6395w964x
https://www.math.mcgill.ca/gantumur/math315w14/downloads/frobenius.pdf
https://ir.library.oregonstate.edu/downloads/6395w964x