Accuracy of Numerical Integration Methods

AI Thread Summary
To test the accuracy of a numerical solution for an integral equation, it is recommended to reduce the step size incrementally, comparing results at each stage to check for convergence. This process should continue until the step size is so small that round-off errors begin to affect the outcome. The specific numerical method used is crucial, as each method has a known error term associated with it. By identifying the method, one can derive an expression for the error, typically linked to the first truncated term of a series expansion. To minimize floating point truncation errors, using an extended precision library or employing a summation routine that organizes numbers by exponents can be effective. Additionally, for methods like integration by rectangles, calculating the areas of maximum and minimum rectangles can help determine the error limit.
ninaax
Messages
1
Reaction score
0
Hi,
does anyone know what sort of methods I could use to test the accuracy of the numerical solution of the integral equation?

Many thanks
 
Technology news on Phys.org
That's a pretty general question, since you didn't post the specific integral equation you are trying to solve. Here's a general answer: try reducing the step size by a factor of 10, and compare the two answers. Reduce the step size by another factor of 10, and compare that answer to the first two. Repeat the process, and see if the result converges to some value.

At some point, the step size will be so small that round-off errors will significantly alter the answer. At this point, you can stop the process.
 
We need to know what method you are using. Every common method has a know error term associated with it. Tell me the method and I bet I can come up with an expression for the error. Since most methods are based on the truncation of a series expansion, the error is commonly given as the first truncated term.
 
You could reduce floating point truncation with an extended precision library, like apfloat or you can reduce floating point truncation errors with a summation routine that adds numbers with the same exponents, or otherwise just stores them into an array indexed by the exponent, where a final call is made to sum up all the stored numbers in exponent order to produce a total sum.

Then as mentioned there's the mathematical limit for error. In the case of integration by rectangles, you could sum up the areas of maximum rectangles, then sum up the areas of minimum rectangles, and subtract to find the error limit (within reason).
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top