Calculate Area Under Curve: What Function?

  • Thread starter Thread starter henil
  • Start date Start date
  • Tags Tags
    Area Curve
Click For Summary

Discussion Overview

The discussion revolves around the problem of calculating the area under a curve when only discrete x and y data points are available, without a known function. Participants explore various methods for numerical integration and interpolation techniques applicable to the given data.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant expresses uncertainty about how to proceed with calculating the area under the curve without knowing the function f(x).
  • Another participant suggests that if a known function is available, numerical integration could be performed.
  • A participant clarifies that they only have x and y data points, prompting further suggestions on how to interpolate between these points.
  • Several methods for interpolation are proposed, including using stair-step approximations, trapezoidal rules, least-squares fitting, and spline curves.
  • One participant mentions that sorting the data points and applying the trapezoidal rule can provide an approximation for the area between data points.
  • Another participant suggests that if the x values are at regular intervals, Simpson's Rule could be used for potentially greater accuracy.
  • A participant recommends plotting the data to determine which numerical integration method might yield the desired accuracy.

Areas of Agreement / Disagreement

Participants present multiple approaches to the problem, and there is no consensus on a single method. The discussion remains open with various suggestions and techniques proposed.

Contextual Notes

Participants do not specify the nature of the data points or any assumptions regarding their distribution, which may affect the choice of interpolation method.

henil
Messages
18
Reaction score
0
i want to calculate area under the curve but i do no not know what function does it satisfies. how should i proceed ?
 
Technology news on Phys.org
I'm not sure what you are asking about. Do you have a known function f(x) which you want to integrate, and wonder how to do it numerically?
 
no i don't know f(x) i just have x and y datapoints
 
Then you need to decide how to interpolate between the data points. Some possibilities:
  • Use the points to define "stair-steps" (a series of rectangles)
  • Construct straight lines between the points (a series of trapezoids)
  • Do a least-squares fit to a suitable type of function (polynomial, exponential, etc.)
  • Construct a spline curve that passes through all the points exactly.
 
The best you can do is:
  1. Sort the data points in ascending order in the xn
  2. The best approximation for the area between (xj, yj) and (xj+1, yj+1) is given by [itex]A_{j}=(x_{j+1}-x_{j})\cdot\frac{y_{j+1}+y_{j}}{2}[/itex] (this is called the trapezoid rule)
  3. Add up these areas.
 
henil said:
no i don't know f(x) i just have x and y datapoints
If the x values of the data points occur at regular intervals, you can use a numerical integration technique like Simpson's Rule to perform the calculations. Simpson's Rules are based on using second- and third-order interpolation functions, which is usually more accurate than the simpler trapezoidal rule.

You really should plot your data to see which method would give you the accuracy of result you desire.
 
okay i will try all your suggestions.
thank you for your help.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
2
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 17 ·
Replies
17
Views
1K
  • · Replies 10 ·
Replies
10
Views
5K