Skip to content
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

Merged
merged 6 commits into from
May 21, 2018
Merged

Conversation

awig
Copy link
Contributor

@awig awig commented May 10, 2018

No description provided.

@@ -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
Copy link
Owner

@ttinoco ttinoco May 20, 2018

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

'expect_infeasible_problem': 'no',
'check_derivatives_for_naninf': 'no',
'diverging_iterates_tol': 1e20,
'max_cpu_time': 1e6,
Copy link
Owner

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)
Copy link
Owner

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

Copy link
Contributor Author

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

@@ -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)
Copy link
Owner

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.

Copy link
Contributor Author

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?

Copy link
Owner

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

@ttinoco
Copy link
Owner

ttinoco commented May 20, 2018

@awig, I made some changes to the PR code and added comments here
Let me know if they make sense to you and you agree with then and I can merge into dev.
I ran the optalg and gridopt unittests and these ipopt changes did not significantly affect run times

@awig
Copy link
Contributor Author

awig commented May 21, 2018

They make sense. Thanks for improving them.

@ttinoco ttinoco merged commit 256f14c into dev May 21, 2018
@ttinoco ttinoco deleted the ipopt_expect_infeasible_option branch November 30, 2019 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants