-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
NLExpressions and multiplication / division with numbers #571
Comments
Yes, there are a few heuristics in the sparsity detection code. Will be
|
I'd recommend using |
I guess this is an issue with the complexity of dealing with nonlinear expressions, so this is more of a note for people who might have the same problems:
The Hessian sparsity changes drastically depending on how you set your objectives in nonlinear optimisation. Division is bad, so is multiplication with something like (1 - a) for some scalar a.
The way around these issues is using multiplication with dummy-variables. In the following, let nf2 be a ParametricExpression defined by @defNLExpr:
Likewise, if you want
@setNLObjective(m, :Min, nf2 / a)
. It is better to useb = 1/a
and@setNLObjective(m, :Min, nf2 * b)
The text was updated successfully, but these errors were encountered: