Skip to main content
1-Visitor
July 22, 2021
Solved

Unable to find the correct minima

  • July 22, 2021
  • 1 reply
  • 3262 views

Hi,

I am trying to optimize the solution of minimization function depending on the intial guess values. Surprisingly, my solutions are independent of initial guess values even though the function has several local minima. I am attaching the Mathcad 15 worksheet for the refrence. Any help will be highly appreciated!

Sunny_0-1626954748719.png

 

 

Many thanks

S

Best answer by Werner_E

The guess value can influence the outcome of "minimize", but its not always obvious which guess results in which minimum.

Furthermore I have no clue why the vertical displacement (a very tiny one is all thats needed) shown in function g(x) makes that big a difference for the outcome of minimize.

Werner_E_0-1626989872766.png

 

1 reply

23-Emerald IV
July 22, 2021

Apparently Minimize doesn't require a guess value...

You may need an extra constraint to force Minimize to find another than the first minimum:

LucMeekes_0-1626955730658.png

 

Success!
Luc

 

1-Visitor
July 22, 2021

Alright! However, what is the way to dynamically optimize the constraint. This is beacuse I would like to find the local minima as a function of theta (region of interest). For example if theta is less than 90 deg the solution should be 0 deg, for theta between 90 deg and 270 deg, solution should be 90 deg and so on. Please not that in this case the constrains are very well discretized but in general it may not be.

 

Thanks

S

25-Diamond I
July 22, 2021

for theta between 90 deg and 270 deg, solution should be 90 deg

 

You asked for minima! At 90° there is no minimum but a maximum!

BETWEEN 90° and 180° there is no extrema at all, but in the range FROM 90° TO 180° there is a max at 90° and a min at 180°.

 

How about using the zeros of the first derivative to get the extrema? You may use the "root" function where you can provide a range to search for the zero within. The function values at the endpoints of that range must be of opposite sign, though.