Web-Books
im Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Seite - 212 -
  • Benutzer
  • Version
    • Vollversion
    • Textversion
  • Sprache
    • Deutsch
    • English - Englisch

Seite - 212 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition

Bild der Seite - 212 -

Bild der Seite - 212 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition

Text der Seite - 212 -

212 8 SolvingOrdinaryDifferentialEquations wherek is somearbitrary integer.A computerprogramcaneasily computeN((k+ 1)Δt) foruswith theaidofa little loop. The initial condition Observe that the computational formula cannot be started unless we have an initial condition! The solution ofN′ = rN isN =Cert for any constantC, and the initial condition is needed to fixC so the solution becomes unique. However, from a mathematical point of view, knowing N(t) at any point t is sufficient as initial condition.Numerically,we more literally need an initial condition:we need to know a starting value at the left end of the interval in order to get the computationalformulagoing. In fact, we do not really need a computer in this particular case, since we see a repetitive pattern when doing hand calculations. This leads us to a mathematical formulaforN((k+1)Δt): N((k+1)Δt)=N(kΔt)+ΔtrN(kΔt)=N(kΔt)(1+Δtr) =N((k−1)Δt)(1+Δtr)2 ... =N0(1+Δtr)k+1 . Rather than using (8.2) as a computational model directly, there is a strong traditionforderivinga differentialequationfromthisdifferenceequation.The idea is to consider a very small time interval Δt and look at the instantaneous growth as this time interval is shrunk to an infinitesimally small size. In mathematical terms, it means that we let Δt → 0. As (8.2) stands, letting Δt → 0 will just produce an equation 0 = 0, so we have to divide by Δt and then take the limit: lim Δt→0 N(t+Δt)−N(t) Δt = rN(t). The term on the left-hand side is actually the definition of the derivativeN′(t), so wehave N′(t)= rN(t), which is the correspondingdifferentialequation. There is nothing in our derivation that forces the parameter r to be constant—it canchangewith timedueto,e.g.,seasonalchangesormorepermanentenvironmen- tal changes.
zurück zum  Buch Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition"
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
Web-Books
Bibliothek
Datenschutz
Impressum
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python