Find an approximate solution of![]()
as![]()
The equation obviously has an analytical solution, so the purpose
here is to demonstrate the perturbation method on an equation with
a known solution, so that we can see that the method works.
In[1]:=
![]()
First, define the equation:
In[2]:=
![]()
Find the exact solutions, which comes out as a list of 2 replacment rules:
In[3]:=
![]()
Out[3]=
![]()
Show how to access the element of a list (in case you do not know):
In[4]:=
![]()
Out[4]=
![]()
In[5]:=
![]()
Out[5]=
![]()
Check that these solutions really do satisfy qe:
In[6]:=
![]()
Out[6]=
![]()
In[7]:=
![]()
Out[7]=
![]()
Define functions
for the two exact, analytical solutions
In[8]:=
![]()
Out[8]=
![]()
In[9]:=
![]()
Out[9]=
![]()
Now prepare to find an approximate perturbation solution. Note
the O[ϵ] symbol is powerful in Mathematica, try changing {n,0,2} to {n,0,10) and see what happens...
In[10]:=
![]()
Out[10]=
![]()
Substitute the series solution for
into the equation qe:
In[11]:=
![]()
Out[11]=
![]()
LogicalExpand is really cool, and works because of the presence of the O[ϵ] symbol :
In[12]:=
![]()
Out[12]=
![]()
The "logical and" might just as well be a list of equations that need to be true. In fact the equation can be accessed as list, for example:
In[13]:=
![]()
Out[13]=
![]()
Obviously, the above equation has solutionx
and
.
Taking
and
:
In[14]:=
![]()
Out[14]=
![]()
Similarly, with
:
In[15]:=
![]()
Out[15]=
![]()
So here are the two approximate solutions to qe:
In[16]:=
![]()
Out[16]=
![]()
In[17]:=
![]()
Out[17]=
![]()
Compare the exact (green) and approximate (red) solutions:
In[18]:=
![]()
![[Graphics:HTMLFiles/index_44.gif]](HTMLFiles/index_44.gif)
Out[18]=
![]()
In[19]:=
![]()
![[Graphics:HTMLFiles/index_47.gif]](HTMLFiles/index_47.gif)
Out[19]=
![]()
Converted by Mathematica (March 3, 2003)