-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ipopt expect infeasible option #34
Conversation
…sing of AVC's MinimizeLossesContingencyAnalysis
…terates_tol, and max_cpu_time, also added python checks for nan and inf in x with tests
optalg/lin_solver/mumps.py
Outdated
@@ -38,7 +38,7 @@ def __init__(self,prop='unsymmetric'): | |||
|
|||
# Configure | |||
self.mumps.set_silent() | |||
self.mumps.set_icntl(14,1000) # % increase of estimated working space | |||
self.mumps.set_icntl(14, 200) # % increase of estimated working space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@awig you had set it to 1000 but this is for the mumps linear solver warpper for optalg. This is different to the mumps instance that ipopt uses internally. I will keep this at 200 and set the ipopt mumps setting to 1000
optalg/opt_solver/ipopt.py
Outdated
'expect_infeasible_problem': 'no', | ||
'check_derivatives_for_naninf': 'no', | ||
'diverging_iterates_tol': 1e20, | ||
'max_cpu_time': 1e6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am changing option values to be valid values for ipopt in order to avoid if statements
self.ipopt_context.add_option('diverging_iterates_tol', div_iters_tol) | ||
self.ipopt_context.add_option('max_cpu_time', float(max_cpu_time)) | ||
self.ipopt_context.add_option('hessian_approximation', h_approx) | ||
self.ipopt_context.add_option('linear_solver', lin_solver) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems a bit better to me to not have lots of if statments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Sounds good to me
tests/test_opt_solvers.py
Outdated
@@ -68,8 +68,8 @@ def test_ipopt(self): | |||
for x_bad in [np.inf, np.nan]: | |||
x[n/2] = x_bad | |||
bad_prob = opt.opt_solver.QuadProblem(H,g,A,b,l,u,x=x) | |||
Ipopt.solve(bad_prob) | |||
self.assertEqual(Ipopt.get_status(),'error') | |||
self.assertRaises(opt.opt_solver.opt_solver_error.OptSolverError_Ipopt, Ipopt.solve, bad_prob) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You see, ipopt throws an OptSolverError_Ipopt when given nan or inf but there is not informative error message. Let's enhance this error exception class to store ipopt failure messages for all errors. This can be done on a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Thanks for fixing that. Is it possible to capture ipopt's error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible. I will merge this PR and create a separate issue for capturing ipopt error messages and saving them in OptSolverError_Ipopt exception
They make sense. Thanks for improving them. |
No description provided.