Seite - 209 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Bild der Seite - 209 -
Text der Seite - 209 -
8.1 FillingaWaterTank:TwoCases 209
Fig. 8.2 Water volume in a tank as it develops with constantly increasing rate of volume change
(r=V).Thenumerical computationsuse piecewise constant ratesasanapproximation to the true
rate
The similar code structures used for Case 1 and Case 2 suggests that a more
general (and improved)codemaybewritten, applicable tobothcases. Aswe move
onwith ournextexample,populationgrowth,wewill see howthiscanbedone.
8.1.3 ReformulatingtheProblemsasODEs
Typically, the problems we solved in Case 1 and Case 2, would rather have been
presented in “morepropermathematical language”asODEs.
Case 1 When the rates were piecewise constant, we could have been requested to
solve
V ′(t)=1Ls−1, 0s<t<1s,
V ′(t)=3Ls−1, 1s≤ t <2s,
V ′(t)=7Ls−1, 2s≤ t≤3s,
with
V(0)=1L,
whereV(0) isknownasan initial condition.
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