Numerica integration with unequal intervals

In summary, the conversation discusses methods for computing a numerical integral of a function expressed at unequal intervals. The trapezoidal method was tried but had too much error. The suggestion is made to generalize Simpson's rule by fitting quadratics to sequences of three points and calculating the integral as an estimate. This method is said to give great improvement over the trapezoidal method, but the speaker still feels they need something more. They are asked what they are looking for and how they are determining that the generalized Simpson rule is not good enough. The suggestion is then made to use MATLAB's numerical integration solver ode45. The speaker is unsure of what is meant by the function being expressed at unequal intervals and the properties of the function are discussed as
  • #1
cris
3
0
Hello,

I have to compute the numerical integral of a function which is expressed at unequal (but almost) intervals. I tried the trapezoidal method, but the error is too large for my application. Is it possible to generalize the Boole's rule to or something on the same order of precision?
 
Mathematics news on Phys.org
  • #2
You could try to generalize Simpson's rule. You need to fit quadratics to sequences of three points, with the third point of a sequence being the first point of the next. For each set of three calculate the integral of the quadratic as an estimate of the contribution to the integral.
 
  • #3
Thanks for your reply. The generalized Simpson rule gives great improvement over the trapezoidal.
Though it appears I need something more ...
 
  • #4
cris said:
Thanks for your reply. The generalized Simpson rule gives great improvement over the trapezoidal.
Though it appears I need something more ...
What are you looking for?
 
  • #5
How do you know this is not good enough? What are you measuring against?
 
  • #6
If it's possible, use MATLAB's numerical integration solver ode45 (or its brothers). It allows you to integrate arbitrary functions (the programmatic sense) very accurately, including exotic ones such as discontinuous or chaotic functions.

I don't get what you mean by 'only expressed at certain unequal intervals'. Does this mean you only know a few data points? Or that the value of the expression only changes every interval? Is it smooth? The best method of numerical integration greatly depends on the properties of the function itself.
 

FAQ: Numerica integration with unequal intervals

What is Numerical Integration with Unequal Intervals?

Numerical integration with unequal intervals is a method used to approximate the definite integral of a function over an interval where the subintervals are not evenly spaced. This is often necessary when the function being integrated is complex or does not have a known analytical solution.

How is Numerical Integration with Unequal Intervals different from standard integration?

The main difference is that in numerical integration with unequal intervals, the width of each subinterval is not equal. This allows for a more accurate approximation of the integral, as the function is being evaluated at points that are closer to the areas where the function changes rapidly.

What are the advantages of using Numerical Integration with Unequal Intervals?

One advantage is that it can provide a more accurate approximation of the definite integral compared to standard integration methods, especially for functions with complex or rapidly changing behavior. Additionally, it can be easier to implement for certain types of functions and can save time and effort compared to other methods.

Are there any limitations or drawbacks to using Numerical Integration with Unequal Intervals?

One limitation is that it may not be suitable for all types of functions. For example, if the function being integrated is smooth and does not vary greatly over the interval, standard integration methods may be more efficient. Additionally, the accuracy of the approximation may be affected by the choice of unequal intervals, so careful consideration must be taken when selecting the subintervals.

How do I choose the appropriate method for Numerical Integration with Unequal Intervals?

The choice of method will depend on the specific function being integrated and the desired level of accuracy. Some common methods include the trapezoidal rule, Simpson's rule, and Gaussian quadrature. It may be helpful to consult a numerical analysis textbook or consult with a colleague or mentor for guidance in selecting the most appropriate method for your specific problem.

Back
Top