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

Performance when optimizing program blocks

efried-2
Visitor

Performance when optimizing program blocks

I noticed wildly changing performance after changing the settings (context sensitive setting) for internal optimization of the program. Not always in the desired direction.

Any clues about the right setting for number crunching accelerating numeric calculations)

thanks

8 REPLIES 8

Re: Performance when optimizing program blocks

This topic is very vague and I believe it has to be dealt with case by case. There has been many threads discussions optimisation in the community.

Please upload your worksheet for further assistance.

Re: Performance when optimizing program blocks

My question is simple:

What is happening internally if one activates the checkbox "optimization" for the program block?

Re: Performance when optimizing program blocks

Efried wrote:

My question is simple:

What is happening internally if one activates the checkbox "optimization" for the program block?

I wouldn't have guessed that you are referring to this option when I read your initial question.

Turning on this option uses the symbolic processor to try to optimize the RHS of a definition (:=) (according to the help also the LHS of an evaluation =). If a simpler expression is found you see a red asterisks and the internal representation of that expression is replaced by the simpler form. You can then see what Mathcad replaced your expression with by chosing Show Optimization in the very same right click context menu. A small windows pops up showing what Mathcad had done to your exporession.

1.png

The result is the same as if you do symbolic evaluation yourself. Obviously there is no "simplify" used (note the blue asterisk) and so I guess that most of the time you are better off using symbolic evaluation yourself:

2.png

I wonder why you asked as that topic is covered pretty well in the help. The topic is "Symbolic Optimization" and you are pointed to it if you searcg for "optimize".

Re: Performance when optimizing program blocks

Eher. Tanks for the exhaustive answer. unfortunately I was referring to Programm Blocks, Not equations.

Re: Performance when optimizing program blocks

The same answer.

Re: Performance when optimizing program blocks

Efried wrote:

Eher. Tanks for the exhaustive answer. unfortunately I was referring to Programm Blocks, Not equations.

Look at the color of the asterisk. If its blue, no modification was made, if its red you can look what Mathcad had replaced your code for.

The basic mechanism is the very same, no matter if a one line "program" (simple assigment or equation, as you called it) or a multiline program routine.

Re: Performance when optimizing program blocks

Ok, the asteriks remains blue, so no changes - may be the profiling is not so accurate.

Still I would need to know if there is a chance to optimize program blocks automatically not in terms of symbolic terms but computational efficiency.

Re: Performance when optimizing program blocks

Still I would need to know if there is a chance to optimize program blocks automatically not in terms of symbolic terms but computational efficiency.

Not automatically, no. The only way to optimize a program is by hand.

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."