0% found this document useful (0 votes)
104 views5 pages

Comparação Entre Runge Kutta e Adams Methods

Comparação entre Runge Kutta e Adams methods

Uploaded by

Fidel Souza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views5 pages

Comparação Entre Runge Kutta e Adams Methods

Comparação entre Runge Kutta e Adams methods

Uploaded by

Fidel Souza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

z

Available online at http://www.journalcra.com


INTERNATIONAL JOURNAL
OF CURRENT RESEARCH
International Journal of Current Research
Vol. 8, Issue, 03, pp.27356-27360, March, 2016

ISSN: 0975-833X
RESEARCH ARTICLE
THE COMPARISON OF RUNGE--KUTTA AND ADAMS-BASHFORH-MOULTON
MOULTON METHODS FOR
THE FIRST ORDER ORDINARY DIFFERENTIAL EQUATIONS
*Solomon
Solomon Gebregiorgis
Gebreg and Genanew Gofe
Department of Mathematics, Jimma University, Ethiopia

ARTICLE INFO ABSTRACT

Article History: The performances of Runge-Kutta


Runge (RK4) and Adams-Bashforth
Bashforth-Moulton(ABM) methods were
th
Received 15 December, 2015
compared by considering first order ordinary differential equations. Moreover the effectiveness of
Received in revised form modifiers in the ABM method has been validated. The result of this research show that ABM method
27th January, 2016 is the most efficient method for first order ODE but in terms of accuracy there is no one best method.
Accepted 25th February, 2016 So it is not possible to make generalizations. But it is possible to conclude that the performance of a
Published online 16th March, 2016 given method depend on the characteristics of the ODEs we are considering such as stiffness and
stability. Regarding the modifiers in the corrector and predictor formulas of the ABM method, they
stability.
Key words: are effective in improving the accuracy of ABM method in most cases.

Computation time,
Relative error,
Efficiency, and accuracy.

Copyright © 2016, Solomon Gebregiorgis Gofe This is an open access article distributed under the Creative Commons Att
iorgis and Genanew Gofe. Attribution License, which
permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Citation: Solomon Gebregiorgisiorgis and Genanew Gofe,Gofe 2016. “The comparison of runge-kutta and Adams-Bashforh
Bashforh-Moulton methods for the first order
ordinary differential equations”,
”, International Journal of Current Research, 8, (03), 27356-27360.

INTRODUCTION Here the methods selected are the explicit Runge


Runge-Kutta method
of fourth order which is a single step method and Adams Adams-
Numerical methods are most widely being utilized to solve the Bashforth-Moulton
Moulton predictor corrector method of fourth order
equations arising in the fields of applied medical sciences, which is a multistep method. The methods selected are among
engineering and technology due to the advancements in the the best methods available (Hull et al., 1972). Each Runge-
field of computational mathematics. There are several Kutta methods are derived from an appropriate Taylor method
numerical methods to solve ordinary differential equations of in such a way that the final global error is of order (ℎ )
the type initial value problem that is the single-step
single methods (Mathews. et al.,., 2004). In this method several function
and the multiple-step
step methods (Chapra and Canale, 1989). evaluations is performed at each step and eliminate the
Many contributions have been made in the area of numerical necessity to compute the higher derivatives. These methods
methods for ordinary differential equations
uations especially in the can be considered for any order N. The RungeRunge-Kutta method
area of the comparison of numerical methods. For comparison of order N = 4 is most popular. It is a good choice for common
purpose we need to consider the problem to be solved, purposes because it is quite accurate, stable, and easy tto
methods to be considered, and comparison criteria (Hull et al., program. Hence it is not necessary to go to a higher higher-order
1972). The major factors to be considered in comparing compari method because the increased accuracy is offset by additional
different numerical methods are the accuracy of the numerical computational effort (Mathews. et al., 2004). If more accuracy
solution and its computation time (Bedet et al., al 1975). They is required, then either a smaller step size or an adaptive
further indicated that it is important to note that the comparison method should be used. A desirable feature of a multistep
of numerical methods is not so simple because their method is that the local truncation error can be determined and
performancess may depend on the characteristic of the problem a correction term can be included, which improves the
at hand. It should also be noted that there are other factors to accuracy of the answer at each step. Also it is possible if the
be considered, such as stability, versatility, proof against run-
run step size is small enough to obtain an accurate value forfor ,
time error, and so on which are being considered in most of the yet large enough so that unnecessary and time time-consuming
MATLAB built-in routines (Yang et al., ., 2005). calculations are eliminated. Using the combination of a
predictor and corrector requires only two function evaluations
*Corresponding author: Solomon Gebregiorgis, of f(x, y) per step. By obtaining the prpredictor/corrector errors
Department of Mathematics,, Jimma University, Ethiopia
it is possible to derive Adams
Adams–Bashforth–Moulton method
27357 Solomon Gebregiorgis and Genanew Gofe. The comparison of runge-kutta and Adams-Bashforh-Moulton methods for the first order ordinary
differential equations

