Opened 15 years ago
Last modified 15 years ago
#1472 closed defect (fixed)
Division computation errors
| Reported by: | roland | Owned by: | roland |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Version: | ||
| Keywords: | Cc: | roland, |
Description
The computation of models with variables occuring at the bottom of a division is incorrect.
For instance the following basic model computes a value for variable x of 0.5 instead of 2.0:
model testDiv
Real x;
equation
( 1 / x ) * 2 = 1;
end testDiv;
I checked this model with openmodelica 1.6.0 and the latest openmodelica 1.7.0 alpha.
Change History (2)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Ok, it used to solve as:
1/x * x2 * x3 = x4 * x5 *x
as:
x = 1 / (x2 * x3 * x4 * x5 *x6)
And:
x1 * x2 * x3 = x4 * x5 *1/x
as:
x = 1 / (x1 * x2 * x3 * x4 *x5)
Which is clearly wrong. Only one side of the equation should be inverted.
It is fixed in OpenModelica r8551

Some of the ExpressionSolve modules seem to be acting up :(
eq: x = 0.5; [j.mo:4:5-4:22] partOfLst: within testDiv; instanceOptLst: connectEquationOptLst: typeLst: operations: solve: 2.0 / x = 1.0 => x = 0.5