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

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

Bild der Seite - 65 -

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

Text der Seite - 65 -

3.3 TheCompositeMidpointMethod 65 Thepresent integralproblemsresult inshortcode. Inmorechallengingengineer- ingproblems the codequicklygrows tohundredsand thousandsof lines. Without abstractions in termsofgeneral algorithms ingeneral reusable functions, the com- plexityof theprogramgrowsso fast that itwill beextremelydifficult tomakesure that theprogramworksproperly. Another advantage of packagingmathematical algorithms in functions is that a functioncanbe reusedbyanyone to solve aproblemby just calling the function with a proper set of arguments. Understanding the function’s inner details is not necessary to compute a new integral. Similarly, youcanfind libraries of functions on the Internet and use these functions to solve your problems without specific knowledgeofeverymathematicaldetail in the functions. This desirable feature has its downside, of course: the user of a functionmay misuse it, and the functionmaycontainprogrammingerrorsand lead towrongan- swers. Testing theoutputofdownloadedfunctions is thereforeextremely important before relyingon the results. 3.3 TheCompositeMidpointMethod The idea Rather thanapproximating theareaundera curveby trapezoids,wecan use plain rectangles (Fig. 3.3). Itmay sound less accurate to use horizontal lines andnotskewlinesfollowingthefunctiontobeintegrated,butanintegrationmethod basedonrectangles (themidpointmethod) is in fact slightlymoreaccurate than the onebasedon trapezoids! Fig.3.3 Computing approximately the integral of a function as the sumof the areas of the rect- angles
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