with modification formulas (Yang et al., 2005). The tic;. To stop the timer and display the amount of time elapsed,
performance of numerical methods depend on the use toc;. Computation times for RK4, ABM, and MABM using
characteristics of the ODE considered (Hull et al., 1972; Bedet the five problems have been calculated by varying the number
et al., 1975; Butcher, 2000; Yang et al., 2005; Petzoid, 2006; of steps.
Clement et al., 2009; Abdul, 2013; Polla, 2013; and
Muhammmad and Arshad, 2013). While the central activity of Accuracy
numerical analysts is providing accurate and efficient general
purpose numerical methods and algorithms, there has always To find which numerical method gives a more accurate
been a realization that some problem types have distinctive approximation this study compared the relative errors obtained
features that they will need their own special theory and by using RK4, ABM, MABM for the five problems selected.
techniques (Butcher, 2000). Relative error ( ) is calculated using the formula

The first problem considered in this research is a first-order


= .
differential equation = − with (0) = 1 (Hull et al.,

1972). It has the following form of analytical solution y = e .


According Mathews et al., (2004), the step size h for a fixed-
The second problem is ′ = − /2, ( ) = 1 is a special
point iteration using RK4 and ABM method must satisfy the
case of the Riccati equation and whose solution is given by .
following condition ℎ < . Hence the value of h is in
= (Davis, 1963 as cited in Hull et al., 1972). The third ( , )

problem is ′ = , ( ) = 1 which is an oscillatory such a way that it satisfies this condition. Finally, data obtained
problem and whose solution is given by = (Hull et by using MATLAB version 7.14 software about computation

times and relative errors were analyzed after calculating the
al., 1972). The fourth problem is = 1 − , (0) =1 average and standard deviations. More over graphs of
whose solution is given by = which is the logistic computation times and relative errors have been sketched for
the purpose of analysis.
curve, (Davis, 1962 as cited in Hull et al., 1972). The fifth
problem is ′ = , (0) = 4 whose solution is given by RESULTS
=4 which is a spiral curve (Davis, 1962 as cited in
Hull et al., 1972). As it is shown above the problems selected Comparison of computation times
have exact solutions. This is helpful to compare the
approximated values with the exact values and to calculate Data about computation times (in seconds) obtained using
relative errors. The selection covers a realistically broad RK4, ABM, and MABM methods by varying the number of
spectrum of problem types (Hull et al., 1972). The testing of steps for the five problems. ABM method has the greatest
ODE solvers will be done by using MATLAB after the speed than RK4 and MABM and MABM is the second faster
problems are properly coded and inserted for analysis. Hence in approximating the solution of the ordinary differential
the main purpose of this research is to compare the accuracy equation for all the problems considered.
and computation times of Runge-Kutta and Adams-Bashforth-
Comparison of accuracy
Moulton methods for first order ordinary differential equations.
To compare the accuracies of the RK4, ABM, and MABM
MATERIALS AND METHODS methods, relative errors are computed by taking the number of
steps M = 40 for the five problems considered. Based on these
The study involves entirely laboratory work with the help of a data graphs are sketched for comparison purpose. Moreover,
laptop and a MATLAB software. So it is an experimental average and standard deviations are also calculated to further
research. The methods are coded and run using MATLAB strengthen the comparison task. RK4 method has a better
software by properly inserting the problems and as a result accuracy than ABM method for initial value problems =
numerical results are automatically generated. All algorithms − , (0) = 1 and y ′ = , y(0) = 4 but with the help of
have been made in the same condition, which use the same
type of processor, having the same memory size, the same modifiers the ABM method has a better accuracy than RK4
operating system, and using the same function. The processor (table 1 and fig.2). This result also applies for the problem
used is Intel(R) 2.10 GHz, with 2 GB memory, with the 32-bit
operating system (windows 7 home premium). The language = − , ( ) = 1.
program used is MATLAB version 7.14. Three major 2
programs (codes) have been written to compare the
computation times and accuracies of RK4, ABM, and RK4 method has the greatest accuracy than both ABM and
Modified ABM (MABM) methods. MABM methods on the interval [0, 0.475] but ABM method is
more accurate than RK4 on the interval (0.475, 1] for the
Computation time problem y = ycosx, y(0) = 1. Both RK4 and ABM
methods have the same accuracy up to eight decimal places.
MATLAB has two convenient commands that let us measure More over the usage of modifiers decreases accuracy of ABM
how long an operation takes to solve a given problem after (table 2 and fig.3a). So there is no dominant method on the
certain iterations. To start (and reset) a timer, use the command interval [0, 1]. The intensity of the problem becomes much
greater when we increase the interval to [0, 10] (fig.3b).
27358 International Journal of Current Research, Vol. 08, Issue, 03, pp. 27356-27360, March, 2016

