Post Reply 
"SOLVER" function as in Excel
01-02-2022, 06:44 AM
Post: #4
RE: "SOLVER" function as in Excel
(01-02-2022 03:59 AM)rawi Wrote:  Hi,
you can solve equations for unknowns, easiest with the solve app. But there is the no ready to use optimization procedure built in. I wrote such a procedure you can find here: https://www.hpmuseum.org/forum/thread-16426.html
Perhaps this helps.

Sorry, why in "FUNCX" there is no ▶Q1, in the line before "RETURN",?

EXPORT FUNCX()
BEGIN
LOCAL Q1;
(L1(1)-2.)^2+(L1(2)-1)^2+(L1(3)-1.5)^2▶Q1;
Q1+L1(4)^2+(L1(5)+1)^2▶Q1;
Q1+2*((L1(1)-2)*(L1(2)-1))^2▶Q1;
Q1+0.5*((L1(2)-1)*(L1(5)+1))^2; <------ your version
RETURN Q1;
END;

EXPORT FUNCX()
BEGIN
LOCAL Q1;
(L1(1)-2.)^2+(L1(2)-1)^2+(L1(3)-1.5)^2▶Q1;
Q1+L1(4)^2+(L1(5)+1)^2▶Q1;
Q1+2*((L1(1)-2)*(L1(2)-1))^2▶Q1;
Q1+0.5*((L1(2)-1)*(L1(5)+1))^2▶Q1; <------ version of the question asked by me
RETURN Q1;
END;

Can you give another example with another function?

Thanks so much
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
"SOLVER" function as in Excel - robmio - 01-01-2022, 08:17 PM
RE: "SOLVER" function as in Excel - rawi - 01-02-2022, 03:59 AM
RE: "SOLVER" function as in Excel - robmio - 01-02-2022, 05:35 AM
RE: "SOLVER" function as in Excel - robmio - 01-02-2022 06:44 AM
RE: "SOLVER" function as in Excel - robmio - 01-02-2022, 07:44 AM
RE: "SOLVER" function as in Excel - C.Ret - 01-02-2022, 11:35 AM
RE: "SOLVER" function as in Excel - robmio - 01-03-2022, 06:39 AM
RE: "SOLVER" function as in Excel - rawi - 01-02-2022, 08:21 AM
RE: "SOLVER" function as in Excel - robmio - 01-03-2022, 06:23 PM
RE: "SOLVER" function as in Excel - robmio - 01-04-2022, 01:18 PM
RE: "SOLVER" function as in Excel - robmio - 01-04-2022, 01:22 PM
RE: "SOLVER" function as in Excel - C.Ret - 01-04-2022, 08:22 PM
RE: "SOLVER" function as in Excel - rawi - 01-04-2022, 08:47 AM



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