- Index
- » Developer
- » OpenModelica development
- » Is it a compiler bug?
Is it a compiler bug?
Is it a compiler bug?
With the InOutArray.mo I get:
Error: Variable m.x[1] is not referenced in any equation (possibly after symbolic manipulations).
However if I make it scalar instead of an array, everything works fine, try that with InOut.mo.
The InOutArray.mo is a simplified version of a complicated model that is why it looks awkward and silly. With the complicated model I get either
Error: Internal error BackendDAETransform.selectDummyState: no state to select
or
Error: An independent subset of the model has imbalanced number of equations (3) and variables (2).
depending on how I change that complicated model.
Any help is greatly appreciated.
---------------------
For some reason I cannot attach files, it says "Upload error"
InOutArray.mo giving the error:
package InnerOuter
constant Integer C=1;
partial class Equations
inner Real x[C];
inner Real y[C];
replaceable class FirstEq = Eq1;
replaceable class SecondEq = Eq2;
FirstEq eq1;
SecondEq eq2;
end Equations;
partial class Eq1
outer Real x[C];
outer Real y[C];
end Eq1;
partial class Eq2
outer Real x[C];
outer Real y[C];
end Eq2;
class EqA
extends Eq1;
equation
x[1] + y[1] = 1;
end EqA;
class EqB
extends Eq2;
equation
x[1]*x[1] + y[1]*y[1] = 1;
end EqB;
end InnerOuter;
model InOut
import InnerOuter.*;
class Main
extends Equations;
redeclare class FirstEq = EqA;
redeclare class SecondEq = EqB;
end Main;
Main m;
end InOut;
-----------
InOut.mo, basicly the same as above but this one works:
package InnerOuter
partial class Equations
inner Real x;
inner Real y;
replaceable class FirstEq = Eq1;
replaceable class SecondEq = Eq2;
FirstEq eq1;
SecondEq eq2;
end Equations;
partial class Eq1
outer Real x;
outer Real y;
end Eq1;
partial class Eq2
outer Real x;
outer Real y;
end Eq2;
class EqA
extends Eq1;
equation
x + y = 1;
end EqA;
class EqB
extends Eq2;
equation
x*x + y*y = 1;
end EqB;
end InnerOuter;
model InOut
import InnerOuter.*;
class Main
extends Equations;
redeclare class FirstEq = EqA;
redeclare class SecondEq = EqB;
end Main;
Main m;
end InOut;
Re: Is it a compiler bug?
Hi,
it looks like a error in the frontend:
class InOut
Real m.x[1];
Real m.y[1];
equation
m.eq1.x[1] + m.eq1.y[1] = 1.0;
m.eq2.x[1] ^ 2.0 + m.eq2.y[1] ^ 2.0 = 1.0;
end InOut;
because m.eq1.x, m.eq1.y, m.eq2.x and m.eq2.y are unkown variables.
- Index
- » Developer
- » OpenModelica development
- » Is it a compiler bug?