Skip to main content
1-Visitor
March 8, 2018
Solved

Integrating an Array

  • March 8, 2018
  • 2 replies
  • 4846 views

Hello,

 

Does Mathcad have any function to integrate an array without doing a polyfit? If you see attached, I have a 14 point array and would like to find the area under the curve. What would be the best and cleanest way to accomplish this?

(Note: I had to attach a picture because it wasn't letting me attach a mathcad file for some reason)

Best answer by Fred_Kohlhepp

In addition to polyfit (which does a least squares approximation for the order you specify) there are a host of spline fits that will hit the points exactly.  For your data that is probably a better fit to get an integratable function.  Note that since your function is both positive and negative the "area under the curve" will require careful definition.

 

For a quick and dirty answer linterp will draw straight lines from point to point and can be integrated.

2 replies

23-Emerald I
March 8, 2018

In addition to polyfit (which does a least squares approximation for the order you specify) there are a host of spline fits that will hit the points exactly.  For your data that is probably a better fit to get an integratable function.  Note that since your function is both positive and negative the "area under the curve" will require careful definition.

 

For a quick and dirty answer linterp will draw straight lines from point to point and can be integrated.

23-Emerald I
March 8, 2018
dmayfield1-VisitorAuthor
1-Visitor
March 8, 2018

EXTREMELY helpful. Thank you very much

23-Emerald IV
March 8, 2018
A serious bug in this forum often prevents from attaching a mathcad file. In Windows Explorer click with the right-mouse button on the mathcad file and select 'Send to' -> 'Compressed (zipped) folder'. The resulting .zip file can be attached.  
As you can see, that's what Fred did to attach his file...
Success! Luc