Numerical Analysis/Method - Numerical Integration

bombers

New member
Joined
Sep 6, 2010
Messages
9
Evaluate the following integration: I(f) = integral sign from 0 to 20 of e^(-x) dx

1. Analytically
2. Rectangle method with h= 10,5,4,2,1.
3. Mid-point method with h= 10,5,4,2,1.
4. Trapezoidal method with h= 10,5,4,2,1.
5. Simpson's method with h= 10,5,4,2,1.
6. Using analytical and numerical solutions of 2) to 5) to calculate error e = | I(f) - I(f) | [absolute value of (analytical - numerical)]


I got 1. to be 0.99999999...can't figure out how to start or do the others.

Much appreciated.
 
bombers said:
Evaluate the following integration: I(f) = integral sign from 0 to 20 of e^(-x) dx

1. Analytically
2. Rectangle method with h= 10,5,4,2,1.
3. Mid-point method with h= 10,5,4,2,1.
4. Trapezoidal method with h= 10,5,4,2,1.
5. Simpson's method with h= 10,5,4,2,1.
6. Using analytical and numerical solutions of 2) to 5) to calculate error e = | I(f) - I(f) | [absolute value of (analytical - numerical)]


I got 1. to be 0.99999999...can't figure out how to start or do the others.

Much appreciated.

Do you know what those methods are?
 
I know the h's are given and you have to find n of the equation h = (b-a)/n
But i don't know what to do next as far as applying it for each method. :?: :?:

Edit: and I'm guessing the h's are the number of iterations?
 
You need to study your textbook (or google those).

No - h is not the number of iterations - there is no iteration involved here.

For method of rectangles - you divide up the given domain (0 ? 20) into the given length(h). So when h = 10, you divide up the domain from 0 to 10 and 10 to 20. Thus you divide up the given area into two (2) rectangles whose bases are of length 10.

If you look at Wiki - it will tell you -

"Specifically, the interval (a,b) over which the function is to be integrated is divided into n equal subintervals of length ? = (b ? a) / n. The rectangles are then drawn so that either their left or right corners, or the middle of their top line lies on the graph of the function, with bases running along the x-axis. The approximation to the integral is then calculated by adding up the areas (base multiplied by height) of the n rectangles,...."

Do a google search - or read your text-book - don't guess.

Tell us what should be the next step.
 
For h=10, you divide the area into (0,10) and (10,20) as you mentioned then find the area of each interval and add them up to get the approximation?

Then I(f) = f(x1)(10) + f(x2)(10) ?
 
bombers said:
Evaluate the following integration: I(f)=\int_{0}^{20}e^{-x}dx[/tex]

5. Simpson's method with h=2

I am going to try and Soroban-ize by post. :)

h is the width of each subinterval. Since we are integrating from 0 to 20, we will need 10 subintervals.....because (20-0)/2=10.

Simpsons rule involves parabolas.

\(\displaystyle \int_{a}^{b}f(x)dx=\left(\frac{b-a}{3n}\right)\left[y_{0}+4y_{1}+2y_{2}+4y_{3}+2y_{4}+\cdot \cdot \cdot +2_{y_{n-2}}+4_{y_{n-1}}+y_{n}\right]\)

Using 10 subdivisions,: \(\displaystyle \frac{20-0}{3(10)}=\frac{2}{3}\)

\(\displaystyle \begin{array}{ccccc} \;\ & \text{endpoint}& \;\ & \text{multplier}& \;\ \\ \text{k}& x_{k}& y_{k}=f(x_{k})=e^{-x_{k}}& w_{k}& w_{k}y_{k}\\ \hline 0&0&1.000000000&1&1.000000000\\ 1& 2&.135335283&4&.541341133\\ 2&4&.018315639&2&0.036631278\\3&6&.002478752&4&.0099150087\\4&8&.000335462&2&.000670925\\5&10&.0000453999&4&.000181599\\6&12&.000006144&2&.000012288\\7&14&.000000832&4&.00000333\\8&16&.000000113&2&.000000225\\9&18&.000000015&4&.000000061\\10&20&.000000002&1&.000000002\\ \hline \;\ & \;\ & \;\ & \;\ & 1.58875584\end{array}\)

\(\displaystyle \int_{0}^{20}e^{-x}dx \quad = \quad (\frac{2}{3})(1.58875584)\quad =\quad \boxed{1.05917056}\)
 
Thanks for the help. I guess you can do the same for the other h's; h=10,5,4,1 since you already did 2?

so for h=10, subintervals will be (20-0)/10 =2
h=5, sub int will be (20-0)/5 = 4
h= 1, sub int will be (20-0)/1 = 20

Then the subdivisions will be : (20-0)/(3*2) = 10/3. (20-0)/(3*4) = 5/3. (20-0)/(3*20) = 1/3

Then k for each will be:
1,2
1,2,3,4
1,2,3,4,5,...,20.

Then add up each w(k)y(k) and multiply it to 10/3, 5/3, 1/3 for the result?

Thanks!
 
Top