-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Milestone
Description
Consider the two following models.
model Balance9
connector Pin
Real v;
flow Real i;
end Pin;
model Ground
Pin p;
equation
p.v = 0;
end Ground;
model Nand
Pin x1;
Pin y;
equation
x1.v = y.v;
0 = x1.i + y.i;
end Nand;
Ground Gnd4;
Nand nand;
equation
connect(Gnd4.p, nand.x1);
end Balance9;
and
model Balance12
connector Frame
Orientation R;
flow Real f;
end Frame;
record Orientation
Real w[2];
function equalityConstraint
input Orientation R1;
input Orientation R2;
output Real residue[1];
algorithm
residue := {0};
end equalityConstraint;
end Orientation;
model M
Frame f;
equation
Connections.root(f.R);
f.R = Orientation(w = zeros(2));
end M;
model A
Frame frame_a;
Frame frame_b;
equation
Connections.branch(frame_a.R, frame_b.R);
frame_b.R = frame_a.R;
0 = frame_a.f + frame_b.f;
end A;
M m;
A a;
equation
connect(m.f, a.frame_a);
end Balance12;
Both models have the same structure, the difference is that one of the connectors is overdetermined.
As a result, I would expect both models to have the same number of variables at the top level.
But the number of equations generated by the connectors, at the top level is:
for Balance9
- from
Gnd4.p
andnand.x1
1
flow equation and1
potential equation - from
nand.y
1
flow equation
for Balance12
- from
m.f
anda.frame_a
1
flow equation and2
potential equations - from
a.frame_b
1
flow equation
Which would make Balance9
locally balanced and Balance12
locally imbalanced, although I would expect both to be balanced since they are simpler versions of models present in the MSL.
What am I missing?
Metadata
Metadata
Assignees
Labels
No labels