Web-Books
in the Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Page - 134 -
  • User
  • Version
    • full version
    • text only version
  • Language
    • Deutsch - German
    • English

Page - 134 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Image of the Page - 134 -

Image of the Page - 134 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition

Text of the Page - 134 -

134 6 ComputingIntegralsandTestingCode 6.2 TheCompositeTrapezoidalRule The integral ∫b a f(x)dx may be interpreted as the area between thex axis and the graphy=f(x)of the integrand.Figure6.1illustrates thisareafor thecase in(6.7). Computing the integral ∫1 0 v(t)dt amounts to computing the area of the hatched region. If we replace the true graph in Fig.6.1 by a set of straight line segments, we may view the area rather as composed of trapezoids, the areas of which are easy to compute. This is illustrated in Fig.6.2, where four straight line segments give rise to four trapezoids, covering the time intervals [0,0.2), [0.2,0.6), [0.6,0.8) and [0.8,1.0]. Note that we have taken the opportunity here to demonstrate the computationswith time intervals thatdiffer in size. Theareasof thefour trapezoidsshowninFig.6.2nowconstituteourapproxima- tion to the integral (6.7): ∫ 1 0 v(t)dt β‰ˆh1(v(0)+v(0.2) 2 )+h2(v(0.2)+v(0.6) 2 ) +h3(v(0.6)+v(0.8) 2 )+h4(v(0.8)+v(1.0) 2 ), (6.9) where h1 = (0.2βˆ’0.0), (6.10) h2 = (0.6βˆ’0.2), (6.11) Fig. 6.1 The integral ofv(t) interpreted as the area under the graph ofv
back to the  book Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition"
Programming for Computations – Python A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Title
Programming for Computations – Python
Subtitle
A Gentle Introduction to Numerical Simulations with Python 3.6
Volume
Second Edition
Authors
Svein Linge
Hans Petter Langtangen
Publisher
Springer Open
Date
2020
Language
English
License
CC BY 4.0
ISBN
978-3-319-32428-9
Size
17.8 x 25.4 cm
Pages
356
Keywords
Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
Category
Informatik
Web-Books
Library
Privacy
Imprint
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python