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 - 210 -
  • Benutzer
  • Version
    • Vollversion
    • Textversion
  • Sprache
    • Deutsch
    • English - Englisch

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

Bild der Seite - 210 -

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

Text der Seite - 210 -

210 8 SolvingOrdinaryDifferentialEquations Case2 With acontinuously increasingrate,we couldhavebeenasked tosolve V ′(t)=V(t), V(0)=1L, 0s<t≤3s. ThisparticularODE is verysimilar to the ODE we will addresswhen we next turn topopulationgrowth(in fact, it maybe seenasaspecial caseof the latter). The Forward Euler Method: A Brief Encounter If we had proceeded to solve theseODEsbysomethingcalled theForwardEulermethod (orEuler’smethod),we could(ifwewanted)havewrittenthesolutioncodesexactlyas theyweredeveloped above!Thus, we havealreadyused the essentials ofEuler’smethodwithout stating it. Inthefollowingsections,theForwardEulermethodwillbethoroughlyexplained and elaborated on, while we demonstrate how the approach may be used to solve differentODEsnumerically. 8.2 PopulationGrowth:AFirstOrderODE Our first real taste of differential equations regards modeling the growth of some population,suchasacellculture,ananimalpopulation,orahumanpopulation.The ideasevenextend trivially togrowthofmoneyin abank. LetN(t) be the number of individuals in the population at time t. How can we predict the evolutionofN with time? Below we shall derivea differential equation whosesolution isN(t). Theequationwe will derivereads N′(t)= rN(t), (8.1) where r is a number. Note that althoughN obviously is an integer in real life, we modelN as a real-valued function. We choose to do this, because the solutions of differential equations are (normally continuous) real-valued functions. An integer- valued N(t) in the model would lead to a lot of mathematical difficulties. Also, talking about, e.g., 2.5 individuals is no problem in mathematics, even though we mustbea bit carefulwhenapplyingthis ina practical setting! You may know, or find out, that the solution N(t) = Cert, where C is any number. To make this solution unique, we need to fix C, which is done by prescribing the value ofN at some time, usually at t = 0. IfN(0) is given asN0, wegetN(t)=N0ert. In general, a differential equationmodel consistsof a differential equation, such as(8.1)andan initialcondition,suchasN(0)=N0.Withaknowninitialcondition, thedifferentialequationcanbe solvedfor the unknownfunctionand thesolution is unique. It is very rare that we can find the solution of a differential equation as easy as the ODE in this example allows. Normally, one has to apply certain mathematical methods. Still, these methods can only handle some of the simplest differential equations. However, with numerical methods and a bit of programming, we can
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