Seite - 245 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Bild der Seite - 245 -
Text der Seite - 245 -
8.4 Oscillating1DSystems:ASecondOrderODE 245
Fig. 8.21 Adjusted method: first three periods (left) and period 36–40 (right)
Fig. 8.22 Illustration of a backward difference approximation to the derivative
We interpret (8.51) as the differential equation sampled at mesh point tn, because
wehavevn ontheright-handside.The left-handside is thena forwarddifferenceor
Forward Euler approximation to the derivativeu′, see Fig. 8.4. On the other hand,
weinterpret (8.52)as thedifferentialequationsampledatmeshpoint tn+1, sincewe
haveun+1 on the right-handside. In this case, the difference approximationon the
left-handside is abackwarddifference,
v′(tn+1)≈ v n+1 −vn
Δt or v′(tn)≈ v n−vn−1
Δt .
Figure8.22illustrates thebackwarddifference.Theerrorin thebackwarddifference
isproportionaltoΔt, thesameasfor the forwarddifference(but theproportionality
constant in the error term has different sign). The resulting discretization method,
seenin(8.52), isoftenreferredtoasaBackwardEulerscheme(afirst-orderscheme,
just like ForwardEuler).
To summarize, using a forward difference for the first equation and a backward
difference for the second equation results in a much better method than just using
forwarddifferences inbothequations.
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