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

Seite - 56 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Bild der Seite - 56 -

Bild der Seite - 56 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python

Text der Seite - 56 -

56 3 Computing Integrals Themajor problemwith this procedure is thatwe need to find the anti-derivative F.x/ corresponding to agivenf.x/. For some relatively simple integrandsf.x/, findingF.x/ is a doable task, but it can very quickly become challenging, even impossible! Themethod (3.1) provides an exact or analytical value of the integral. If we relax the requirementof the integralbeingexact, and instead look forapproximate values,producedbynumericalmethods, integrationbecomesaverystraightforward task foranygivenf.x/ (!). Thedownsideof anumericalmethod is that it canonlyfindanapproximatean- swer. Leavingtheexactfor theapproximateisamentalbarrier in thebeginning,but remember thatmost real applications of integrationwill involve anf.x/ function that contains physical parameters, which aremeasuredwith some error. That is, f.x/ is veryseldomexact, and then it doesnotmakesense tocompute the integral witha smaller error than theonealreadypresent inf.x/. Another advantageofnumericalmethods is thatwecan easily integrate a func- tion f.x/ that is only known as samples, i.e., discrete values at some x points, andnot as a continuous functionofx expressed througha formula. This is highly relevantwhenf ismeasured inaphysicalexperiment. 3.1 BasicIdeasofNumerical Integration Weconsider the integral bZ a f.x/dx: (3.2) Most numericalmethods for computing this integral split up the original integral into a sum of several integrals, each covering a smaller part of the original inte- gration interval Œa;b . This re-writing of the integral is based on a selection of integration points xi, i D 0;1;:: :;n that are distributed on the interval Œa;b . Integrationpointsmay,ormaynot,beevenlydistributed.Anevendistributionsim- plifiesexpressionsandisoftensufficient, sowewillmostlyrestrictourselves tothat choice. The integrationpoints are thencomputedas xi DaC ih; i D0;1;:: :;n; (3.3) where hD b a n : (3.4) Given the integration points, the original integral is re-written as a sum of inte- grals, each integral beingcomputedover the sub-intervalbetween twoconsecutive integrationpoints. The integral in (3.2) is thusexpressedas bZ a f.x/dxD x1Z x0 f.x/dxC x2Z x1 f.x/dxC : : :C xnZ xn 1 f.x/dx: (3.5) Note thatx0 Da andxn Db.
zurück zum  Buch Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python
Titel
Programming for Computations – Python
Untertitel
A Gentle Introduction to Numerical Simulations with Python
Autoren
Svein Linge
Hans Petter Langtangen
Verlag
Springer Open
Datum
2016
Sprache
englisch
Lizenz
CC BY-NC 4.0
ISBN
978-3-319-32428-9
Abmessungen
17.8 x 25.4 cm
Seiten
248
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