1 / 11

AME 150 L

AME 150 L. Numerical Integration. Homework 10. Numerical Integration of sin(x) from 0 to p Trapezoidal Rule I I h =( h /2)( y 0 +2 y 1 +2 y 2 +. . .2 y n -2 +2 y n -1 + y n ) | error T |  h 2 ( b-a ) max | y''( x ) |/12 Simpson's Rule I  h /3( S ends +4 S odds +2 S evens )

Download Presentation

AME 150 L

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AME 150 L Numerical Integration AME 150L

  2. Homework 10 • Numerical Integration of sin(x) from 0 to p • Trapezoidal Rule IIh=(h/2)(y0+2y1+2y2+. . .2yn-2+2yn-1+yn) |errorT|  h2(b-a) max |y''(x)|/12 • Simpson's Rule I h/3(Sends+4Sodds+2Sevens) |errorT|  h4f iv(x)(b-a)/180 AME 150L

  3. 1 0.9 0.8 0.7 0.6 sin ( x ) ( ) p - x 0.5 × × 4 x 2 p 0.4 0.3 0.2 0.1 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3 3.2 0 x AME 150L

  4. AME 150L

  5. Double Precision required AME 150L

  6. Truncation Coefficients AME 150L

  7. Truncation Coefficients AME 150L

  8. Single Precision • Single precision (32-bit) floating-point numbers use 8 bits in the exponent and 23 bits in the fraction, which gives about 7 digit precision and allows storage of numbers whose magnitudes range from roughly 10-38 to about 1038. AME 150L

  9. Double Precision • Double precision (64-bit) floating-point numbers use 11 bits in the exponent and 52 bits in the fraction, which gives about 15 digit precision and allows storage of numbers whose magnitudes range from roughly 10-308 to about 10308. AME 150L

  10. Fortran Double Precision • REAL (Kind=8):: list of variable • Machine dependent (not if use IEEE floating point) • (Kind=4) is normal • Other Kinds • INTEGER has Kind=1, 2, and 4 • Logical has Kind=1, 4 AME 150L

  11. More Double Precision • Specifying Double Precision Constants • lot of decimal digits or"d" in exponent 1.D0 (is double precision 1) or _"kind": 1.0_8 • Functions: • Selected_Real_Kind( p, r ) • Selected_Integer_Kind( r ) • Kind(x) - returns kind for x • Precision(x) - returns precision for x • Range(x) - returns decimal exponent range for x AME 150L

More Related