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

Page - 278 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Image of the Page - 278 -

Image of the Page - 278 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Text of the Page - 278 -

278 8 SolvingOrdinaryDifferentialEquations a) A forwardfinite differenceapproximationto the derivativef ′(a) reads u′(tn)≈ u(tn+Δt)−u(tn) Δt . We can justify this formula mathematically through Taylor series. Write up the Taylor series for u(tn +Δt) (around t = tn, as given above), and then solve the expression with respect tou′(tn). Identify, on the right-hand side, the finite differenceapproximationandaninfiniteseries.Thisseries is thentheerrorin the finite differenceapproximation. IfΔt is assumed small (i.e.Δt << 1),Δt will be much larger thanΔt2, which will be much larger thanΔt3, and so on. The leading order term in the series for the error, i.e., the error with the least power ofΔt is a goodapproximationof theerror. Identify this term. b) Repeata) fora backwarddifference: u′(tn)≈ u(tn)−u(tn−Δt) Δt . This time,writeuptheTaylorseries foru(tn−Δt)around tn.Solvewith respect to u′(tn), and identify the leading order term in the error. How is the error comparedto the forwarddifference? c) A centered difference approximation to the derivative, as explored in Exer- cise 8.13,canbewritten u′(tn+ 1 2 Δt)≈ u(tn+Δt)−u(tn) Δt . Write up the Taylor series foru(tn) around tn+ 12Δt and the Taylor series for u(tn +Δt) around tn + 12Δt. Subtract the two series, solve with respect to u′(tn + 12Δt), identify the finite difference approximation and the error terms on the right-hand side, and write up the leading order error term. How is this termcomparedto the ones for the forwardandbackwarddifferences? d) Can you use the leading order error terms in a)–c) to explain the visual observations in thenumericalexperiment inExercise8.13? e) Find the leading order error term in the following standard finite difference approximationto the second-orderderivative: u′′(tn)≈ u(tn+Δt)−2u(tn)+u(tn−Δt) Δt2 . Hint Expressu(tn±Δt)viaTaylorseriesandinsert theminthedifferenceformula. Filename:Taylor_differences.pdf.
back to the  book Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Title
Programming for Computations – Python
Subtitle
A Gentle Introduction to Numerical Simulations with Python 3.6
Volume
Second Edition
Authors
Svein Linge
Hans Petter Langtangen
Publisher
Springer Open
Date
2020
Language
English
License
CC BY 4.0
ISBN
978-3-319-32428-9
Size
17.8 x 25.4 cm
Pages
356
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