Pyomo 中的IPOPT 返回非零返回代码

问题描述 投票:0回答:1

我正在研究一个用于电网分析的复杂非线性模型,我无法在这里发布。作为决策变量,它应该设置时间序列的所有时间步的存储功率。该模型适用于:

  • 网格中的存储数量和任何时间范围都较少
  • 仅在短时间内增加存储数量

对于大量存储和较长时间范围,它会返回错误消息:

ERROR: Solver (ipopt) returned non-zero return code (3221225501)

存储功率变量定义为大小为 (n_storages x t_steps) 的数组。因此,增加存储数量或时间范围只会改变数组大小,但不会直接影响变量本身的计算。

到目前为止我得出的结论是:

  • 这不是模型约束的问题,因为它没有告诉我问题是无界/不可行的。当我保留变量约束时,错误仍然存在。
  • 变量最初未初始化。初始化它们可以提高可解时间范围的大小。这符合 Pyomo 文档的建议。
  • 这个问题也无法用 scip sovler 解决,它会返回另一个错误。目前还不确定这句话的含义。
FileNotFoundError: [Errno 2] No such file or directory: '...\\AppData\\Local\\Temp\\2\\tmp84kvz_rd.pyomo.sol‘ 

具有最高输出级别的 ipopt 求解器的日志如下。我对其进行了编辑以缩短矩阵。在 TSymLinearSolver 中,日志停在右侧 0 的中间:


List of options:

                                    Name   Value                # times used
                        file_print_level = 12                        1
                             output_file = ipopt_log.txt             1
                                     tol = 0.001                     2

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************

NOTE: You are using Ipopt by default with the MUMPS linear solver.
      Other linear solvers might be more efficient (see Ipopt documentation).


This is Ipopt version 3.11.1, running with linear solver mumps.

Number of nonzeros in equality constraint Jacobian...:    82747
Number of nonzeros in inequality constraint Jacobian.:     6912
Number of nonzeros in Lagrangian Hessian.............:    18624

Scaling parameter for objective function = 1.000000e+000
objective scaling factor = 1
No x scaling provided
c scaling provided
No d scaling provided
DenseVector "c scaling vector" with 20640 elements:
c scaling vector[    1]=4.8028646739442593e-001
c scaling vector[    2]=4.8028646739442593e-001
    ...
c scaling vector[20639]=1.0000000000000000e+000
c scaling vector[20640]=1.0000000000000000e+000
DenseVector "original x_L unscaled" with 4032 elements:
original x_L unscaled[    1]=9.0000000000000002e-001
original x_L unscaled[    2]=9.0000000000000002e-001
    ...
original x_L unscaled[ 4031]=0.0000000000000000e+000
original x_L unscaled[ 4032]=0.0000000000000000e+000
DenseVector "original x_U unscaled" with 4032 elements:
original x_U unscaled[    1]=1.1000000000000001e+000
original x_U unscaled[    2]=1.1000000000000001e+000
    ...
original x_U unscaled[ 4031]=2.7400000000000002e-001
original x_U unscaled[ 4032]=2.7400000000000002e-001
DenseVector "original d_L unscaled" with 0 elements:
DenseVector "original d_U unscaled" with 3456 elements:
original d_U unscaled[    1]=6.2500000000000000e+002
original d_U unscaled[    2]=6.2500000000000000e+002
    ...
original d_U unscaled[ 3455]=6.3504000000000005e-002
original d_U unscaled[ 3456]=6.3504000000000005e-002
DenseVector "modified x_L scaled" with 4032 elements:
modified x_L scaled[    1]=8.9999998999999997e-001
modified x_L scaled[    2]=8.9999998999999997e-001
    ...
modified x_L scaled[ 4031]=-1.0000000000000000e-008
modified x_L scaled[ 4032]=-1.0000000000000000e-008
DenseVector "modified x_U scaled" with 4032 elements:
modified x_U scaled[    1]=1.1000000110000001e+000
modified x_U scaled[    2]=1.1000000110000001e+000
    ...
modified x_U scaled[ 4031]=2.7400001000000002e-001
modified x_U scaled[ 4032]=2.7400001000000002e-001
DenseVector "modified d_L scaled" with 0 elements:
DenseVector "modified d_U scaled" with 3456 elements:
modified d_U scaled[    1]=6.2500000624999996e+002
modified d_U scaled[    2]=6.2500000624999996e+002
    ...
modified d_U scaled[ 3455]=6.3504010000000000e-002
modified d_U scaled[ 3456]=6.3504010000000000e-002
DenseVector "initial x unscaled" with 21120 elements:
initial x unscaled[    1]=1.0000000000000000e+000
initial x unscaled[    2]=1.0000000000000000e+000
    ...
initial x unscaled[21119]=-1.0000000000000000e+000
initial x unscaled[21120]=-1.0000000000000000e+000
Moved initial values of x sufficiently inside the bounds.
DenseVector "original vars" with 21120 elements:
original vars[    1]=1.0000000000000000e+000
original vars[    2]=1.0000000000000000e+000
    ...
