User:EGM6341.s10.Team1.Kumanchik/HW4

=Problem 9-Comparing speed of different algorithms=

Statement
1. Correct previous MATLAB code for efficiency 2. Compare the 2nd column of the Romberg table to the Simpson's rule. 3. Compute $$I=\int_{0}^{1}\frac{e^x-1}{x}dx$$ using the following methods and compare the execution times:


 * Composite trapezoidal rule
 * Composite Simpson's rule
 * Romberg table
 * chebfun sum command
 * MATLAB: trapz and quad commands

Solution
1. The following is the new (efficient) Romberg code:

2. The second column of the Romberg table is displayed below. The Simpson's rule is also shown (code shown below). The two methods are equivalent. The second column of the Romberg table is equal to the Simpson's rule.

3. The function $$I=\int_{0}^{1}\frac{e^x-1}{x}dx$$ is evualted. The computational time is computed in MATLAB using the tic and toc commands. The result is (code shown below):

EGM6341.s10.Team1.Kumanchik 21:54, 7 March 2010 (UTC)

=Problem 10-Determine computational time using various methods (Part 2)=

Statement
Consider the integral $$I=\int_{-5}^{5}\frac{1}{1+x^2}dx$$. Determine the computational time required to solve the integral numerically using,
 * Composite trapezoidal rule
 * Composite Simpson's rule
 * Romberg table
 * chebfun sum command
 * MATLAB: trapz and quad commands

Solution
The results are tabulated below (code also shown):

EGM6341.s10.Team1.Kumanchik 21:59, 7 March 2010 (UTC)