Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Cumulative integral from array based data?

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-22-2018
10:42 AM

03-22-2018
10:42 AM

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

Labels:

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-22-2018
11:56 AM

03-22-2018
11:56 AM

Re: Cumulative integral from array based data?

Please find a PDF copy of this worksheet in attachment.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-22-2018
12:16 PM

03-22-2018
12:16 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-22-2018
01:16 PM

03-22-2018
01:16 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-23-2018
04:44 AM

03-23-2018
04:44 AM

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!)

Top Tags