Seite - 158 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python
Bild der Seite - 158 -
Text der Seite - 158 -
158 4 SolvingOrdinaryDifferentialEquations
c) A centered difference approximation to the derivative, as explored in Exer-
cise4.12, canbewritten
u0.tnC 1
2 t/ u.tnC t/ u.tn/
t :
Write up theTaylor series foru.tn/ around tn C 12 t and theTaylor series for
u.tn C t/ around tn C 12 t. Subtract the two series, solve with respect to
u0.tnC 12 t/, identify thefinitedifferenceapproximationandtheerror termson
the right-handside, andwriteup the leadingorder error term. Howis this term
compared to theones for the forwardandbackwarddifferences?
d) Canyouuse the leadingordererror terms ina)-c) toexplain thevisualobserva-
tions in thenumericalexperiment inExercise4.12?
e) Find the leadingorder error term in the following standardfinite differenceap-
proximation to the second-orderderivative:
u00.tn/ u.tnC t/ 2u.tn/Cu.tn t/
t :
Hint Expressu.tn˙ t/viaTaylorseriesandinsert theminthedifferenceformula.
Filename:Taylor_differences.pdf.
Exercise4.14:UseaBackwardEuler schemeforoscillations
Consider(4.43)–(4.44)modelinganoscillatingengineeringsystem.This2 2ODE
systemcanbesolvedbytheBackwardEulerscheme,whichisbasedondiscretizing
derivativesby collecting informationbackward in time. More specifically,u0.t/ is
approximatedas
u0.t/ u.t/ u.t t/
t :
A general vector ODE u0 D f.u;t/, where u and f are vectors, can use this
approximationas follows:
un un 1
t Df.un;tn/;
which leads toanequation for thenewvalueun:
un tf.un;tn/Dun 1 :
Forageneralf , this is a systemofnonlinearalgebraic equations.
However, theODE(4.43)–(4.44)is linear, soaBackwardEuler schemeleads to
a systemof twoalgebraicequations for twounknowns:
un tvn Dun 1; (4.84)
vnC t!2un Dvn 1 : (4.85)
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python
- Titel
- Programming for Computations – Python
- Untertitel
- A Gentle Introduction to Numerical Simulations with Python
- Autoren
- Svein Linge
- Hans Petter Langtangen
- Verlag
- Springer Open
- Datum
- 2016
- Sprache
- englisch
- Lizenz
- CC BY-NC 4.0
- ISBN
- 978-3-319-32428-9
- Abmessungen
- 17.8 x 25.4 cm
- Seiten
- 248
- Schlagwörter
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Kategorie
- Informatik