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

Handling nonlinear expressions near domain violations #41

Open
mewilhel opened this issue Apr 9, 2020 · 1 comment
Open

Handling nonlinear expressions near domain violations #41

mewilhel opened this issue Apr 9, 2020 · 1 comment

Comments

@mewilhel
Copy link
Member

mewilhel commented Apr 9, 2020

Right now, we're using a fancy overloading approach to build relaxations of nonlinear terms. Expansiveness of the interval calculations can lead to intermediate terms containing an interval bound on which some functions aren't defined (e.g. sqrt on [-0.001, 10]). Two potential approaches to dealing with this:

  • Option 1: We move the user-defined function handling to contextual dispatch (Cassette.jl), move domain violation checks to wrapper functions in McCormick.jl around the computational kernel, have the contextual dispatch check the domain violation condition call the kernel on execution, if a domain violation occurs then set a flag in the contexts metadata and dispatch to trivial operations from there on out (unless there is a clearer way to return directly in Cassette). Update EAGO's logic to include branching when this flag is set to domain violation. As w(X) -> 0, the degree of overestimation should go to zero and eventually the routine should converge unless the model formulation itself has domain violations.
  • Option 2: Parse the expression graph of user-defined functions to introduce an equality constraint z = f(x) for sqrt(f(x)) (or a similar function), substituting in z for f(x) in the expression graph, and branch on z whenever a domain violation such that one resulting interval contains the domain violation Zbad (and the other one or two contain valid domains). You'd then need to use a domain reduction technique to fathom the interval containing the violation for all (Zbad,X). Possibly faster than Option 1.
@mewilhel
Copy link
Member Author

mewilhel commented Apr 9, 2020

We've added a default safeguard to the McCormick.jl operators to address this.

Basically, z = y/x becomes MC{N,T}(union(y/Interval(x.Intv.lo,-MC_DOMAIN_TOL), y/Interval(MC_DOMAIN_TOL, x.Intv.hi))) this can be disable by setting const MC_DOMAIN_CATCH = false in line 81 of McCormick.jl. This is in place for /, inv, and pow functions. We'll need to look at hyperbolic functions and trig functions shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant