Closed axelvonkamp closed 1 year ago
What is the objective function that you added? It looks like enforcing a semi-positive objective is constraining the directions in the system which is not necessarily incorrect.
This is the expected result--by setting r2 as the objective prior to FVA, r2 is then constrained as positive in each iteration of the FVA min/max problems.
I think this behaviour is confusing. Why should an objective that is weighted with 0 affect the result? An objective weighted with zero should in my view be the same as the zero objective.
What do you mean by zero objective? In FVA you enforce that obj >= fraction * max(obj)
so if fraction is zero your objective is forced to be positive. If you want to constrain a particular direction of the Reaction you can also set the objective to only that direction...
Closing due to inactivity. Feel free to reopen.
To illustrate my issue I set up a simple model (without objective) and run a FVA:
I get the expected result:
| minimum | maximum -- | -- | -- R1|-1000.0 | 1000.0 R2|-1000.0 | 1000.0 R3|-1000.0 | 1000.0Then I add an objective and run the FVA again with the fraction_of_optimum parameter set to 0.0:
Now I get a different result:
| minimum | maximum -- | -- | -- R1|0.0 | 1000.0 R2|0.0 | 1000.0 R3|-1000.0 | 0.0I would have expected the same result as before. This behaviour comes from the additional variables/constraints added for the situation that fraction_of_optimum > 0. As possible fix in variability.py would be to add the additional variables/constraints only if fraction_of_optimum > 0.