Opened 12 years ago

Closed 12 years ago

#1987 closed defect (fixed)

Unbalanced model

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

Description

I've found another source of unbalanced models.
Consider the following combination:

  partial block Interface
    input Real x;
    output Real y;
  end Interface;

  block Impl
    extends Interface;
  equation
    y = 2*x;
  end Impl;

  model A
    outer block R = Interface;
    R r(x = 1);
    Real y = r.y;
  end A;

  model B
    inner block R = Impl;
    A a;
    Real xa(start = 1);
  equation
    der(xa) = a.y;
  end B;

When simulating B, omc says the model only got 3 equations but 4 variables.
As far as I can tell, the model should be fine.

Attachments (2)

Bug.mo (404 bytes ) - added by Christian Schubert 12 years ago.
Bug.mos (75 bytes ) - added by Christian Schubert 12 years ago.

Download all attachments as: .zip

Change History (6)

by Christian Schubert, 12 years ago

Attachment: Bug.mo added

by Christian Schubert, 12 years ago

Attachment: Bug.mos added

comment:1 by Jens Frenkel, 12 years ago

for comparison dymolas output

model B

Real a.r.x = 1;
Real a.r.y;
Real a.y = a.r.y;
Real xa(start = 1);

// Equations and algorithms

  // Component a.r
  // class B.R
    // extends Impl
    equation
      a.r.y = 2*a.r.x;
    // end of extends 

  // Component 
  // class B
  equation
    der(xa) = a.y;

end B;

comment:2 by Adrian Pop, 12 years ago

Yep. We don't support inner/outer classes yet.
I'll see if I can add support for this somehow.

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

comment:3 by Adrian Pop, 12 years ago

Hopefully fixed in r14412.

comment:4 by Adrian Pop, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.