Professional Documents
Culture Documents
Restart With (Plots) : With (Detools) :: Picard Picard
Restart With (Plots) : With (Detools) :: Picard Picard
1, Pro ject B)
Objectives:
Background
First-order initial value problems of the form ( ) = ( y
0
x ( )), ( 0) =
f x y x y x y0 can be
rewritten as an integral equation
Z x
( )=
y x y0 + ( ( ))
f t y t dt:
x0
rule Zx
n+1 ( ) = 0 +
x y ( n( )) f t t dt:
x0
That is, the th approximation is inserted into the right-hand side of the integral equation
n
in place of the exact solution ( ) and used to compute the ( + 1)st element of the
y x n
The same process is used to compute all subsequent approximations. However, in order
to keep the same syntax in the integral, it's necessary to ensure that each n is a Maple
function. For this the unapply function is needed. Thus, the
rst approximation is
> phi1] := unapply( phi1], x )
:= ! 1 + 1 x x
and the second approximation to the solution can be obtained by repeating this process
> phi2] := 1 + int( phi1](t), t=0..x ):
> phi2] := unapply( phi2], x )
:= ! 1 + + 12 2
2 x x x
For each of the last two approximate solutions, the two commands will be combined into
a single Maple command
> phi3] := unapply( 1 + int( phi2](t), t=0..x ), x )
:= ! 1+x+
1 3
+ 21 2
3 x
6 x x
:= ! 1 + + 24 1 4+ 1 2+ 1 3
4 x
2x
6 x x x
The pattern to the sequence of approximate solutions is obvious. Each iterate adds one
new term. The new term for n ( ) is n!1 n. Thus, for each 0,
x x n
X
n n
n x ( )= x
n ! :
k=0
These functions are the partial sums of the Maclaurin series for x . e
From our knowledge of power series, we know that these partial sums converge to
the exponential function for all real numbers . This convergence can be demonstrated
x
graphically
3
> plot( { exp, phii] $ i=0..4 }, 0..3,
> title=`Picard Iterates and Limit for y'=y, y(0)=1` )
20
18
16
14
12
10
To conclude this example, we note that the exponential function is a solution to the
initial value problem.
Example 2: Use Picard's Method with 0( ) = 0 to obtain the next three successive
x
ODE, the initial condition, and the initial/previous approximate solution. Here is our
version of the method
> picard := proc(f, init, phi)
> local x0, y0
> x0 := init1]
> y0 := init2]
> unapply( y0 + int( f(t,phi(t)), t=x0..x ), x )
> end:
Note that the initial condition, init, is expected to be the ordered pair 0 0] and f x y
and phi are assumed to be Maple functions. The output from picard is the next approxi-
mate solution, as a Maple function (so that, e.g., the output is suitable for immediate use
in another call to picard.
To use picard to provide the requested information in this example, let
> phi0] := 0
0 := 0
> f := (x,y) -> 2*x-y^2
f := ( x y )!2 x ; y2
:= ( ! )2 1 x x
:= ! x2 ;
1 5
2 x
5 x
:= ! 2 ; 15 5 + 20
3 x x
1 8 ; 1 11
275
x x x
The problem simply asks for a plot of these approximate solutions on the interval 0 x
1. The picture is a little nicer if a few more iterates are included. The computation of the
next two iterates can be done in a simple for ... do ... od command. For example,
> for n from 0 to 4 do
> phin+1] := picard( f, 0,0], phin] )
> od
> n := 'n':
1 x ! x
2
:= (
)
1 5
2 := !
2
;
5 x x x
1 1 1 11
3 := ! +
2 5 8
; ;
x
5 x
20 x
275 x x
3 87 1 1 7 11 ; 1 5 + 1 8
4 := ! + 1540 14 ; 374000 17 + 55000 20 ; 1739375 23 ; 550
2
x x x x x
5 20x x x x
7781 1 1
533431525000000 + 2104643750000 ; 142194993359375
41 44 47
; x x x
659 20 ; 1 5 + 1 14 ; 1769 17 + 1 8 ; 7 11
+ 5236000 x
5 308
x
2618000
x
20 550 x x x
The convergence of these polynomials is not as obvious as the
rst example. Even from
the graph it's dicult to determine the interval on which this integral exists. Including the
direction
eld in the plot shows precisely how these approximate solutions must behave.
Here is the graph that provides the most information. (The plots on 0 1] do not show
too much dierence between the successive approximations. Doubling the interval to 0 2]
1.8
1.6
1.4
1.2
1
y
0.8
0.6
0.4
0.2
00 0.5 1 1.5 2
x
0 does not have a unique solution. Show that Picard's Method, starting with 0( ) = 0 x
Each of these can be easily computed using picard. But, the
rst part is so simple,
it's really a waste of time and energy to use picard or Maple. The claim is that n ( ) = 0 x
for all and for all integers . Thus, these approximate solutions converge to the zero
x n
solution.
The successive approximations generated when the initial approximation to the solu-
tion is
> phi0] := x -> x-2
:= ! ; 2
0 x x
and Maple's inability to choose the branch that leads to the real-valued result. The
combine function can be used to force some of the simpli
cations that Maple does not
want to make automatically. The modi
ed version of picard is
> picard2 := proc(f, init, phi)
> local x0, y0
> x0 := init1]
> y0 := init2]
> unapply( y0 + int( combine( f(t,phi(t) ), power ), t=x0..x ), x )
> end:
:= 9
1 x !
5( x ; 2 )5=3
:= !
27 ( ; 2 )19=9 92=3 51=3
2 x
95 x
So, even the modi
ed version of picard does not work for all cases. However, it is obvious
that the
rst three approximates all have the form
n x ( ) = n( c x ; 2)rn
for some constants n and n . Explicit formulae for n and n are not apparent from the
c r c r
rst three approximate solutions. An alternate approach to the problem of
nding these
sequences and, hopefully, limn n , is to obtain a recurrence relation between successive
!1
terms in each sequence. To determine the appropriate recurrence relations, suppose the
n
th iterate is
> phin] := x -> c*(x-2)^r
n := x ! c ( x ; 2 )r
Then, the next iterate will be
> phin+1] := picard2( f, 2,0], phin] )
:= x !
2=3 t ;
lim 9
c (t; 2 ) ((
r 2=3 2) ) +9 c
2=3 ( x ; 2)(( x ; 2 )r )2=3
n+1
t!2+ r 3+2 3+2 r
r
c t
r
Maple is hesitant about evaluating the limit because 0 has not been excluded. r
However, examination of the
rst three iterates together with the above result indicates
that the exponents will always be positive.
> assume( rr>0 )
9 ( 3 +22)rr ~
c
2=3 x ; ( 1+2=3 rr ~ )
REr := r( + 1 ) = 1 + 32 r( )
n n
with initial condition 0 = 1, is not so easily solved (by hand or by Maple). It is,
c
n+1
2=3
= 3 +92 ! 1
c
n c n r
is a solution to the IVP. As a result, this IVP does not have a unique solution. (Note
that this conclusion is consistent with the existence and uniqueness theory y ( ) is not f x y
continuous at = 0.
y
Example 4: Use Picard's method with 0( ) = 1 to compute the next six successive
x
Create plots of the each Picard iterate superimposed on the direction
eld. What can you
say about the existence of a solution to this IVP?
The data required by picard is given as in the previous examples.
> f := (x,y) -> 1+y^2
f := ( x y )! 1+ y
2
> phi0] := 1
:= 1 0
The computation of the Picard iterates is straightforward. Only the
rst four iterates are
displayed, for the sake of saving a few pages of output.
> for n from 0 to 5 do
> phin+1] := picard( f, 0,1/2], phin] )
> od:
> phi1](t)
1 +2
2 t
> phi2](t)
1 +5 + 2+4 3
2 4 3 t t t
8
> phi3](t)
1 41 3 5 5 2 16 7 13 5 23 4 4
2 + 48 + 4 + 8 + 63 + 15 + 24 + 9
6
t t t t t t t
> phi4](t)
The convergence of the constant, linear, and quadratic terms are apparent from these
results. One additional term seems to be correct after each Picard iterate, but the total
number of terms doubles with each iteration.
> P1 := DEplot( diff( y(x), x ) = f(x,y(x)), x,y], x=0..2, {0,1/2]},
> y=0..10, arrows=THIN ):
> P2 := plot( { phii] $ i=0..6 }, 0..2, y=0..10 ):
> display( { P1, P2 },
> title=`Direction Field and Picard Iterates: y'=1+y^2, y(0)=1/2` )
10
00 0.5 1 1.5 2
x
While it is not practical to print an animation, the convergence of the PIcard iterates
to the solution of this IVP is quite clear.
> for i from 0 to 6 do
> p.i := display( { P1, plot( phii], 0..2, y=0..10 ) } )
> od:
> i := 'i':
> display( seq( p.i, i=0..6 ) ], insequence=true,
> title=`Direction Field and Picard Iterates: y'=1+y^2, y(0)=1/2` )
The graphical information also suggests that the solution does not exist for all 0. x >
The solution seems to have a vertical asymptote, = , for some slightly larger than
x x
x
CONCLUSION
In this project we have developed a Maple implementation of Picard's method and
illustrated the use of this procedure for three dierent initial value problems. These ex-
amples have demonstrated the convergence of Picard iterates to solutions of the IVP. The
third example is most interesting in that even though the individual successive approxima-
tions could not be determined explicitly, the limit of the sequence could still be resolved.
The fourth example is an additional problem that is selected to illustrate the convergence
of the Picard iterates when the solution exists on only a
nite interval.