Skip to main content
1-Visitor
June 7, 2022
Solved

Mathcad Prime is Laggy

  • June 7, 2022
  • 1 reply
  • 4039 views

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 

Best answer by terryhendicott

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

1 reply

21-Topaz II
June 7, 2022

Hi,

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

Cheers

Terry

1-Visitor
June 7, 2022

Hello Terry, thanks for the quick response.

 

I am unable to upload it for privacy reasons. 

21-Topaz II
June 7, 2022

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