58 NUMERICAL SOLUTIONS TO ORDINARY DIFFERENTIAL EQUATIONS If the equation contains derivatives of an n-th order, it is said to be an n-th order differential equation. For example, a second-order equation describing the oscillation of a weight acted upon by a spring, with resistance motion proportional to the square of the velocity, might be where x is the displacement and t is time. 0 6 . 0 4 2 2 2 = + + x dt dx dt x d The solution to a differential equation is the function that satisfies the differential equation and that also satisfies certain initial conditions on the function. The analytical methods are limited to a certain special forms of the equations. Elementary courses normally treat only linear equations with constant coefficients. Prepared by Ben M. Chen
30
Embed
NUMERICAL SOLUTIONS TO ORDINARY DIFFERENTIAL EQUATIONS …pages.intnet.mu/cueboy/education/notes/numerical/numericalode.pdf · NUMERICAL SOLUTIONS TO ORDINARY DIFFERENTIAL EQUATIONS
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
58
NUMERICAL SOLUTIONS TO ORDINARY DIFFERENTIAL EQUATIONS
If the equation contains derivatives of an n-th order, it is said to be an n-th
order differential equation. For example, a second-order equation describing
the oscillation of a weight acted upon by a spring, with resistance motion
proportional to the square of the velocity, might be
where x is the displacement and t is time.
06.042
2
2
=+
+ x
dtdx
dtxd
The solution to a differential equation is the function that satisfies the
differential equation and that also satisfies certain initial conditions on the
function. The analytical methods are limited to a certain special forms of the
equations. Elementary courses normally treat only linear equations with
constant coefficients. Prepared by Ben M. Chen
59
Numerical methods have no such limitations to only standard forms. We
obtain the solution as a tabulation of the values of the function at various
values of the independent variable, however, and not as a functional
relationship.
Our procedure will be to explore several methods of solving first-order
equations, and then to show how these same methods can be applied to
systems of simultaneous first-order equations and to higher-order
differential equations. We will use the following form
for our typical first-order equation.
00 )(),,( yxyyxfdxdy ==
Prepared by Ben M. Chen
60
THE TAYLOR-SERIES MENTOD
The Taylor-series method serves as an introduction to the other techniques
we will study although it not strictly a numerical method. Consider the
example problem
(This particularly simple example is chosen to illustrate the method so that
you can really check the computational work. The analytical solution,
is obtained immediately by application of standard methods and will be
compared with our numerical results to show the error at any step.)
0,1)0(,2 0 =−=−−= xyyxdxdy
223)( +−−= − xexy x
Prepared by Ben M. Chen
61
Taylor Series Expansion:
We develop the relation between y and x by finding the coefficients of the
Taylor series expanded at x0
If we let x – x0 = h , we can write the series as
Iterative Procedure:
Since y(x0) is our initial condition, the first term is known from the initial
condition y(x0) = – 1. We get the coefficient of the second term by
substituting x = 0, y = – 1 in the equation for the first derivative
L+−+−+−+= 30
020
0000 )(
!3)(''')(
!2)("))((')()( xxxyxxxyxxxyxyxy
L++++= 302000 !3
)('"!2
)(")(')()( hxyhxyhxyxyxy
( ) 1)1()0(2)(22)( 0000
0
=−−−=−−=−−==′=
=
xyxyxdxdyxy
xxxx
Prepared by Ben M. Chen
62
Similarly, we have
( ) 3)()(22)( 0 −=′′⇒′−−=−−=
=′′ xyxyyx
dxd
dxdy
dxdxy
3)(3)( 0)4(
0 −=⇒=′′′⇒ xyxy
We then write our series solution for y, letting x = h be the value at which
we wish to determine y:
error term125.05.05.10.11)( 432 +−+−+−= hhhhhy
Here shown is a case whose function is so simple that the derivatives of
different orders can be obtained easily. However, the differentiation of
f(x,y) could be very messy, say, those of x / ( y – x2 ).
Prepared by Ben M. Chen
63
EULER METHOD
As shown previously, the Taylor-series method may be awkward to apply if
the derivatives becomes complicated and in this case the error is difficult to
determine. In fact, we may only need a few terms of the Taylor series
expansion for good accuracy if we make h small enough. The Euler
method follows this idea to the extreme for first-order differential equations:
it uses only the first two terms of the Taylor series!
Iterative Procedure:
Suppose that we have chosen h small enough that we may truncate after
the first-derivative term. Then
where we have written the usual form of the error term for the truncated
Taylor-series.
2000 2
)(")(')()( hyhxyxyhxy ζ++=+
Prepared by Ben M. Chen
64
The Euler Method Iterative Scheme is given by
′⋅+===′
+ nnn
nnn
yhyyxyyyxfy
1
00 )(),,(
Example: Using Euler Method with h = 0.1, find solution to the following o.d.e.