Opened 16 years ago
Last modified 14 years ago
#1094 closed defect (fixed)
Modelica.Blocks.Interfaces.RealInput
Reported by: | Schubert TUD | Owned by: | Schubert TUD |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Schubert TUD, |
Description
Hi,
I tried to use Modelica.Blocks.Interfaces.RealInput in my model. Unfortunately, the simulation failed because of too few equations. Below there is an example illustrating the problem. (The firstOrder Block does not have any infkuence on the error.) It seems that Modelica.Blocks.Interfaces.RealInput is defined in an unusual way, which confuses OpenModelica. If you look at the flattened code using 'instantiateModel', it emerges that the omc flattens 'RealInput u' to 'Real u' instead of 'input Real u'. I also cross-checked with Dymola and it worked fine.
Regards,
Christian Schubert
works, 2 equations and 2 variables
model RealInputOK
input Real u;
Modelica.Blocks.Continuous.FirstOrder firstOrder;
equation
connect(u, firstOrder.u);
end RealInputOK;
fails, 3 equations and 2 variables
connector RealInput = input Real; from Modelica.Blocks.Interfaces.RealInput
model RealInputFail
RealInput u;
Modelica.Blocks.Continuous.FirstOrder firstOrder;
equation
connect(u.x, firstOrder.u);
end RealInputFail;
I'll assume there was a typo and it was supposed to be connect(u, ...) and not u.x, which does not exist.
Anyway, it works in the trunk.