Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
440 views
in Technique[技术] by (71.8m points)

nonlinear optimization - What types of non-linearities can GEKKO handle?

I've been using GEKKO successfully for a variety of problems but one thing I haven't been able to pin down is what the limits are in terms of non-linear terms in objective functions or constraints. I've found that some non-linear terms are tolerated, e.g.

m.Obj(sum(x * values) / sum(x))

seems to work fine, however

m.Obj(sum(x * values + x ** 2 * other_values) / sum(x))

seems to be unsolvable. Is there any documentation about the limits of GEKKO to handle certain forms of non-linearities that might help me reformat my problem?

question from:https://stackoverflow.com/questions/65602643/what-types-of-non-linearities-can-gekko-handle

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Model building functions are listed in the Gekko documentation and include any nonlinear function that can be mathematically expressed with continuous first and second derivatives. Gekko gives the problem to a solver to attempt a solution. Sometimes the solver (IPOPT, BPOPT, APOPT) identifies the problem as infeasible or fails to find a solution. This doesn't mean that Gekko can't use these functions, only that a numerical solution was not found. You can try switching solvers with m.options.SOLVER=1. You may also need to use more efficient versions of the functions such as the Gekko m.sum() instead of the Python sum() function.

m.Minimize(m.sum(x * values + x ** 2 * other_values) / m.sum(x))

Certain solvers such as a APOPT also allow mixed integer problems. Differential and algebraic equations are also solvable with Gekko. There is more information in the documentation on switching solving modes with IMODE. There is a preview of applications with the 18 example applications.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...