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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
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 Simpsons 1/3 rule (1- x ) 1/2 [1+(1- x )*(1- x )] d x MATLAB Integration Methods q = quad(func,a,b) * Adaptive Simpsons 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 Simpsons 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

Page1 / 22

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online