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

Adds support for inequalities #1799

Merged
merged 16 commits into from
Nov 3, 2022

Conversation

ValentinKaisermayer
Copy link
Member

@ValentinKaisermayer ValentinKaisermayer commented Sep 1, 2022

@ValentinKaisermayer ValentinKaisermayer changed the title ineq support Adds support for inequalities Sep 21, 2022
@ValentinKaisermayer ValentinKaisermayer marked this pull request as ready for review September 21, 2022 14:34
@ValentinKaisermayer
Copy link
Member Author

Tests will fail

if length(cstr) > 0
@named cons_sys = NonlinearSystem(cstr, dvs, ps)
@named cons_sys = ConstraintsSystem(cstr, dvs, ps)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a simplify step here that reduces the system of equalities and inequalities to a minimal form.

loss = (a - x)^2 + b * (y - x^2)^2
cons = [
-1 ≲ x^2 + y^2,
x^2 + y^2 ≲ 500,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nicer syntax can come later: -1 ≲ x^2 + y^2 ≲ 500 😄

@YingboMa
Copy link
Member

Try to use a different solver in the tests

@ValentinKaisermayer
Copy link
Member Author

Should be good to go now.

Copy link
Member

@YingboMa YingboMa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc failure looks real. Could you merge master back to your PR?

@Vaibhavdixit02
Copy link
Member

Looks like you need to run the formatter

@YingboMa YingboMa merged commit e314197 into SciML:master Nov 3, 2022
@YingboMa
Copy link
Member

YingboMa commented Nov 3, 2022

Thanks a lot!

@ValentinKaisermayer ValentinKaisermayer deleted the vk-ineq-support branch November 3, 2022 19:31
@@ -8,9 +8,10 @@ OptimizationSystem

## Composition and Accessor Functions

- `get_eqs(sys)` or `equations(sys)`: The equation to be minimized.
- `get_op(sys)` or `objective(sys)`: The objective to be minimized.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the heck is this for? It ruins the uniformity and then bloats the namespace downstream. It serves no purpose other than to make things less consistent and break downstream codes. Let's revert this change. Just call the equations equations. In fact, there can be more than one, so it's not even the objective, so it's not even a correct description!

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

4 participants