Skip to main content
1-Visitor
July 16, 2013
Solved

Calculation time

  • July 16, 2013
  • 4 replies
  • 8157 views

How can I improve the calculation time? Especially for the solve blocks.

Any files that I can read? Tips? The file Improving Mathcad Calculation Speed was recently removed from the site.

Thank you,

Mihai Moraru

Best answer by RichardJ

OK, the second solve block calls a parameterized solve block. It's loop within a loop, and if one pass of the inner loop takes 0.25 seconds then that's going to be slow! If the first solve block has 6 parameters and 11 equations then it is also a minimization problem (as opposed to Find). Can you reformulate the problem to put everything in one solve block? Failing that, the only solution is to speed up the first solve block. Can you say any more about the equations in that solve block?

4 replies

25-Diamond I
July 16, 2013

MihaiMoraru wrote:

How can I improve the calculation time? Especially for the solve blocks.

There is no general answer to this question - it depends on a lot of factors.

If you have a concrete problem you may post the sheet and see if someone comes up with a speed up.

Any files that I can read? Tips? The file Improving Mathcad Calculation Speed was recently removed from the site.

Usually files ond postings are not removed from this forum.

You don't state which Mathcad version you are working with, so I assume Mathcad 15.

Maybe you are talking about the quicksheet: Click "Help"/"Quicksheets"/"Mathcad Techniques"/"Improving Calculation Speed"

You may also search this forum for "calculation speed" or similar.

What we found out here a sghort time ago was that programs using stack() and augment() are much slower than programs with selfwritten routines - incomprehensible, but true.

1-Visitor
July 26, 2013

Werner Exinger wrote:

What we found out here a sghort time ago was that programs using stack() and augment() are much slower than programs with selfwritten routines - incomprehensible, but true.

Indeed, it is better to create your own routine instead of using stack(). The built-in routine was slower than my routine for arranging the solution of a SolveBlock.

Thank you Werner.

24-Ruby III
July 17, 2013

MihaiMoraru wrote:

...The file Improving Mathcad Calculation Speed was recently removed from the site...

"Improving Mathcad Calculation Speed" article from PTC Express:

http://www.imakenews.com/ptcexpress/e_article001093581.cfm?x=bcG4481,b3jsqcsB,w

http://www.imakenews.com/eletra/gow.cfm?z=ptcexpress%2C262285%2Cb3jsqcsB%2C2340181%2CbcG4481

The worksheet for MC13 can be found in attachment.

19-Tanzanite
July 17, 2013

As Werner says, there's no simple answer to that question. Posting a worksheet would help a lot.

Here is one thread that expands (a lot) on what the quicksheet says about vectorization:

http://communities.ptc.com/message/154931#154931

1-Visitor
July 17, 2013

I would like to upload it... unfortunetly I cannot , and is not due to the 'advanced editor'.

But I can tell a bit more on the worksheet. Briefly:

- one parameterized (6 parameters) SolveBlock (11 equations)

- one objective function formed using the (partial) solution of the parameterized SolveBlock: an SSE = sum(exp(i)-calc(i))^2, i=1..7

- one SolveBlock for minimization of the SSE function (containing the 6 parameters)

So, how do I improve the calculation time when dealing particularly with SolveBlocks?

About two hours it takes to solve the optimization problem - MathcadPrime2.0.

I read the QuickSheets (Werner Exinger), the article (VladimirN.) and the thread (Richard Jackson) and is very helpful. Thank you all very much.

Mihai

25-Diamond I
July 17, 2013

Really hard to say w/o the sheet (and probably hard with the sheet, too). Whats the problem with uploading? Technical problem (try later again; I sometimes have those probs with inserting pics in my posts) or because of proprietary confidential data in the sheet?

Don't be sure from your description if it could help (in fact I doubt it), but in Prime2 you can turn on multithreading which should speed up parallel calculations on multiprocessor machines.

1-Visitor
July 18, 2013

Werner Exinger wrote:

Whats the problem with uploading? Technical problem (try later again; I sometimes have those probs with inserting pics in my posts) or because of proprietary confidential data in the sheet?

Proprietary unfortunately.

Werner Exinger wrote:

Don't be sure from your description if it could help (in fact I doubt it), but in Prime2 you can turn on multithreading which should speed up parallel calculations on multiprocessor machines.

With and without multithreading the same number of CPUs are used and the same CPUs usage %. Interesting is that the later is about 20%... I was expecting to be 80 - 90% (independent of activated or not the multithreading option). I will give it a full try.

Thank you.