This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Numerical Analysis in Engineering ME 140A, Fall 2007 Homework #2 Solution By: Mohamad NasrAzadani mmnasr@engr.ucsb.edu October 18, 2007 Problem 1 (18.2) a) The given integral can be solved analytically as following: I = Z 8 ( . 0547 x 4 + 0 . 8646 x 3 4 . 1562 x 2 + 6 . 2917 x + 2 ) dx (1) = . 0547 5 x 5 + . 8646 4 x 4 4 . 1562 3 x 3 + 6 . 2917 2 x 2 + 2 x 8 I = 34 . 87808 b) Recall equation (18.8) to find I j,k for Romberg integration: I j,k = 4 k 1 I j +1 ,k 1 I j,k 1 4 k 1 1 (2) Here, I j +1 ,k 1 and I j,k 1 are more and less accurate integrals obtained at the previous stage. Note that for k = 1, the values of I j,k are obtained using trape zoidal rule. Hence, Romberg integration which results in more accurate integrals should always be started for k 2. See the attached codes for my romberg.m and my trap.m which implements the Romberg and Trapezoidal integration methods, respectively. One, can find the otained Romberg data in Table 1. The following MATLAB commands call the my romberg to find the integral with the desired accuracy of 0 . 5%. j/k k=1 O ( h 2 ) k=2 O ( h 4 ) k=3 O ( h 6 ) k=4 O ( h 8 ) j = 1 (n=1) 27.8432 19.9413 34.8781 34.8781 j = 2 (n=2) 21.9168 33.9445 34.8781 N/A j = 3 (n=4) 30.9376 34.8197 N/A N/A j = 4 (n=8) 33.8492 N/A N/A N/A Table 1: Obtained results for I ( j, k ) using Romberg Integration. f = @( x ) . 0547 * x. 4 + 0 . 8646 * x. 3 4 . 1562 * x. 2 + 6 . 2917 * x + 2 I = my romberg ( f, , 8 , . 5 , 100) 1 I = 34 . 8781 c) Using 3point Gauss quadrature method, one can estimate the integral as...
View Full
Document
 Fall '08
 Meiburg

Click to edit the document details