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

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

Bild der Seite - 136 -

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

Text der Seite - 136 -

136 6 ComputingIntegralsandTestingCode on the righthandside witha single trapezoid. Indetail, ∫ b a f(x)dx= ∫ x1 x0 f(x)dx+ ∫ x2 x1 f(x)dx+ . . .+ ∫ xn xn−1 f(x)dx, ≈hf(x0)+f(x1) 2 +hf(x1)+f(x2) 2 + . . .+ h f(xn−1)+f(xn) 2 (6.15) Bysimplifying the righthandsideof (6.15)weget ∫ b a f(x)dx≈ h 2 [f(x0)+2f(x1)+2f(x2)+ . . .+2f(xn−1)+f(xn)] (6.16) which ismorecompactlywrittenas ∫ b a f(x)dx≈h [ 1 2 f(x0)+ n−1∑ i=1 f(xi)+ 1 2 f(xn) ] . (6.17) CompositeIntegrationRules The word composite is often used when a numerical integration method is appliedwith more than one sub-interval.Strictly speaking then, writing, e.g., “the trapezoidal method”, should imply the use of only a single trapezoid, while “the composite trapezoidal method” is the most correct name when several trapezoids are used. However, this naming convention is not always followed, so saying just “the trapezoidal method” may point to a single trapezoidaswell as thecomposite rulewithmanytrapezoids. 6.2.2 AGeneral Implementation Specific or General Implementation? Suppose we want to compute the specific integral ∫1 0 v(t)dt, wherev(t)= 3t2et 3 , using the (composite) trapezoidal method in (6.17). Although simple in principle, the practical steps are often confusing to many, because the notation in the abstract formulation in (6.17) differs from the notation in our special problem. Clearly, thef ,x, andh in (6.17) correspond tov, t, andperhapsΔt for the trapezoidwidth inourspecial problem.
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