Opened 7 years ago
Closed 7 years ago
#4634 closed defect (fixed)
Modelica.Electrical.Machines.Sensors.ElectricalPowerSensor not working properly
Reported by: | Owned by: | Patrick Täuber | |
---|---|---|---|
Priority: | high | Milestone: | 1.13.0 |
Component: | Backend | Version: | v1.13.0-dev-nightly |
Keywords: | Cc: | Francesco Casella, Lennart Ochel |
Description
The attached model uses the Modelica.Electrical.Machines.Sensors.ElectricalPowerSensor elements. Instead of producing "power" as a single trace they often oscillate at the base frequency. The attached file has two figures (as PNG), one from JModelica showing the correct behavior and the other from OpenModelica showing that one of the power sensor elements is behaving correctly and the other is not. As I change the model, which ones behave incorrectly seems to change at random.
I am using: OpenModelica-v1.13.0-dev-255-g6f71dc5-64bit.exe
The attached file contains the model (3 .mo files) and the two result files.
Attachments (1)
Change History (6)
by , 7 years ago
Attachment: | SimpleSynch3.zip added |
---|
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Cc: | added |
---|
Comparing the result of the FMU and OM, it seems that in the first time-step we calculate identical results. But it seems that electricalPowerSensorGen.v_
is marked as not continuous-time and it is never re-calculated. I'm not yet sure why this happens since the statement is (electricalPowerSensorGen.v_, _) := Modelica.Electrical.Machines.SpacePhasors.Functions.ToSpacePhasor({-resistorLoad.v[1], -resistorLoad.v[2], -resistorLoad.v[3]});
and this expression is continuous-time.
comment:3 by , 7 years ago
If you add the following flag to OM, you get the expected results:
--postOptModules-=wrapFunctionCalls
@lochel @casella - can you whip the responsible developer into fixing this bug?
comment:4 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 7 years ago
Component: | *unknown* → Backend |
---|---|
Milestone: | Future → 1.13.0 |
Resolution: | → fixed |
Status: | assigned → closed |
wrapFunctionCalls
works fine, the problem was the equation electricalPowerSensorSine.v_=electricalPowerSensorGen.v_
, which was correctly created by WFC but solved for the wrong variable, although the matching was correct.
OMCompiler/5cea0b5 should fix this problem.
Please reopen the ticket if you still experience problems.
So it is the following that is solved:
OM calculates:
With
i_[n]
being slightly out of phase which seem reasonable. Do you have the actual result-file from JModelica including protected variables?