Lecture 38

# Lecture 38 - I(f = âˆ 1 0.5 1 1.5 2 0.2 0.4 0.6 0.8 1 f...

This preview shows pages 1–5. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: I(f) = âˆ« 1 0.5 1 1.5 2 0.2 0.4 0.6 0.8 1 f 0.05 0.1 0.15 0.2 0.25 0.96 0.97 0.98 0.99 1 x 1 3 3 4 4 5 5 0.5 0.75 .875 .9375 2 Total number of function evaluation: 21 2 Adaptive Simpsonâ€™s 1/3 rule (1- x ) 1/2 [1+(1- x )*(1- x )] d x MATLAB Integration Methods q = quad(func,a,b) * Adaptive Simpsonâ€™s rule more efficient for low accuracies or non-smooth functions q =quadl(func, a,b,tol,trace ) * Labatto quadrature â€“ more efficient for high accuracies and smooth functions >> F = @(x) 1./(x.^2+1); >> Q = quadl(F,0,2) Q = 1.107148717794193 I ex = 1.10714871779409â€¦ 2 2 1 ; 1 I dx x = + âˆ« Mid-point Rule (or Rectangle Rule) Consider a 0th order polynomial for y = f( x ) in [ x , x 1 ] f(x) y x P (x) x x 1 x 1/2 f f 1/2 f 1 f(x) y x P (x) x x 1 x 1/2 f f 1/2 f 1 It is approximated by a constant value y =P ( x ) = f 1/2 = f( x 1/2 ) at x = x 1/2 (mid point between x & x 1 ) The integration is I = h f 1/2-- also known as rectangle rule Truncation error in ONE interval is ~ 3 "( ) 24 h f Î¾ only half of trapezoidal rule (n=1); but of opposite sign Reason: error cancelation--- similar to Simpsonâ€™s 1/3 rule vs 3/8 rule Composite midpoint rules x n =b x 1 x 2 x 3 x n -1 a=x âˆ† x â€¦ x x n =b x 1 x 2 x 3 x n -1 a=x âˆ† x â€¦ x x n =b x 1 x 2 x n -1 a= x h= âˆ† x x 5/2 x 3 x n-1/2 x 1/2 x x n =b x 1 x 2 x n -1 a= x h= âˆ† x x 5/2 x 3 x n-1/2 x 1/2 x I = dx x f b a ) ( âˆ« = h [f( x...
View Full Document

{[ snackBarMessage ]}

### Page1 / 22

Lecture 38 - I(f = âˆ 1 0.5 1 1.5 2 0.2 0.4 0.6 0.8 1 f...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online