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

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

Bild der Seite - 132 -

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

Text der Seite - 132 -

132 6 ComputingIntegralsandTestingCode Calculatingan integral is traditionallydoneby ∫ b a f(x)dx=F(b)−F(a), (6.1) where f(x)= dF dx . The major problem with this procedure is that we need to find an anti-derivative F(x) corresponding to a givenf(x). For some relatively simple integrandsf(x), findingF(x) isadoabletask.Often,however,it isreallychallenging,andsometimes even impossible! Themethod(6.1)providesanexactoranalyticalvalueof theintegral. Ifwerelax the requirement of computing an exact value for the integral, and instead look for approximate values, produced by numerical methods, integration becomes a very straightforward task for almost any given f(x)! In particular, we do not need an anti-derivativeF(x) at all, since it is just the known integrandf(x) that enters the calculations. The (apparent) downside of a numerical method is that it can only find an approximate answer. Leaving the exact for the approximate is a mental barrier in the beginning, but remember that most real applications of integration will involve anf(x) function that containsphysicalparameters,whichare measuredwith some error. That is, f(x) is very seldom exact, and it does not make sense trying to compute the integralwitha smaller error than theonealreadypresent inf(x). Another advantage of numerical methods is that we can easily integrate a functionf(x) that is only known as samples, i.e., discrete valuesat somex points, and not as a continuous function ofx expressed through a formula. This is highly relevantwhenf is measured inaphysical experiment. 6.1 BasicIdeasofNumerical Integration We consider the integral ∫ b a f(x)dx. (6.2) Most numerical methods for computing this integral split up the original integral into a sum of several integrals, each covering a smaller part of the original integration interval [a,b]. This re-writing of the integral is based on a selection of integration points xi, i = 0,1,.. .,n that are distributed on the interval [a,b]. Integration points may, or may not, be evenly distributed. An even distribution simplifies expressions and is often sufficient, so we will mostly restrict ourselves to thatchoice.The integrationpointsare thencomputedas xi =a+ ih, i=0,1,.. .,n, (6.3)
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