cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Generate a function from a scatterplot

rscott
6-Contributor

Generate a function from a scatterplot

so i have two vectors. 

One is a time stamp 

the second is y axis data. 

 

so for each time stamp there is a corresponding data point

 

I need to plot this scatterplot somehow and then find a line of best fit. 

 

Then i need to take the integral of it. 

I have tried to use the regress function and the interp function without luck. All i get are errors. 

I cant find a good example online. 

The is just a simple 2d plot. Good old X and Y

Can someone help me with an example. 

I dont understand all the parameters that regress and interp are expecting. 

When i try to plot it just gives me an error. i cant post my sheet because of IP

2 REPLIES 2
LucMeekes
23-Emerald III
(To:rscott)

In general: Unless you have a model of the phenomenon that describes the function you want to integrate, there's no better estimate of the total integral than just summing the datapoints you have.

[ You cannot add accuracy that is not present in your data.]

If you do have a model, it makes sense to fit the points to your model and potentially derive model parameters. That will give you a function, which you can integrate.

Please see the discussion here: https://community.ptc.com/t5/PTC-Mathcad/Direct-Integration-Problem-MathCAD/m-p/625854#M187108 .

 

Success!
Luc

xyz123
11-Garnet
(To:rscott)

I had a similar topic and it was solved very well here, have a look:

 

https://community.ptc.com/t5/PTC-Mathcad/Interpolation-between-points-in-Mathcad-Prime-3-0/m-p/711091#M194218

 

Basically a function which interpolates your datapoints was found with "curveexpert professional"

Afterwards the "genfit" function was used.

 

Regards

Top Tags