original vars[21119]=-1.0000000000000000e+000
original vars[21120]=-1.0000000000000000e+000
DenseVector "new vars" with 21120 elements:
new vars[    1]=1.0000000000000000e+000
new vars[    2]=1.0000000000000000e+000
    ...
new vars[21119]=-1.0000000000000000e+000
new vars[21120]=-1.0000000000000000e+000
Initial values of s sufficiently inside the bounds.

CompoundVector "RHS[ 0]" with 4 components:

Component 1:
  DenseVector "RHS[ 0][ 0]" with 21120 elements:
  RHS[ 0][ 0][    1]=0.0000000000000000e+000
  RHS[ 0][ 0][    2]=0.0000000000000000e+000
    ...
  RHS[ 0][ 1][ 3456]=-1.0000000000000000e+000

Component 3:
  DenseVector "RHS[ 0][ 2]" with 20640 elements:
  Homogeneous vector, all elements have value 0.0000000000000000e+000

Component 4:
  DenseVector "RHS[ 0][ 3]" with 3456 elements:
  Homogeneous vector, all elements have value 0.0000000000000000e+000

CompoundSymMatrix "KKT" with 4 rows and columns components:
Component for row 0 and column 0:

  SumSymMatrix "KKT[0][0]" of dimension 21120 with 2 terms:
  Term 0 with factor 0.0000000000000000e+000 and the following matrix:

    SymTMatrix "Term: 0" of dimension 21120 with 18624 nonzero elements:
    Uninitialized!
  Term 1 with factor 1.0000000000000000e+000 and the following matrix:

    DiagMatrix "Term: 1" with 21120 rows and columns, and with diagonal elements:
      DenseVector "Term: 1" with 21120 elements:
      Homogeneous vector, all elements have value 1.0000000000000000e+000
Component for row 1 and column 0:
This component has not been set.
Component for row 1 and column 1:

  DiagMatrix "KKT[1][1]" with 3456 rows and columns, and with diagonal elements:
    DenseVector "KKT[1][1]" with 3456 elements:
    Homogeneous vector, all elements have value 1.0000000000000000e+000
Component for row 2 and column 0:

  ScaledMatrix "KKT[2][0]" of dimension 20640 x 21120:
    DenseVector "KKT[2][0]_row_scaling" with 20640 elements:
    KKT[2][0]_row_scaling[    1]=4.8028646739442593e-001
    KKT[2][0]_row_scaling[    2]=4.8028646739442593e-001
    KKT[2][0]_row_scaling[    3]=4.8028646739442593e-001
    ...
    KKT[2][0]_unscaled_matrix[12192,21120]=1.0000000000000000e+000  (82746)
    ColumnScaling is NULL
Component for row 2 and column 1:
This component has not been set.
Component for row 2 and column 2:

  DiagMatrix "KKT[2][2]" with 20640 rows and columns, and with diagonal elements:
    DenseVector "KKT[2][2]" with 20640 elements:
    Homogeneous vector, all elements have value 0.0000000000000000e+000
Component for row 3 and column 0:

  GenTMatrix "KKT[3][0]" of dimension 3456 by 21120 with 6912 nonzero elements:
  KKT[3][0][    1, 3073]=2.0000000000000000e+000  (0)
  KKT[3][0][    2, 3074]=2.0000000000000000e+000  (1)
  KKT[3][0][    3, 3075]=2.0000000000000000e+000  (2)
  KKT[3][0][    4, 3076]=2.0000000000000000e+000  (3)
    ...
(160409) KKT[48671][48671] =  0.000000000000000e+000
(160410) KKT[48672][48672] =  0.000000000000000e+000
Right hand side 0 in TSymLinearSolver:
Trhs[    0,    0] = 0.0000000000000000e+000
...
Trhs[    0,48634] = 0.0000000000000000e+000
Trhs[    0,48635] = 0.0000000000000000e+000
Trhs[    0,48636] = 0.0000000000000000e+000
Trhs[    0,48637] = 0.0000000000000000e+000
Trhs[    0,48638] = 0.0000000000000000e+000
Trhs[    0,48639] = 0.0000000000000000e+000
Trhs[    0,48640] = 0.0000000000000000e+000
Trhs[    0,48641] = 0.0000000000000000e+000
Trhs[    0,48642] = 0.0000000000000000e+000
Trhs[    0,48643] = 0.0000000000000000e+000
Trhs[    0

我的问题是:

  • 有什么办法可以获取更多有关错误原因的信息吗?
  • 我还必须调试该错误还有哪些其他可能性?

我知道这是一个广泛的问题,所以提前感谢您的回答!

python pyomo nonlinear-optimization ipopt
1个回答
0
投票

我尝试在 MacOS 上使用 ipopt 3.14 求解模型,它收敛了。遗憾的是我无法在 Windows 上使用这个版本的 Anaconda。谢谢您的帮助!

© www.soinside.com 2019 - 2024. All rights reserved.