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
Constraints for sum and relations of the variables #59
Comments
I'll close the issue as I sorted it out myself using LP arrays. I've taken a thorough look here and managed to solve my equation. Apparently, division is not allowed, so I converted my division relationships into coefficients like this:
And thus I had float values such as 0.4 for 2.5 (1/2.5=0.4). Unfortunately, the issues were still not gone, as apparently you can't have floats in lpsolve (take a look). So I multiplied the coefficients with 100 and we can safely do that all the time because lpsolve scales it automatically. I kept playing with my equation and realised the results are starting to have the desired shape, but my q's still could have values of 0. Wonder why? Apparently,
@JWally Thanks again for this library, but, if you're open to suggestions, I would recommend explicitly marking these restrictions on the first page (no division, no floats, no multi-comparison etc). It would help a lot people like me which had to solve a complex linear equation. Finally, the solution:
|
How do you run an LP array instead of the object with jsLPSolver? |
Hello! Firstly, thank you for the library, it's just amazing.
I'm somehow new to Javascript and of course to
jsLPSolver
and I have to solve the following equation:Basically, I don't have any idea right now how could I plug in these rules into the library's
model
. Like the relations or the sum constraints?The text was updated successfully, but these errors were encountered: