Python Pyomo Bonmin尽早检索结果

Python Pyomo Bonmin尽早检索结果,python,pyomo,Python,Pyomo,我在一个相当复杂的模型上使用Pyomo和Bonmin,它需要12个多小时来计算 我尝试将参数“bonmin.time_limit”设置为1800(30分钟),但它没有返回任何变量值 > ========================================================== > = Solver Results = > ==========================

我在一个相当复杂的模型上使用Pyomo和Bonmin,它需要12个多小时来计算

我尝试将参数“bonmin.time_limit”设置为1800(30分钟),但它没有返回任何变量值

> ==========================================================
> = Solver Results                                         =
> ==========================================================
> ----------------------------------------------------------
>   Problem Information
> ----------------------------------------------------------
> Problem:
> - Lower bound: -inf
>   Upper bound: inf
>   Number of objectives: 1
>   Number of constraints: 0
>   Number of variables: 0
>   Sense: unknown
> ----------------------------------------------------------
>   Solver Information
> ----------------------------------------------------------
Solver:
> - Status: warning
>   Message: bonmin\x3a Optimization interupted on limit.
>   Termination condition: maxIterations
>   Id: 410
>   Error rc: 0
>   Time: 1813.3797194957733
> ----------------------------------------------------------
>   Solution Information
> ----------------------------------------------------------
Solution:
> - number of solutions: 0
>   number of solutions displayed: 0
它输出多个信息“块”

有时,它输出:

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 600 -2.7877808e+005 1.82e-012 6.71e-003 -11.0 2.75e+000 -10.5 1.00e+000 5.56e-001h  1
 601 -2.7877808e+005 1.82e-012 6.79e-010 -11.0 1.05e+000 -10.0 1.00e+000 1.00e+000f  1
Number of Iterations....: 601
                                   (scaled)                 (unscaled)
Objective...............: -7.4080060189689470e+002  -2.7877808250893821e+005
Dual infeasibility......:  6.7945537380025706e-010   2.5569264627135494e-007
Constraint violation....:  1.8189894035458565e-012   1.8189894035458565e-012
Complementarity.........:  8.6460028294267016e-011   3.2536637848060228e-008
Overall NLP error.......:  6.7945537380025706e-010   2.5569264627135494e-007

Number of objective function evaluations             = 1075
Number of objective gradient evaluations             = 516
Number of equality constraint evaluations            = 1075
Number of inequality constraint evaluations          = 1075
Number of equality constraint Jacobian evaluations   = 604
Number of inequality constraint Jacobian evaluations = 604
Number of Lagrangian Hessian evaluations             = 601
Total CPU secs in IPOPT (w/o function evaluations)   =    101.103
Total CPU secs in NLP function evaluations           =      0.694

EXIT: Optimal Solution Found.
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 600 -2.7877808e+005 1.82e-012 6.71e-003 -11.0 2.75e+000 -10.5 1.00e+000 5.56e-001h  1
 601 -2.7877808e+005 1.82e-012 6.79e-010 -11.0 1.05e+000 -10.0 1.00e+000 1.00e+000f  1
Number of Iterations....: 601
                                   (scaled)                 (unscaled)
Objective...............: -7.4080060189689470e+002  -2.7877808250893821e+005
Dual infeasibility......:  6.7945537380025706e-010   2.5569264627135494e-007
Constraint violation....:  1.8189894035458565e-012   1.8189894035458565e-012
Complementarity.........:  8.6460028294267016e-011   3.2536637848060228e-008
Overall NLP error.......:  6.7945537380025706e-010   2.5569264627135494e-007

Number of objective function evaluations             = 1075
Number of objective gradient evaluations             = 516
Number of equality constraint evaluations            = 1075
Number of inequality constraint evaluations          = 1075
Number of equality constraint Jacobian evaluations   = 604
Number of inequality constraint Jacobian evaluations = 604
Number of Lagrangian Hessian evaluations             = 601
Total CPU secs in IPOPT (w/o function evaluations)   =    101.103
Total CPU secs in NLP function evaluations           =      0.694

