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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…