Web-Books
in the Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python
Page - 137 -
  • User
  • Version
    • full version
    • text only version
  • Language
    • Deutsch - German
    • English

Page - 137 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Image of the Page - 137 -

Image of the Page - 137 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Text of the Page - 137 -

4.3 OscillatingOne-DimensionalSystems 137 Fig.4.22 Illustrationof the impact of resolution (timestepsperperiod) and lengthof simulation right). However, after 194–200periods the errors havegrown (lower left), but can besufficiently reducedbyhalving the timestep (lower right). With all themethods inOdespy at hand, it is noweasy to start exploring other methods, such as backward differences instead of the forward differences used in theForwardEuler scheme. Exercise4.17addresses thatproblem. Odespy contains quite sophisticated adaptivemethodswhere the user is β€œguar- anteed” toget a solutionwith prescribedaccuracy. There is nomathematical guar- antee, but the error will for most cases not deviate significantly from the user’s tolerance that reflects the accuracy. A very popular method of this type is the Runge-Kutta-Fehlbergmethod, which runs a 4th-order Runge-Kuttamethod and uses a 5th-orderRunge-Kuttamethod to estimate the error so that t can be ad- justed to keep the error below a tolerance. Thismethod is alsowidely known as ode45, because that is the nameof the function implementing themethod inMat- lab. Wecan easily test theRunge-Kutta-Fehlbergmethod as soon asweknow the correspondingOdespyname,which isRKFehlberg: compare(odespy_methods=[odespy.EulerCromer, odespy.RKFehlberg], omega=2, X_0=2, number_of_periods=200, time_intervals_per_period=40)
back to the  book Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python
Title
Programming for Computations – Python
Subtitle
A Gentle Introduction to Numerical Simulations with Python
Authors
Svein Linge
Hans Petter Langtangen
Publisher
Springer Open
Date
2016
Language
English
License
CC BY-NC 4.0
ISBN
978-3-319-32428-9
Size
17.8 x 25.4 cm
Pages
248
Keywords
Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
Category
Informatik
Web-Books
Library
Privacy
Imprint
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python