{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw3 - i number of data points used ii step size iii value...

This preview shows page 1. Sign up to view the full content.

ENGR 6101: C OMPUTATIONAL E NGINEERING Problem Set 3 (due Monday in my mailbox by 4pm, 09/20) Questions: 1. Compute the integral Z π / 2 0 sin ( x ) dx = 1 in the following ways: (a) (1 pts.) Using Trapezoid rule with two data points ( x = 0 , π 2 ). (b) (1 pts.) Using Trapezoid rule with three data points ( x = 0 , π 4 , π 2 ). (c) (1 pts.) Using Richardson’s extrapolation (Romberg integration) with the results in (a) and (b). (d) (1 pts.) Using Simpson’s rule with 3 data points ( x = 0 , π 4 , π 2 ) (e) (1 pts.) Using Gaussian quadrature with two data points. (f) (1 pts.) Using Gaussian quadrature with three data points. (g) (2 pts.) Write down the exact error (not relative, not approximate) for all of the above. Based on your results, sort the methods according to their accuracy. (h) (2 pts.) Prove that for the following integral Z π / 2 0 f ( x ) dx (c) and (d) will always give the exact same result for any function f ( x ) . 2. Consider the following integral Z 4 0 e x dx (a) (3 pts.) Implement Simpson’s method using Matlab to solve this integral. Your code should print
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ( i ) number of data points used, ( ii ) step size, ( iii ) value of the integral, and ( iv ) exact error 1 . Print your code and include it in your solution. Name your code as simpson.m and submit soft copy as an e-mail attachment to [email protected] (b) (3 pts.) Find the order of Simpson’s method by running your code using various step-sizes. Include the output of your runs, and show clearly the operations you did to estimate the order. 3. (3 pts.) Find the quadrature formula Z 1-1 f ( x ) dx ≈ c 2 ∑ i = f ( x i ) that is exact for all quadratic polynomials. 4. (3 pts.) Find A , B and C so that the numerical integration rule of the form Z 1-1 xf ( x ) dx ≈ Af (-1 ) + Bf ( ) + C f ( 1 ) is exact for all f ( x ) polynomials of maximum degree m . What is m ? 1 Compute the error using the exact value of the integral. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online