Table 1. Average and Standard Deviation of the relative errors obtained by RK4, ABM, and MABM methods by using
the problems = − , ( ) = and ′ = , ( ) = .

Problems

= − , (0) = 1 y−x
y = , y(0) = 4
y+x
Method Average Standard Deviation Average Standard Deviation
RK4 0.36658343 0.188061591 0.10783153063 0.060281657417
ABM 0.36658344 0.188061593 0.10783153067 0.060281657400
MABM 0.36398505 0.186498033 0.07530830050 0.035248994175

(a) (b)
Figure 1. The comparison of computation times of RK4, ABM, and MABM methods for the problems
(a) = − , ( ) = and (b) = − / , ( ) =

(a) (b)
Figure 2. Comparison of accuracies of the RK4, ABM, MABM methods by using the problems
(a) = − , ( ) = and (b) ′ = , ( ) =

(a) (b)
Figure 3. Comparison of accuracies of RK4, ABM, MABM methods by using the problem
= , ( ) = on the intervals (a) [0, 1] and (b) [0, 10]
27359 Solomon Gebregiorgis and Genanew Gofe. The comparison of runge-kutta and Adams-Bashforh-Moulton methods for the first order ordinary
differential equations

Figure 4. Plot of a stiff solution of ′ = , ( ) =

(a) (b) (c)


Figure 5. (a) Oscillations in the computed solution by using RK4; (b) Oscillations in the computed solution by using ABM;
(c) Oscillations in the computed solution by using MABM

Table 2. Average and Standard Deviation of the relative errors The number of iterations of the corrector is highly dependent
obtained by RK4, ABM, and MABM methods by using the on the accuracy of the initial prediction. Consequently, if the
problem = , ( ) = prediction is modified properly, we might reduce the number
Method Average Standard Deviation
of iterations required to converge on the ultimate value of the
RK4 1.0944e-09 5.04652e-10 corrector (Chapra and Canale, 1989). Stiffness is a special
ABM 9.93391e-10 6.96787e-10 problem that can arise in the solution of ordinary differential
MABM 0.00242 0.00118 equations. A stiff system is one involving rapidly changing
components together with slowly changing ones (Chapra and
RK4 method has the same accuracy as the ABM method up to Canale, 1989). In many cases, the rapidly varying components
twelve decimal places but ABM method has a better accuracy are ephemeral transients that die away quickly, after which the
for the problem y ′ = 1 − , y(0) = 1. More over solution becomes dominated by the slowly varying
components. Although the transient phenomena exist for only
MABM method has the least accuracy. a short part of the integration interval, they can dictate the time
step for the entire solution. The problem y′ = ycosx,
DISCUSSION y(0) = 1 is a stiff differential equation as can be illustrated
by the graph of its solution which showed a fast transient from
Using the combination of a predictor and corrector requires y = 0 to 1 that occurs in less than 0.001166 time unit. This
only two function evaluations of f(x, y) per step and hence transient is perceptible only when the response is viewed on
unnecessary and time-consuming calculations are eliminated the finer timescale in the inset (Fig.4). Stiffness causes
(Mathews. et al., 2004). The ABM method registers the instability in uniform interval methods like RK4 unless many
smallest computation time than RK4 and MABM methods. very small intervals are used. Stiff equations are problems for
MABM method is slower than ABM method due to the which explicit methods don’t work (Hairer and Wanner as
addition of modifier formulas on the predictor and corrector cited in Higham and Trefethen, 1993). The high instability
parts but MABM is still faster than the RK4 method. resulted due to the stiff nature of the given differential equation
27360 International Journal of Current Research, Vol. 08, Issue, 03, pp. 27356-27360, March, 2016

