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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Mathcad Prime is Laggy

JW_10233024
10-Marble

Mathcad Prime is Laggy

Hello all, I believe I am suffering from a similar problem to a previous post;

 

Solved: Mathcad Prime worksheet Running Slow Compared to M... - PTC Community

 

I have a legacy calculation converted from Mathcad 15 that is mathematically very simple but approximately 170 pages long and as you will see from the attached is butchering my cpu.  The aforementioned Prime calculation is consequently running painfully laggy and occasionally crashing. 

 

Mathcad Prime 8.png

Does anyone have any recommendations on a sensible procedure for processing such conversions that goes beyond the standard PTC Mathcad Migration guide?

 

For example, is it advantageous to break the calculation up into areas and disable them etc...

 

@VladimirN , @terryhendicott 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

 

Well done to get the size down.  By sections I mean insert the "point###:=time(0)" and "step[0:= etc.." by page 170 steps, or two pages at a time 85 steps,  or reasonable calculation steps.  Keep the file as one item.

 

This way a plot of timing in each step can show where to concentrate some effort in speeding up worksheet..

 

Capture.JPG

Cheers

Terry

View solution in original post

8 REPLIES 8

Hi,

If it is possible can the file be uploaded for review?

Cheers

Terry

Hello Terry, thanks for the quick response.

 

I am unable to upload it for privacy reasons. 

Hi,

Understand the need for privacy.

Can only give general guidance.

 

If you are doing the same thing over and over try and vectorize it or use matrix arithmetic.

For instance the top truth table in matrix comparisons would be faster than the if statement.

Capture2.JPG

 

Matrices - define the last element first as this avoids Prime resizing it. 

Avoid for loops and use indices instead of programming.

For example large matrix first and indexing using range variables instead of for loops in programming.

The Prime below is complex and fast.

Capture.JPG

 

Memory management is smaller if you use programming for intermediate matrix and variable calculations as the local variables inside the function are deleted after program is run.

 

Cheers

Terry

Thanks Terry that's great - I suspected a solution would involve matrices.

 

There's over 150 inputs, I'm tempted to shove them all in a column matrix for manipulation. Would this run faster because it is a single object?

 

Thanks,

Jw.

Hi,

Because the 150 inputs are unlikely to involve the same processing one matrix is unlikely to do the job faster.

 

Would you consent to providing the worksheet to me via email so discussion of it is not public?  I will not use or divulge the contents and can return it by email.

 

Cheers

Terry

Hi,

170 pages can be broken into sections and put timing marks to determine where the slow bits are and concentrate on speeding up them.

Capture.JPG

Cheers

Terry

Good morning Terry,

 

I managed to reduce the load on the cpu from 4.5GB to 2.5GB so it's working quicker.

 

By "sections", do you mean areas/regions or to break up the calculation into separate sheets and reference them? As I understand it there's no sub-routine functionality in Prime and also no Ebook functionality, like MC 15, for creating tables of contents.

 

Thank you so much again for the help!

John.

Hi,

 

Well done to get the size down.  By sections I mean insert the "point###:=time(0)" and "step[0:= etc.." by page 170 steps, or two pages at a time 85 steps,  or reasonable calculation steps.  Keep the file as one item.

 

This way a plot of timing in each step can show where to concentrate some effort in speeding up worksheet..

 

Capture.JPG

Cheers

Terry

Top Tags