Skip to content

Commit

Permalink
Relax the tolerance in IpoptSolver.
Browse files Browse the repository at this point in the history
Previously we set the tolerance to 1.05E-10, this tolerance is too tight and causing numeric problems. We switch back to IPOPT default tolerance.
  • Loading branch information
hongkai-dai committed Jan 8, 2025
1 parent fe9454d commit 638c8a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions solvers/ipopt_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ void SetAppOptions(const std::string& default_linear_solver,
set_string_option("linear_solver", default_linear_solver);
}

// The default tolerance.
const double tol = 1.05e-10; // Note: SNOPT is only 1e-6, but in #3712 we
// diagnosed that the CompareMatrices tolerance needed to be the sqrt of the
// constr_viol_tol
set_double_option("tol", tol);
set_double_option("constr_viol_tol", tol);
set_double_option("acceptable_tol", tol);
set_double_option("acceptable_constr_viol_tol", tol);
set_string_option("hessian_approximation", "limited-memory");

// Any user-supplied options handled below will overwrite the above defaults.
Expand Down
4 changes: 2 additions & 2 deletions solvers/test/ipopt_solver_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ GTEST_TEST(IpoptSolverTest, AcceptableResult) {
GTEST_TEST(IpoptSolverTest, QPDualSolution1) {
IpoptSolver solver;
ConfigureIpopt(&solver);
TestQPDualSolution1(solver, {} /* solver_options */, 1e-5);
TestQPDualSolution1(solver, {} /* solver_options */, /*tol=*/1e-4);
}

GTEST_TEST(IpoptSolverTest, QPDualSolution2) {
Expand Down Expand Up @@ -273,7 +273,7 @@ GTEST_TEST(IpoptSolverTest, TestNonconvexQP) {
IpoptSolver solver;
ConfigureIpopt(&solver);
if (solver.available()) {
TestNonconvexQP(solver, false);
TestNonconvexQP(solver, false, /*tol=*/1E-4);
}
}

Expand Down

0 comments on commit 638c8a9

Please sign in to comment.