#2612 closed defect (fixed)
dcpm model gives wrong results for 'wMechanical'
Reported by: | Owned by: | Willi Braun | |
---|---|---|---|
Priority: | blocker | Milestone: | |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | christian.potthast@…, Willi Braun, Lennart Ochel, Adrian Pop |
Description
Please find attached a test model, where the dcpm model (Electrical.Machines.BasicMachines.DCMachines.DC_PermanentMagnet) gives a wrong result for the angular velocity (dcpm.wMechanical).
(I assume that OpenModelica is wrong here, because Dymola and SimulationX produce the same result which significantly differs from OpenModelica.)
MSL version: 3.2.1
Dymola version: 2014 FD01
SimulationX version: 3.6.1.26028
OMEdit version: 1.9.1 (r18938)
Attached files:
testmotor_3.mo
Dymola_result.png
OM_result.png
OM_OutputMessages.png
Attachments (4)
Change History (21)
by , 11 years ago
Attachment: | testmotor_3.mo added |
---|
comment:1 by , 11 years ago
Cc: | added |
---|
This might be because of one of the many warnings triggered. First of all, many variables have start-value out of bounds.
<ScalarVariable name = "dcpm.coreParameters.wRef" useStart="true" start="0.0" min="1e-60" unit="rad/s" displayUnit="rad/s" />
There seems to be a front-end/back-end warning missing regarding this, and could certainly cause unexpected results...
comment:2 by , 11 years ago
Component: | Run-time → Backend |
---|---|
Keywords: | zerocrossings added; dcpm wMechanical removed |
Owner: | changed from | to
Status: | new → accepted |
There are im Dymola events, which even not occur for us as zero-crossings.
comment:3 by , 11 years ago
It's really strange Dymola has the following events:
Expression dcpm.la.i > dcpm.brush.brushParameters.ILinear became true ( (dcpm.la.i) - (dcpm.brush.brushParameters.ILinear) = 1.38045e-12 ) Iterating to find consistent restart conditions. during event at Time : 0.1019447655784616 Expression dcpm.la.i > dcpm.brush.brushParameters.ILinear became false ( (dcpm.la.i) - (dcpm.brush.brushParameters.ILinear) = -1.29292e-10 ) Iterating to find consistent restart conditions.
But this expressions are inside a function:
function Modelica.Electrical.Machines.Losses.DCMachines.brushVoltageDrop \"Voltage drop of carbon brushes\" input Modelica.Electrical.Machines.Losses.BrushParameters brushParameters \"Brush loss parameters\"; input Real i(quantity = \"ElectricCurrent\", unit = \"A\") \"Actual current\"; output Real v(quantity = \"ElectricPotential\", unit = \"V\") \"Voltage drop\"; algorithm if brushParameters.V <= 0.0 then v := 0.0; else v := if i > brushParameters.ILinear then brushParameters.V else if i < (-brushParameters.ILinear) then -brushParameters.V else brushParameters.V * i / brushParameters.ILinear; end if; end Modelica.Electrical.Machines.Losses.DCMachines.brushVoltageDrop;
So they should never generate events!?
comment:4 by , 11 years ago
Functions may only generate events if they are inlined and annotation GenerateEvents=true
. This function uses neither.
comment:5 by , 11 years ago
Okay, we end-up in different flat equation. Dymola has:
dcpm.brush.v := smooth(1, (if dcpm.la.i > dcpm.brush.brushParameters.ILinear then 0.7 else (if dcpm.la.i < -dcpm.brush.brushParameters.ILinear then -0.7 else 0.7*dcpm.la.i/dcpm.brush.brushParameters.ILinear)));
and we get:
dcpm.brush.v = 0.0;
That's also the reason why we haven't that events.
comment:6 by , 11 years ago
Component: | Backend → Frontend |
---|---|
Keywords: | zerocrossings removed |
comment:7 by , 11 years ago
Cc: | added |
---|
comment:8 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:9 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:11 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | accepted → assigned |
comment:12 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | assigned → accepted |
comment:15 by , 9 years ago
Owner: | changed from | to
---|
It seems that this has been fixed, perhaps by #3791.
comment:16 by , 9 years ago
Component: | Frontend → Backend |
---|---|
Resolution: | → fixed |
Status: | accepted → closed |
Testmodel for dcpm model