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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Optimization bug

AlvaroDíaz
9-Granite

Optimization bug

Optimizing a defined function makes that this function cames undefined.

As bonus, optimize can not deal with f(x):=int(x,x), probably a dummy variable problem.

Regards. Alvaro.
4 REPLIES 4

Optimization has always been flaky, and in general should not be used. Use explicit symbolic evaluation where appropriate.

The absolute value function is not differentiable everywhere. You get all kinds of problems trying to differentiate it.

The symbolic processor is quite capable of returning results that use functions that are only defined to the symbolic processor, and don't work with the numeric processor. You need to check symbolic results for such usages. Here the symbolic processor defines, and uses, a two operand form of ab and signum. This form is quite invalid for the numeric processor.

BTW, what version of MC are you actually using? This section is for MC14 bugs, but you posted a MC11 format file. Also, where did the Abs function you are using come from?
__________________
� � � � Tom Gutman

On 12/23/2009 4:49:04 AM, Tom_Gutman wrote:

>Optimization has always been flaky, and in general should not be used.

That's because have bugs, a more clean optimiz option could be a very useful tool.

>Use explicit symbolic evaluation where appropriate.

This don't work in the exposed sample, and whith no apparent reason.

>The absolute value function is not differentiable everywhere.

Abs is a continuous function at the entire real axis and differentiable for all reals with a very small hole at the origin.

>You get all kinds of problems trying to differentiate it.

Only a discrete jump at the origin.

>The symbolic processor is quite capable of returning results that use functions that are only defined to the symbolic processor, and don't work with the numeric processor.

But this is not the case in the exposed examples: copy the symbolic answers in green and paste as function definitions then you can find that there are not problems in those assignations, so question is what is the problem that make unusable symbolic evaluation.



>You need to check symbolic results for such usages. Here the symbolic processor defines, and uses, a two operand form of ab and signum. This form is quite invalid for the numeric processor.

No, they are good definitions for numerics, I can plot this functions as they are defined.

>BTW, what version of MC are you actually using?

Mathcad 14 M020.

>This section is for MC14 bugs, but you posted a MC11 format file.

Saved as mc11, developed under mc14.

>Also, where did the Abs function you are using come from?

Can't understand this question.

Regards. Alvaro.

"I can plot this functions as they are defined"
______________________________

Read carefully the definition of each,
plot more carefully in discretized mode.

jmG

On 12/23/2009 4:49:04 AM, Tom_Gutman wrote:
>You need to check symbolic results for such usages. Here the symbolic processor defines, and uses, a two operand form of ab and signum. This form is quite invalid for the numeric processor.

That's true for mathcad 11, in mathcad 14 abs remaing undefined as function, but signum accept one or two arguments, for numeric or symbolic evaluations



Regards. Alvaro.
Top Tags