Seite - 255 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Bild der Seite - 255 -
Text der Seite - 255 -
8.4 Oscillating1DSystems:ASecondOrderODE 255
Fig. 8.27 The last 10 of 40 periods of oscillationsby the fourth-order Runge-Kutta method
Implementation The stages in the fourth-order Runge-Kutta method can easily
be implemented as a modification of the osc_Heun.py code. Alternatively,
one can use the osc_odespy.py code by just providing the argument
odespy_methods=[odespy.RK4] to thecompare function.
Derivation The derivation of the fourth-order Runge-Kutta method can be pre-
sented in a pedagogical way that brings many fundamental elements of nu-
merical discretization techniques together. It also illustrates many aspects of
the “numerical thinking” required for constructing approximate solution meth-
ods.
We start with integrating thegeneralODEu′ =f(u,t)overa timestep, from tn
to tn+1,
u(tn+1)−u(tn)= tn+1∫
tn f(u(t),t)dt .
Thegoalofthecomputationisu(tn+1) (writtenun+1),whileu(tn) (writtenun) is the
mostrecentlyknownvalueofu.Thechallengewith theintegral is that the integrand
involves the unknownubetween tn and tn+1.
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
- Titel
- Programming for Computations – Python
- Untertitel
- A Gentle Introduction to Numerical Simulations with Python 3.6
- Band
- Second Edition
- Autoren
- Svein Linge
- Hans Petter Langtangen
- Verlag
- Springer Open
- Datum
- 2020
- Sprache
- englisch
- Lizenz
- CC BY 4.0
- ISBN
- 978-3-319-32428-9
- Abmessungen
- 17.8 x 25.4 cm
- Seiten
- 356
- Schlagwörter
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Kategorie
- Informatik