ipopt_solve_with_stats

(函数来自 pyomo.contrib.parmest.utils.ipopt_solver_wrapper)

pyomo.contrib.parmest.utils.ipopt_solver_wrapper.ipopt_solve_with_stats(model, solver, max_iter=500, max_cpu_time=120)[source]

运行求解器(必须是ipopt)并返回收敛统计信息

Parameters:
  • model (Pyomo 模型) – 需要求解的 pyomo 模型

  • solver (Pyomo solver) – 使用的pyomo求解器 - 必须是ipopt,但可以使用任何首选的选项

  • max_iter (int) – 允许ipopt进行的最大迭代次数

  • max_cpu_time (int) – 允许ipopt使用的最大CPU时间(以秒为单位)

Return type:

返回一个元组,包含(求解状态对象,bool(求解是否成功),迭代次数,求解时间,解的正则化值)