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 - 215 -
  • User
  • Version
    • full version
    • text only version
  • Language
    • Deutsch - German
    • English

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

Image of the Page - 215 -

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

Text of the Page - 215 -

8.2 PopulationGrowth:AFirstOrderODE 215 is constant.Thisproperty implies that tn=nΔt, n=0,1,.. .,Nt . Second, the differential equation is supposed to hold at the mesh points. Note that this is an approximation,because the differential equation is originallyvalid for all realvaluesof t. We canexpress thispropertymathematicallyas u′(tn)=f(un,tn), n=0,1,.. .,Nt . Forexample,withourmodelequationu′ = ru,we have thespecial case u′(tn)= run, n=0,1,.. .,Nt, or u′(tn)= r(tn)un, n=0,1,.. .,Nt, if r dependsexplicitlyon t. Third, derivatives are to be replaced by finite differences. To this end, we need to know specific formulas for how derivatives can be approximated by finite differences.Onesimplepossibility is touse thedefinitionof thederivativefromany calculusbook, u′(t)= lim Δt→0 u(t+Δt)−u(t) Δt . Atanarbitrarymeshpoint tn thisdefinitioncanbewrittenas u′(tn)= lim Δt→0 un+1 −un Δt . Instead of going to the limit Δt → 0 we can use a small Δt, which yields a computableapproximationtou′(tn): u′(tn)≈ u n+1 −un Δt . This isknownasa forwarddifferencesincewe goforward in time(un+1) tocollect information inu to estimate the derivative.Figure 8.4 illustrates the idea.The error of the forwarddifference isproportional toΔt (oftenwrittenasO(Δt), butwewill notuse thisnotation in thepresentbook). We can now plug in the forward difference in our differential equation sampled at thearbitrarymeshpoint tn: un+1−un Δt =f(un,tn), (8.3)
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