Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 26th, 2007, 4:50 AM   #1
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Error calculation in definite integral approximation

The error when using a rule for approximating a definite integral is given by the following equations:



I have no idea how these were derived, but these were the equations given to us. We were told that we'd learn how they were derived in a numerical analysis class. This is all fine and good, but I'm not sure exactly how I'm supposed to pick the x value to calculate the coefficient k to find the largest error that there can be. The book offers a very convoluted explanation of this, and it almost seems to arbitrarily pick an x for the calculation of k at one of the limits of integration. This seems to make sense, but I'm not sure exactly how it picks whether to use the a value as x or the b value. If anyone could explain this to me, or link me to a site which has a decent explanation of this, I would greatly appreciate it.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Feb 26th, 2007, 7:46 AM   #2
pegasus001
Hobbyist Programmer
 
pegasus001's Avatar
 
Join Date: Nov 2006
Location: 163H
Posts: 215
Rep Power: 3 pegasus001 is on a distinguished road
If i recall good you dont take arbitrary x-es. Your function is given in a table like
  x | 0.2 |0.3| 0.4 |
 -------------------
  y | 0.356 etc

So you can find the midpoint easily. I`ll open a bit the book of my numerical analisys for you.
__________________
You never test the depth of a river with both feet.
The believer is happy. The doubter is wise.
Free speech carries with it some freedom to listen.
The next generation will always surpass the previous one. It`s one of the never ending cycles of life.
pegasus001 is offline   Reply With Quote
Old Feb 26th, 2007, 10:59 AM   #3
Rashakil
Newbie
 
Join Date: Dec 2006
Posts: 5
Rep Power: 0 Rashakil is on a distinguished road
That coefficient should be the maximum absolute value of the given derivative on the interval [a,b].

What the book is saying is that there is some value of x where the error uses _exactly_ that value f''(x) (or f''''(x), depending on the formula). But you can't really find that x, unless you can integrate exactly and do some unnecessary magic; the important thing is that it's less than the max-norm of the function f'' (or f'''') on the interval [a,b]. So if you use the maximum possible |f''(x)| or |f''''(x)|, you'll be overestimating the error, which is a good thing (since underestimating the error is a bad thing).
Rashakil is offline   Reply With Quote
Old Feb 27th, 2007, 6:18 AM   #4
pegasus001
Hobbyist Programmer
 
pegasus001's Avatar
 
Join Date: Nov 2006
Location: 163H
Posts: 215
Rep Power: 3 pegasus001 is on a distinguished road
So these errors can be applied only when you dont have a polinomial function ie of the type y = ax^n + ..... Because when you have the function in that way there is no need to find the error couse there is no error. So when you are given the function in a table manner than you use the lagrange formula or the newton formula to find a polinomial function by using the finite differences. Example :
Quote:
f^4(x) = [finite differences of the 4 term]/(h^4) where h - is the pass.
From my previous example h = 0.3 - 0.2 = 0.1 and f^4(x) is the derivate of the 4 term.
So ask your teacher for the function and then apply these things.

Good luck.
__________________
You never test the depth of a river with both feet.
The believer is happy. The doubter is wise.
Free speech carries with it some freedom to listen.
The next generation will always surpass the previous one. It`s one of the never ending cycles of life.
pegasus001 is offline   Reply With Quote
Old Feb 27th, 2007, 2:05 PM   #5
Rashakil
Newbie
 
Join Date: Dec 2006
Posts: 5
Rep Power: 0 Rashakil is on a distinguished road
No, polynomial functions will have errors too when approximating their integrals...
Rashakil is offline   Reply With Quote
Old Feb 27th, 2007, 2:08 PM   #6
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 437
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
K basically represents the maximum y value of the function on the interval [a, b] of the particular derivative. In the midpoint and trapezoidal K would be the maximum value of the second derivative on that interval. In Simpson's rule it would be the maximum value of the fourth derivative in that interval. So basically you use the stuff you learned from taking the derivative and analyzing the graph of an equation to determine the maxima of a function on a given interval. Here's a small example:
f(x) = 1/x    a = 1    b = 2
f'(x) = -1 / x^2
f''(x) = 2 / x^3
We can deduce without any fancy calculus analysis that the largest value the second derivative will have on that interval occurs at x = 1. This is because any x larger than 1 will produce a y value smaller than the one which occurs at x = 1 (you can check this with a table of values or by doing the necessary maxima calculations). Therefore, K = |f''(1)| = 2

Now if you were given a number of subdivisions you could easily find the error for both the trapezoid and midpoint approximations. Hope that helps.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Feb 28th, 2007, 6:25 AM   #7
pegasus001
Hobbyist Programmer
 
pegasus001's Avatar
 
Join Date: Nov 2006
Location: 163H
Posts: 215
Rep Power: 3 pegasus001 is on a distinguished road
Quote:
Originally Posted by Rashakil View Post
No, polynomial functions will have errors too when approximating their integrals...
What does these formulas do exactly?
__________________
You never test the depth of a river with both feet.
The believer is happy. The doubter is wise.
Free speech carries with it some freedom to listen.
The next generation will always surpass the previous one. It`s one of the never ending cycles of life.
pegasus001 is offline   Reply With Quote
Old Feb 28th, 2007, 10:22 AM   #8
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Thanks guys, that helped a lot!
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC