I need to come up with a funtion that will smooth a discrete line to approximate a linear line. The end points must remain constant and the volume under the smoothed line must be the same as the volume under the discrete line.
For example:
X 0% 100%
1 10 10
5 25 12.85
10 20 16.42
15 17 20
20 26 23.57
25 37 27.14
30 34 30.71
35 30 34.28
40 32 37.85
45 33 41.42
50 45 45
where 0% is the discrete line and 100% is the linear line (the do not have the same volume).
I've been using trapezoidal integration to find the volumes of the lines and i've tried formulas that relate to the difference between the discrete line and the linear line, both at an individual point and at the surround points, I'm just lost as to how to smooth the line keeping the volume constant.
Also, the x values and discrete points can change and the formula still needs to hold valid. It would be helpful to be able to manipulate the formula to get different smoothing percentages (25%, 50%, etc.).
Thank you for any help!
For example:
X 0% 100%
1 10 10
5 25 12.85
10 20 16.42
15 17 20
20 26 23.57
25 37 27.14
30 34 30.71
35 30 34.28
40 32 37.85
45 33 41.42
50 45 45
where 0% is the discrete line and 100% is the linear line (the do not have the same volume).
I've been using trapezoidal integration to find the volumes of the lines and i've tried formulas that relate to the difference between the discrete line and the linear line, both at an individual point and at the surround points, I'm just lost as to how to smooth the line keeping the volume constant.
Also, the x values and discrete points can change and the formula still needs to hold valid. It would be helpful to be able to manipulate the formula to get different smoothing percentages (25%, 50%, etc.).
Thank you for any help!