#2612 closed defect (fixed)
dcpm model gives wrong results for 'wMechanical'
Reported by: | christian.potthast@… | Owned by: | wbraun |
---|---|---|---|
Priority: | blocker | Milestone: | |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | christian.potthast@…, wbraun, lochel, adrpo |
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)
Changed 11 years ago by anonymous
comment:1 Changed 11 years ago by sjoelund.se
- Cc wbraun lochel 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 Changed 11 years ago by wbraun
- Component changed from Run-time to Backend
- Keywords zerocrossings added; dcpm wMechanical removed
- Owner changed from Potthast to wbraun
- Status changed from new to accepted
There are im Dymola events, which even not occur for us as zero-crossings.
comment:3 Changed 11 years ago by wbraun
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 Changed 11 years ago by sjoelund.se
Functions may only generate events if they are inlined and annotation GenerateEvents=true. This function uses neither.
comment:5 Changed 11 years ago by wbraun
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 Changed 11 years ago by wbraun
- Component changed from Backend to Frontend
- Keywords zerocrossings removed
comment:7 Changed 11 years ago by wbraun
- Cc adrpo added
comment:8 Changed 10 years ago by sjoelund.se
- Milestone changed from 1.9.1 to 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 Changed 10 years ago by sjoelund.se
- Milestone changed from 1.9.2 to 1.9.3
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:10 Changed 9 years ago by sjoelund.se
- Milestone changed from 1.9.3 to 1.9.4
Moved to new milestone 1.9.4
comment:11 Changed 9 years ago by wbraun
- Owner changed from wbraun to somebody
- Status changed from accepted to assigned
comment:12 Changed 9 years ago by adrpo
- Owner changed from somebody to adrpo
- Status changed from assigned to accepted
comment:13 Changed 9 years ago by sjoelund.se
- Milestone changed from 1.9.4 to 1.9.5
Milestone pushed to 1.9.5
comment:14 Changed 9 years ago by sjoelund.se
- Milestone changed from 1.9.5 to 1.10.0
Milestone renamed
comment:15 Changed 8 years ago by wbraun
- Owner changed from adrpo to wbraun
It seems that this has been fixed, perhaps by #3791.
comment:16 Changed 8 years ago by wbraun
- Component changed from Frontend to Backend
- Resolution set to fixed
- Status changed from accepted to closed
Testmodel for dcpm model