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} connects: {} */;
  e.port.f = 0.0 " add inside flow(e.port.f)" /* models: {Conn} connects: {} */;
  e.d.port.f = 0.0 " add inside flow(e.d.port.f)" /* models: {Conn} connects: {} */;
  (-e.port.f) + e.d.port.f = 0.0 " add inside flow(e.d.port.f)" /* models: {E, Conn} connects: {connect(d.port.f,port.f)} */;
  e.d.port.p = e.port.p /* models: {E} connects: {connect(e.d.port.p,e.port.p), connect(d.port.p,port.p)} */;
end F;

New output from +d=showEquationSource.
So it seems e.d.port.f is added as inside flow to a set in Conn, then the connect comes in E, which adds the port.f to the same connection set but somehow the old connection set is still kept. It might be something wrong with the prefixing.

Last edited 12 years ago by Adrian Pop (previous) (diff)

comment:2 by Per Östlund, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r13982.

Note: See TracTickets for help on using tickets.