-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Problem with solving NL problem #266
Comments
Vectorized syntax like this isn't currently supported within |
Vectorized syntax would be very nice. So i have about 300 constraints with a lot of different indices. Another example
But if i use
JuMP returns
|
What is the type of |
|
Yes, that isn't supported (and it's not clear what precisely it should mean). |
"(and it's not clear what precisely it should mean)" Do you mean the function |
I mean, what is the set of constraints that you would like to add, stated in terms of scalars? |
Afte a lot of senseless writing i give SymPy another chance. I try it but can't give you without much more effort a set of constraints in terms of scalars with the matrices i use. But with SymPy i can give you e.g. the a constraint (values are truncated, my laptop with julia has no internet access at the time of writing this):
This must be bigger than 1 and smaller than a predefined value. And so on for 287 more terms. All with lower and upper bound. I can workaround with Edit: I try
|
Hmm, it shouldn't be necessary to use a symbolic manipulation package like SymPy to generate the scalar constraints. If you could provide at least a mathematical expression for the constraints that you would like to add, then perhaps we can help with translating them into JuMP's syntax. |
Thanks,
In my example is Constant size is only 11 (respect 10 or 6) in All constraints must be greater equal than 1 und also smaller than some predefined upper bound (e.g. 1.8) Edit: Abbreviate Edit2: Got the scalar expressions :) Maybe there are some tips for better style.
Edit3: In above equation must be an error. I have an excel sheet with some additional calculations (for sharing), where i didn't get the right results (values of the terms for the constraints). Edit4: Error found and corrected in Edit2. runtime from 90s down to 2s 🎉 |
@mlubin After some sleep i can frame my thoughts better. You have asked what the matrix calculations mean respectively what i want to do. I have a lot of constraint with the same comparison and rhs. So i thought it would be nice if every element in an array could represent the lhs of a set of constraints. If
So for a lot of constraints with the same comparison operator and rhs i could use something like (only idea) I hope the idea behind my question is now slightly clearer. |
Yes, this is technically possible but likely won't be implemented in the short term. |
I have a big set of non-linear constraints for a problem and difficulties to add them right to JuMP. In an earlier version I use SymPy and save the constraints as string and parse them for JuMP. Now i try to add them natively to JuMP through
@addNLConstraint
.The general form of a constraint for the problem is nominator .* x[i] / denominator .* x[i].
More precisely
I know that for multiplication it's neccessary o multiply coefficient by variable and not variable by coeefficient. But aside form this point there are different problems. JuMP accepts this Constraint but solving returns
Unrecognized function .*
. Some trying returns alwaysUnrecognized function ...
.f[:,fma]
is an 12x10 arrayx[i]
goes from i=1 to 12a[:,fma,1]
is an 6x10 arrayeffizienz_arr[:,1] is an 12 element array
I appreciate every hint to get this set of constraint right into JuMP for solving.
The text was updated successfully, but these errors were encountered: