Area Under a Curve Approximation
02-09-2019 21:52 PM - last edited 02-09-2019 21:54 PM
02-09-2019 09:52 PM - edited 02-09-2019 09:54 PM
We can use a little bit of pre-Calculus knowledge to help us approximate (fairly accurately) the area under a curve. This can be useful in all sorts of situations as the area under a curve often has some sort of meaning, such as the amount of work performed, etc.
This Quick Measure presents 6 different lines/curves and the basic technique works for each of them. By using an approximation technique we can compute the area under any curve without having to solve differential equations and the like.
AreaAppoximation = VAR __table = ALL(X) VAR __max = MAXX(__table,[X]) VAR __min = MINX(__table,[X]) VAR __zero = IF(SIGN(__max) > 0 && SIGN(__min) < 0,1,0) VAR __increment = DIVIDE(__max - __min + __zero,COUNTROWS(__table)) VAR __table1 = ADDCOLUMNS(__table,"__area",[Y]*__increment) RETURN SUMX(__table1,[__area])
Essentially, compute an increment based upon the minimum and maximum x-axis values as well as the number of data points. Multiply each Y value by this increment in order to compute the area of a column that corresponds to that data point. Then you just sum up all of the areas of the columns. The more data points you have, the more accurate the calculation. This formula could potentially be combined with the Linear Interpolation Quick Measure to interpolate additional data points and improve accuracy.
Visual representations of the columns created by the measure are shown to provide a better understanding to the viewer.
Did I answer your question? Mark my post as a solution!
Proud to be a Datanaut!