EXIT: Optimal Solution Found.
但随后,它会立即运行另一组计算(从上一块继续):

等等

有没有办法从第一个街区得到答案

它就这样永远重复。

它输出多个信息“块”

有时,它输出:

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 600 -2.7877808e+005 1.82e-012 6.71e-003 -11.0 2.75e+000 -10.5 1.00e+000 5.56e-001h  1
 601 -2.7877808e+005 1.82e-012 6.79e-010 -11.0 1.05e+000 -10.0 1.00e+000 1.00e+000f  1
Number of Iterations....: 601
                                   (scaled)                 (unscaled)
Objective...............: -7.4080060189689470e+002  -2.7877808250893821e+005
Dual infeasibility......:  6.7945537380025706e-010   2.5569264627135494e-007
Constraint violation....:  1.8189894035458565e-012   1.8189894035458565e-012
Complementarity.........:  8.6460028294267016e-011   3.2536637848060228e-008
Overall NLP error.......:  6.7945537380025706e-010   2.5569264627135494e-007

Number of objective function evaluations             = 1075
Number of objective gradient evaluations             = 516
Number of equality constraint evaluations            = 1075
Number of inequality constraint evaluations          = 1075
Number of equality constraint Jacobian evaluations   = 604
Number of inequality constraint Jacobian evaluations = 604
Number of Lagrangian Hessian evaluations             = 601
Total CPU secs in IPOPT (w/o function evaluations)   =    101.103
Total CPU secs in NLP function evaluations           =      0.694

EXIT: Optimal Solution Found.
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 600 -2.7877808e+005 1.82e-012 6.71e-003 -11.0 2.75e+000 -10.5 1.00e+000 5.56e-001h  1
 601 -2.7877808e+005 1.82e-012 6.79e-010 -11.0 1.05e+000 -10.0 1.00e+000 1.00e+000f  1
Number of Iterations....: 601
                                   (scaled)                 (unscaled)
Objective...............: -7.4080060189689470e+002  -2.7877808250893821e+005
Dual infeasibility......:  6.7945537380025706e-010   2.5569264627135494e-007
Constraint violation....:  1.8189894035458565e-012   1.8189894035458565e-012
Complementarity.........:  8.6460028294267016e-011   3.2536637848060228e-008
Overall NLP error.......:  6.7945537380025706e-010   2.5569264627135494e-007

Number of objective function evaluations             = 1075
Number of objective gradient evaluations             = 516
Number of equality constraint evaluations            = 1075
Number of inequality constraint evaluations          = 1075
Number of equality constraint Jacobian evaluations   = 604
Number of inequality constraint Jacobian evaluations = 604
Number of Lagrangian Hessian evaluations             = 601
Total CPU secs in IPOPT (w/o function evaluations)   =    101.103
Total CPU secs in NLP function evaluations           =      0.694

EXIT: Optimal Solution Found.
但随后,它会立即运行另一组计算(从上一块继续):

等等

有没有办法从第一个街区得到答案


它总是这样重复。

忽略问题信息部分(看起来很糟糕;解析错误?):也许bonmin没有找到可行的解决方案?也许可以删除一些约束,以检查早期停止是否可以解决更容易的问题(是的:在某些问题中,这可能是非常重要的,因为无界性可能是一个问题)。并且:您的问题是凸的吗?您也可以在Bonmin运行时使用tee=True或--stream solver获取解算器输出信息。我会将输出粘贴到新答案中,以便于将来查看,请使用其他信息更新原始问题,不要将其他信息作为“答案”发布。这些输出块来自NLP子问题解(在本例中为
ipopt
),与MINLP的实际现有(整数可行)解不对应。因此,bonmin没有报告这些解决方案。我明白了。是否有任何参数可以让我快速获得大致的答案?您可以查看bonmin选项:。我不知道Pyomo中有什么东西可以满足您的需求。我有一个初步的MINLP解算器实现,它可能能够满足您的需求,尽管它还没有被合并到。