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

Cumulative integral from array based data?

JXB
Alexandrite

Cumulative integral from array based data?

I am having trouble with a creating a cumulative result from a simple integral

I have a set of 4 data (vectors) Y1,Y2,Y3,Y4

I take the min(Y1,Y2,Y3,Y4) at each value X

I create an interpolated vector of the min envelope - interpolated data seems to match the “raw” as I plotted it

And I want to calculate the cumulative integral of this min vector between f1 and f

 

For some reason mcad seem to be taking a very long time. Maybe he stuck in a loop

 

I suspect my cumulative integral is not set up correctly – Attached my test sheet

 

Thanks

Regards

 

PS

Found this discussion https://community.ptc.com/t5/PTC-Mathcad-Questions/Integrating-an-Array/m-p/539177#M179014

But the I cannot open the file attached by Fred

4 REPLIES 4

Re: Cumulative integral from array based data?

Please find a PDF copy of this worksheet in attachment.

Re: Cumulative integral from array based data?

The expression you disabled and highlighted in red with the note, "stuck in loop" actually was working, it just was going to take a long time to do 1980 integrations, each one a data point further along.  I rebuilt to do every tenth point, 198 integrations still took several minutes.  See attached.

Re: Cumulative integral from array based data?

Thanks for the correction. I guess I didn't expect to take that long to the integration. I did a 1st pass test with just a few points and it worked so I  thought let's try with "real" data. I ran out of patience and assumed my "loop" was wrong. It took a couple of minutes on a laptop with your correction. I'll have a look at fitting a cspline then do the integration on it. Should be better/faster

Re: Cumulative integral from array based data?

creating a cspline with the desired data and then doing the (cumulative) integration on this cspline is significantly faster. take a few seconds (and it looks correct!)