Post Reply 
Find minimum or maximum of multi-variable function
08-16-2021, 08:57 AM (This post was last modified: 08-17-2021 02:49 AM by rawi.)
Post: #15
RE: Find minimum or maximum of multi-variable function
Quote:I'm not sure whether there is a function or command which can find the minimum or maximum of multi-variable function e.g

find min of Sqrt((x-14)^2 + (y-55)^2) + Sqrt((x-23)^2 + (y-95)^2)

Or any application which can help finding this kind of problem?

I have written a program called NMO for optimization for multivariate functions using Nelder-Mead-Method (a variant of the Simplex Method) that can be found her: https://www.hpmuseum.org/forum/thread-16426.html

You have to put in a function FUNCX() with L1(1) as x and L1(2) as y which in your case looks like this (> stands for STO |> ):

EXPORT FUNCX()
BEGIN
LOCAL Q1;
SQRT((L1(1)-14)^2+(L1(2)-55)^2)+SQRT((L1(1)-23)+(L1(2)-95)^2) > Q1;
RETURN Q1;
END;

Then you have to put starting values in L1, e.g. {14,55} > L1

Then call NMO

Put in 0.5 for S0 (ininitial step width) and 0.0001 for E0 (termination criterion) and 500 for ITM (maximum number of iterations) and press OK.

Within seconds the procedure stops at Minimum 41.000000. At list L1 you see the minimum value is exactly your starting point 14 and 55.
The same is the case if you start with x=23 and y=95. We get the same minimum 41.00000 for x=23 and y=95

If we start with {0,0} we get exactly the same function value 41.000000 with x = 15.7478 and y = 62,7679.

So your problem seems to have multiple minima.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Find minimum or maximum of multi-variable function - rawi - 08-16-2021 08:57 AM



User(s) browsing this thread: 2 Guest(s)