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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Minimize function strange result

cberceanu
2-Explorer

Minimize function strange result

Hi all,

I hope this is the right sub-forum to post this address.

I am trying to make use of some Mathcad in-built capabilities, like for instance the Minimize or Maximize function.

Please have a look at the attached file. I have some functions defined there which ultimately are used inside the final function called Function1 (blue background).

For Function1, I want to apply the mathcad defined Minimize function, which needs the variation intervals for the variables of the function to be defined (along with guess values). I can do that OK, and I do get a relevant result when applying the Minimize function on Function1 (the result consists of the variables values, within the defined interval for each variable, for which Function1 will be minimum). I store this result in the variable called "Result" and then I compute the value of the Function1 function with the elements of the "Result", aiming to obtain the minimum of Function1 (yellow background).

The problem that I have is that it does not seem to be a minimum; meaning I can find other values for the variables, within the defined intervals, for which the value of Function1 is even smaller (see area marked in green). So am I doing something wrong or is this simply a strange function?

Regards,

Cristian

32 REPLIES 32
LucMeekes
23-Emerald III
(To:cberceanu)

OK, the reason why you  (Cristian and Rich) get the same result on the first run is due to the random number generation, which is pseudo random: Whenever Mathcad starts up with the same sheet, doing the same calculation(s), the sequence of random numbers is the same.

The reason you don't get (almost) exactly the 'absolute' minimum is because if you want that, you have to set the parameters correctly (that is to the edge), which is what I did in successive runs to verify Werner's observation. With every run I limited the range of each variable between a found minimum and the correct edge.

Luc

Ah, I see! Thanks for explaining it.

Regards,

Cristian

RichardJ
19-Tanzanite
(To:LucMeekes)

OK, the reason why you  (Cristian and Rich) get the same result on the first run is due to the random number generation, which is pseudo random: Whenever Mathcad starts up with the same sheet, doing the same calculation(s), the sequence of random numbers is the same.

Yes, good point. we had a discussion about this many years ago, and someone came up with a better random number generator, the Mircea random number generator (invented by Mircea Andrecut, at Babes-Bolyai University). This was the Mathcad implementation of that, but I have never been convinced it's quite correct:

Announcements

Top Tags