Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

About overconstrained equaiton operators

About overconstrained equaiton operators

According to the MLS, the "branch" operator define a unbreakable connect.Why this model only generator 3 equations in OpenModelica?

Code:


model BreakBranch
  record Rec
    Real x;
    function equalityConstraint
      input Rec r1;
      input Rec r2;
output Real x[0];
    algorithm
      assert(r1.x > r2.x, "Test");
    end equalityConstraint;
  end Rec;

  connector Con
    Rec r;
  end Con;

  model Source
    Con c;
  equation
    c.r.x = time;
    Connections.root(c.r);
  end Source;

  model A
    Con c1;
    Con c2;
  equation
    Connections.branch(c1.r, c2.r);
  end A;

  model Ground
    Con c;
  end Ground;

  A a;
  Ground g;
  Source s;
equation
  connect(s.c, a.c1);
  connect(a.c1, a.c2);
  connect(a.c2, g.c);
end BreakBranch;

Edited by: YangH - Jan-28-18 06:07:39
There are 0 guests and 0 other users also viewing this topic
You are here: