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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Performance when optimizing program blocks

efried-2
3-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
MikeArmstrong
5-Regular Member
(To:efried-2)

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.

My question is simple:

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

Werner_E
24-Ruby V
(To:Efried)

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".

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

RichardJ
19-Tanzanite
(To:Efried)

The same answer.

Werner_E
24-Ruby V
(To:Efried)

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.

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.

RichardJ
19-Tanzanite
(To:efried-2)

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.

Top Tags