can also be clearly seen by increasing the interval from [0, 1] Butcher, J.C. 1999. Numerical methods for ordinary
to [0, 10] and sketching the approximated solutions by RK4, differential equations in the 20th century. Journal of
ABM, MABM methods (Fig.5). So it is not possible to Computational and Applied Mathematics 125:1-29
compare the accuracies of the three methods as their Chapra, S. C. and Canale, R. P. (2010. Numerical Methods for
approximated solutions manifest oscillations. Even though the Engineers, 6th ed. McGraw-Hill Co., Inc., New York,
addition of the modifiers increases both the efficiency and pp.751-777
accuracy of multistep methods, there are situations where the Clement, A., Amy, Clement, G., Greg, F., Jeff, F., and Jayson,
corrector modifier will affect the stability of the corrector L. 2008. Comparing Numerical Integration Methods. SIAM
iteration process (Chapra and Canale, 2010). The problem of 2:1–9.
determining when a method is stable is more complicated in Faires, J.D. and Burden, R.L. 2002. Numerical Methods, 3rd ed.
the case of multistep methods, due to the interplay of previous Brooks Cole, pp. 277-280.
approximations at each step (Faires and Burden, 2002). It is Gerardus, P. 2013. Comparing Accuracy of Differential
due to these reasons that the use of modifiers in the ABM Equation Results between Runge-Kutta-Fehlberg and
method decreases its accuracy for the problem y = Adams-Moulton Methods. Applied Mathematical Sciences
1− , y(0) = 1. But for the problems = − with 7: 116-127
Hornberger, G.M. and Wiberg, P.L. 2005. Numerical Methods
(0) = 1 , ′ = − /2 with ( ) = 1 and y = in the Hydrological Sciences. Johns Hopkins Press,
with y(0) = 4, the modifiers are effective as they improve the Baltimore, pp.302.
accuracy of ABM method to be better in accuracy than RK4 Hull, T.E., Enright, W.H., Fellen, B.M. and Sedgwick, A.E.
which was previously inferior to it. The comparisons of (1972. Comparing numerical methods for ordinary
accuracies for the problems = − , (0) = 1 and y ′ = differential equations. SIAM J. NumeR. AnaL. 9: 603-637.
, y(0) = 4, and ′ = − /2, ( ) = 1 reveal an Jain, M.K., Iyengar, S.R.K., and Jain, R.K. 1984. Numerical
Methods for Scientific and Engineering Computation. New
interesting fact that, although the ABM method, even without Age International (P) Limited Publishers, New Delhi,
modifiers, are theoretically expected to have better accuracy pp.471-539
than the RK4 method, they turn out to work better than RK4 Jorba, A. and Zou, M. 2004. A software package for the
only with modifiers. Of course, it is not always the case. numerical integration of ODEs by means of high-order
Taylor methods. ACM Trans. Math. Software 8:114-144
Acknowledgements Mathews, J.H., Kurtis D. 2004. Numerical Methods Using
MATLAB, 4th ed. Pearson Education, Inc, pp.450-455.
The authors would like to thank the College of Natural Muhammad, A. And Arshad, H. (2013. Comparing Numerical
Sciences, Jimma University for funding this research work. Methods for Multi-component Gas Separation by Single
Permeation Unit. Chiang Mai J. Sci. 41: 184-199.
REFERENCES Volino, P. and Magnenat-Thalmann, N . 2000. Comparing
Efficiency of Integration Methods for Cloth Simulation.
Abdul , S.S., Gurudeo, A.T., and Muhammad, M.S. 2013. A VSMM 5: 109-118.
Comparison of Numerical Methods for Solving the Yang, W.Y., Cao, W., Chung, T. and Morris, J. 2005. Applied
Unforced Van Der Pol’s Equation. ISSN. 3(2):66 Numerical Methods Using MATLAB. John Wiley & Sons,
Atkinson, K. E. 1978. An Introduction to Numerical Analysis, Inc., Hoboken, New Jersey, pp.274-277
2nd ed. John Wiley & Sons, Inc, pp. 325-355. Yatim, S. A., Ibrahim, Z. B., Othman, K. I., and. Suleiman, M.
Bedet, R. A., Enright, W. H., and Hall, T. E. 1975. STIFF B. 2011. A Numerical Algorithm for Solving Stiff Ordinary
DETEST: A program for comparing numerical methods Differential Equations. ISSN 3(2):55
for stiff ordinary differential equations. Computing
Surveys 17(1): 25-48

*******

You might also like