Opened 12 years ago

Closed 12 years ago

#1945 closed defect (fixed)

unbalanced models by duplicate inheritance

Reported by: Christian Schubert Owned by: Per Östlund
Priority: critical Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: connection unbalanced Cc: Adrian Pop

Description

The attached model F uses duplicate inheritance and generates redundant equations of the form

2 (1): e.port.f = 0.0
3 (1): e.d.port.f = 0.0
4 (1): e.d.port.f - e.port.f = 0.0

where there is one equation too many. This may also be related to Brunos problem.

Attachments (2)

Unbalanced.mo (384 bytes ) - added by Christian Schubert 12 years ago.
Unbalanced.mos (108 bytes ) - added by Christian Schubert 12 years ago.

Download all attachments as: .zip

Change History (4)

by Christian Schubert, 12 years ago

Attachment: Unbalanced.mo added

by Christian Schubert, 12 years ago

Attachment: Unbalanced.mos added

comment:1 by Adrian Pop, 12 years ago

Just a bit more explanation...
This equation should not be generated:

e.d.port.f = 0.0;

Somehow it seems that e.d.port.f is added to a connection set as inside connector because is flow, but then when the connection to e.port.f is done is not detected that we already have a set containing e.d.port.f and a new set is created with the connection to e.port.f.

adrpo@ida-liu050 /c/dev/avm
$ time ~/dev/OpenModelica/build/bin/omc +locale=C +d=showEquationSource Unbalanced.mo
class F
  Real e.port.p "potential Variable";
  Real e.port.f "flow Variable";
  Real e.d.port.p "potential Variable";
  Real e.d.port.f "flow Variable";
equation
  e.d.port.f = e.d.port.p /* models: D */;
  e.port.f = 0.0 " equation generated by unconnected inside flow, maybe connected later" /* models:  */;
  e.d.port.f = 0.0 " equation generated by unconnected inside flow, maybe connected later" /* models:  */;
  (-e.port.f) + e.d.port.f = 0.0 " equation generated by unconnected inside flow, maybe connected later" /* models: E */;
  e.d.port.p = e.port.p /* models: E */;
end F;
Version 0, edited 12 years ago by Adrian Pop (next)

comment:2 by Per Östlund, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r13982.

Note: See TracTickets for help on using tickets.