控制模型文件中的有效位数

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

Pyomo中是否有一个方法用于控制目标函数中的有效位数和发送给求解器的约束矩阵系数?

在我的例子中,目标的形式和问题数据是从文件中获得的或在程序中创建的,然后顺序解决所得到的问题。因此,使用圆函数或十进制包仅部分地允许控制有效位数。理想情况下,Pyomo中的某些全局方法将能够控制最终模型中的有效数字的数量,这些数字将被发送到例如LP文件中的求解器。

pyomo
1个回答
0
投票

你使用哪个解算器。例如,IP-OPT有许多设置。这两个可以帮助你:

tiny_step_tol                          0 <= (2.22045e-15) <  +inf      
   Tolerance for detecting numerically insignificant steps.
     If the search direction in the primal variables (x and s) is, in relative
     terms for each component, less than this value, the algorithm accepts the
     full step without line search.  If this happens repeatedly, the algorithm
     will terminate with a corresponding exit message. The default value is 10
     times machine precision.

tiny_step_y_tol                        0 <= (       0.01) <  +inf      
   Tolerance for quitting because of numerically insignificant steps.
     If the search direction in the primal variables (x and s) is, in relative
     terms for each component, repeatedly less than tiny_step_tol, and the
     step in the y variables is smaller than this threshold, the algorithm
     will terminate.

要使用这些,您需要在工作目录的ipopt.opt文件中设置它们的新值。

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