Library mode and new icons
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
within BondGraph;
|
||||
package BondGraphLib
|
||||
|
||||
connector BondPort "Bond graph power port"
|
||||
@@ -23,7 +24,8 @@ package BondGraphLib
|
||||
end for;
|
||||
f = P[1].f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "1")}));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "1"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end J1;
|
||||
|
||||
model J0 "Bond graph 0-junction (common effort, flows sum to zero)"
|
||||
@@ -43,7 +45,8 @@ package BondGraphLib
|
||||
end for;
|
||||
e = P[1].e;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "0")}));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "0"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end J0;
|
||||
|
||||
partial model OnePortPassive "One-port passive bond graph element"
|
||||
@@ -65,7 +68,8 @@ package BondGraphLib
|
||||
der(state) = p.f;
|
||||
p.e = state / c;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "C")}));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "C"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end C;
|
||||
|
||||
model I "Bond graph I element"
|
||||
@@ -76,7 +80,8 @@ package BondGraphLib
|
||||
der(state) = p.e;
|
||||
p.f = state / I;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "I")}));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "I"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end I;
|
||||
|
||||
model R "Bond graph resistor"
|
||||
@@ -85,7 +90,8 @@ package BondGraphLib
|
||||
equation
|
||||
p.e = R * p.f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "R")}));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "R"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end R;
|
||||
|
||||
model Se "Effort source"
|
||||
@@ -95,7 +101,8 @@ package BondGraphLib
|
||||
equation
|
||||
p.e = e0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Se")}));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Se"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end Se;
|
||||
|
||||
model Sf "Flow source"
|
||||
@@ -105,7 +112,8 @@ package BondGraphLib
|
||||
equation
|
||||
p.f = f0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Sf")}));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Sf"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end Sf;
|
||||
|
||||
model TF "Bond graph transformer"
|
||||
@@ -119,7 +127,8 @@ package BondGraphLib
|
||||
p1.e = n * p2.e;
|
||||
p2.f = n * p1.f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "TF")}));
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "TF"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end TF;
|
||||
|
||||
model GY "Bond graph gyrator"
|
||||
@@ -132,7 +141,8 @@ package BondGraphLib
|
||||
p1.e = r * p2.f;
|
||||
p2.e = r * p1.f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "GY")}));
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "GY"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end GY;
|
||||
|
||||
model mSe "Bond graph modulated effort source"
|
||||
@@ -144,7 +154,8 @@ package BondGraphLib
|
||||
equation
|
||||
p.e = e0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSe")}));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSe"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end mSe;
|
||||
|
||||
model mSf "Bond graph modulated flow source"
|
||||
@@ -156,7 +167,8 @@ package BondGraphLib
|
||||
equation
|
||||
p.f = f0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSf")}));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSf"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end mSf;
|
||||
|
||||
model mTF "Bond graph modulated transformer"
|
||||
@@ -171,7 +183,7 @@ package BondGraphLib
|
||||
p2.f = m * p1.f;
|
||||
annotation(
|
||||
Diagram(graphics),
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mTF")}));
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mTF"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}));
|
||||
end mTF;
|
||||
|
||||
model mGY "Bond graph modulated gyrator"
|
||||
@@ -186,33 +198,34 @@ package BondGraphLib
|
||||
p2.e = m * p1.f;
|
||||
annotation(
|
||||
Diagram(graphics),
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mGY")}));
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mGY"), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}));
|
||||
end mGY;
|
||||
|
||||
model fsensor
|
||||
BondPort p annotation(
|
||||
Placement(transformation(origin = {-44, 18}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-80, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||
Placement(transformation(origin = {-44, 18}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-52, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||
Modelica.Blocks.Interfaces.RealOutput f "Flow output" annotation(
|
||||
Placement(transformation(origin = {-8, -64}, extent = {{-20, -20}, {20, 20}}), iconTransformation(origin = {82, 0}, extent = {{-8, -8}, {8, 8}})));
|
||||
Placement(transformation(origin = {-8, -64}, extent = {{-20, -20}, {20, 20}}), iconTransformation(origin = {58, 0}, extent = {{-8, -8}, {8, 8}})));
|
||||
equation
|
||||
// Ideal flow sensor in bond-graph form: zero effort loading.
|
||||
p.e = 0;
|
||||
f = p.f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "f", textStyle = {TextStyle.Italic})}));
|
||||
Icon(graphics = {Text(origin = {-10, 0}, extent = {{-50, 60}, {50, -60}}, textString = "f", textStyle = {TextStyle.Italic}), Ellipse(origin = {-2, 0}, lineThickness = 5, extent = {{-50, 50}, {50, -50}})}));
|
||||
end fsensor;
|
||||
|
||||
model esensor
|
||||
BondPort p annotation(
|
||||
Placement(transformation(origin = {-44, 18}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-80, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||
Placement(transformation(origin = {-44, 18}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-52, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||
Modelica.Blocks.Interfaces.RealOutput e "Effort output" annotation(
|
||||
Placement(transformation(origin = {-8, -64}, extent = {{-20, -20}, {20, 20}}), iconTransformation(origin = {82, 0}, extent = {{-8, -8}, {8, 8}})));
|
||||
Placement(transformation(origin = {-8, -64}, extent = {{-20, -20}, {20, 20}}), iconTransformation(origin = {58, 0}, extent = {{-8, -8}, {8, 8}})));
|
||||
equation
|
||||
// Ideal effort sensor in bond-graph form: zero flow loading.
|
||||
p.f = 0;
|
||||
e = p.e;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "e", textStyle = {TextStyle.Italic})}));
|
||||
Icon(graphics = {Text(origin = {-10, 0}, extent = {{-50, 60}, {50, -60}}, textString = "e", textStyle = {TextStyle.Italic}), Ellipse(origin = {-2, 0}, lineThickness = 5, extent = {{-50, 50}, {50, -50}})}),
|
||||
Diagram(graphics));
|
||||
end esensor;
|
||||
|
||||
annotation(
|
||||
18
BondGraph/BondGraphLib/package.order
Normal file
18
BondGraph/BondGraphLib/package.order
Normal file
@@ -0,0 +1,18 @@
|
||||
BondPort
|
||||
J1
|
||||
J0
|
||||
OnePortPassive
|
||||
OnePortEnergetic
|
||||
C
|
||||
I
|
||||
R
|
||||
Se
|
||||
Sf
|
||||
TF
|
||||
GY
|
||||
mSe
|
||||
mSf
|
||||
mTF
|
||||
mGY
|
||||
fsensor
|
||||
esensor
|
||||
@@ -1,3 +1,4 @@
|
||||
within BondGraph;
|
||||
package BondGraphLib2D
|
||||
|
||||
connector BondPort "Bond graph 2D multibond power port"
|
||||
@@ -25,7 +26,7 @@ package BondGraphLib2D
|
||||
end for;
|
||||
f = P[1].f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "1", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "1", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}));
|
||||
end J1;
|
||||
|
||||
model J0 "Bond graph 2D 0-junction (common effort, flows sum to zero)"
|
||||
@@ -47,7 +48,8 @@ package BondGraphLib2D
|
||||
end for;
|
||||
e = P[1].e;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "0", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "0", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end J0;
|
||||
|
||||
partial model OnePortPassive "One-port passive 2D multibond element"
|
||||
@@ -69,7 +71,8 @@ package BondGraphLib2D
|
||||
der(state) = p.f;
|
||||
c * p.e = state;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "C", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "C", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end C;
|
||||
|
||||
model I "Bond graph 2D I element"
|
||||
@@ -80,7 +83,8 @@ package BondGraphLib2D
|
||||
der(state) = p.e;
|
||||
I * p.f = state;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "I", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "I", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end I;
|
||||
|
||||
model R "Bond graph 2D resistor"
|
||||
@@ -89,7 +93,8 @@ package BondGraphLib2D
|
||||
equation
|
||||
p.e = R * p.f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "R", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-100, 100}, {100, -100}}, textString = "R", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end R;
|
||||
|
||||
model Se "Effort source"
|
||||
@@ -99,7 +104,8 @@ package BondGraphLib2D
|
||||
equation
|
||||
p.e = e0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Se", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Se", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end Se;
|
||||
|
||||
model Sf "Flow source"
|
||||
@@ -109,7 +115,8 @@ package BondGraphLib2D
|
||||
equation
|
||||
p.f = f0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Sf", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "Sf", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end Sf;
|
||||
|
||||
model TF "Bond graph 2D transformer"
|
||||
@@ -123,7 +130,8 @@ package BondGraphLib2D
|
||||
p1.e = n * p2.e;
|
||||
transpose(n) * p1.f = p2.f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "TF", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "TF", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end TF;
|
||||
|
||||
model GY "Bond graph 2D gyrator"
|
||||
@@ -136,7 +144,8 @@ package BondGraphLib2D
|
||||
p1.e = r * p2.f;
|
||||
p2.e = transpose(r) * p1.f;
|
||||
annotation(
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "GY", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-80, 100}, {80, -100}}, textString = "GY", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end GY;
|
||||
|
||||
model mSe "Bond graph modulated effort source"
|
||||
@@ -148,7 +157,8 @@ package BondGraphLib2D
|
||||
equation
|
||||
p.e = e0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSe", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSe", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end mSe;
|
||||
|
||||
model mSf "Bond graph modulated flow source"
|
||||
@@ -160,7 +170,8 @@ package BondGraphLib2D
|
||||
equation
|
||||
p.f = f0;
|
||||
annotation(
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSf", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(origin = {-20, 0}, extent = {{-80, 100}, {80, -100}}, textString = "mSf", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}),
|
||||
Diagram(graphics));
|
||||
end mSf;
|
||||
|
||||
model mTF "Bond graph modulated transformer"
|
||||
@@ -175,7 +186,7 @@ package BondGraphLib2D
|
||||
transpose(m) * p1.f = p2.f;
|
||||
annotation(
|
||||
Diagram(graphics),
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mTF", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mTF", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}));
|
||||
end mTF;
|
||||
|
||||
model mGY "Bond graph modulated gyrator"
|
||||
@@ -190,7 +201,7 @@ package BondGraphLib2D
|
||||
p2.e = transpose(m) * p1.f;
|
||||
annotation(
|
||||
Diagram(graphics),
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mGY", textStyle = {TextStyle.Bold, TextStyle.UnderLine}) }));
|
||||
Icon(graphics = {Text(extent = {{-60, 100}, {60, -100}}, textString = "mGY", textStyle = {TextStyle.Bold, TextStyle.UnderLine}), Text(origin = {50, 80}, textColor = {0, 0, 255}, extent = {{-50, 20}, {50, -20}}, textString = "%name")}));
|
||||
end mGY;
|
||||
|
||||
package TransRotUtils
|
||||
17
BondGraph/BondGraphLib2D/package.order
Normal file
17
BondGraph/BondGraphLib2D/package.order
Normal file
@@ -0,0 +1,17 @@
|
||||
BondPort
|
||||
J1
|
||||
J0
|
||||
OnePortPassive
|
||||
OnePortEnergetic
|
||||
C
|
||||
I
|
||||
R
|
||||
Se
|
||||
Sf
|
||||
TF
|
||||
GY
|
||||
mSe
|
||||
mSf
|
||||
mTF
|
||||
mGY
|
||||
TransRotUtils
|
||||
10
BondGraph/package.mo
Normal file
10
BondGraph/package.mo
Normal file
@@ -0,0 +1,10 @@
|
||||
within ;
|
||||
package BondGraph
|
||||
extends Modelica.Icons.Package;
|
||||
|
||||
|
||||
|
||||
annotation(
|
||||
Diagram(graphics),
|
||||
Icon(graphics = {Line(origin = {-45.22, 20.19}, points = {{-50.7774, -20.1934}, {21.2226, -20.1934}, {-38.7774, 19.8066}}, thickness = 5), Line(origin = {-9.81, -8.19}, points = {{-10.1934, 48.1934}, {-10.1934, -31.8066}}, thickness = 5), Line(origin = {156.78, 20.19}, points = {{-60.7774, -20.1934}, {-134.777, -20.1934}, {-76.7774, 19.8066}}, thickness = 5), Line(origin = {28.19, -8.19}, points = {{-10.1934, 48.1934}, {-10.1934, -31.8066}}, thickness = 5), Line(origin = {66, 12}, points = {{-26, 0}, {30, 0}}, thickness = 5)}));
|
||||
end BondGraph;
|
||||
2
BondGraph/package.order
Normal file
2
BondGraph/package.order
Normal file
@@ -0,0 +1,2 @@
|
||||
BondGraphLib2D
|
||||
BondGraphLib
|
||||
28
test.mo
Normal file
28
test.mo
Normal file
@@ -0,0 +1,28 @@
|
||||
model test
|
||||
BondGraphLib.J1 j1(Nin = 1, Nout = 3) annotation(
|
||||
Placement(transformation(extent = {{-10, -10}, {10, 10}})));
|
||||
BondGraphLib.R r annotation(
|
||||
Placement(transformation(origin = {0, 40}, extent = {{-10, -10}, {10, 10}})));
|
||||
BondGraphLib.C c(c = 0.5) annotation(
|
||||
Placement(transformation(origin = {0, -40}, extent = {{-10, -10}, {10, 10}})));
|
||||
Modelica.Blocks.Sources.Step step(height = 1, startTime = 1) annotation(
|
||||
Placement(transformation(origin = {-90, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||
BondGraphLib.mSe mSe annotation(
|
||||
Placement(transformation(origin = {-40, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||
BondGraphLib.I i(I = 0.1) annotation(
|
||||
Placement(transformation(origin = {40, 0}, extent = {{-10, -10}, {10, 10}})));
|
||||
equation
|
||||
connect(j1.Pout[1], c.p) annotation(
|
||||
Line(points = {{0, 8}, {0, -32}}, color = {0, 0, 127}));
|
||||
connect(j1.Pout[2], r.p) annotation(
|
||||
Line(points = {{0, 8}, {0, 48}}, color = {0, 0, 127}));
|
||||
connect(mSe.p, j1.Pin[1]) annotation(
|
||||
Line(points = {{-32, 0}, {0, 0}, {0, 8}}, color = {0, 0, 127}));
|
||||
connect(step.y, mSe.e0) annotation(
|
||||
Line(points = {{-78, 0}, {-40, 0}, {-40, -8}}, color = {0, 0, 127}));
|
||||
connect(i.p, j1.Pout[3]) annotation(
|
||||
Line(points = {{40, 8}, {40, 0}, {0, 0}, {0, 8}}, color = {0, 0, 127}));
|
||||
annotation(
|
||||
uses(Modelica(version = "4.1.0")),
|
||||
experiment(StartTime = 0, StopTime = 12, Tolerance = 1e-06, Interval = 0.024));
|
||||
end test;
|
||||
@@ -1,4 +1,7 @@
|
||||
model test2d
|
||||
import BondGraphLib = BondGraph.BondGraphLib;
|
||||
import BondGraphLib2D = BondGraph.BondGraphLib2D;
|
||||
|
||||
BondGraphLib.J1 w_com(N = 3, s = {1, -1, -1}) annotation(
|
||||
Placement(transformation(origin = {0, 120}, extent = {{-10, -10}, {10, 10}})));
|
||||
BondGraphLib.Sf sf(f0 = 1) annotation(
|
||||
@@ -40,8 +43,6 @@ equation
|
||||
Line(points = {{40, 40}, {40, 8}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
|
||||
connect(v_p_bff.P[2], rTF1.p1) annotation(
|
||||
Line(points = {{-40, 40}, {-40, 8}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
|
||||
connect(w_com.P[3], wsensor.p) annotation(
|
||||
Line(points = {{0, 120}, {42, 90}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
|
||||
connect(wsensor.f, w2phi.u) annotation(
|
||||
Line(points = {{58, 90}, {78, 90}}, color = {0, 0, 127}));
|
||||
connect(w2phi.y, rTF1.phi) annotation(
|
||||
@@ -54,10 +55,12 @@ equation
|
||||
Line(origin = {1, 0},points = {{40, -8}, {40, -40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
|
||||
connect(v_com_in.P[2], mass.p) annotation(
|
||||
Line(points = {{40, -40}, {80, -40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
|
||||
connect(w_com.P[3], wsensor.p) annotation(
|
||||
Line(points = {{0, 120}, {44, 90}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
|
||||
annotation(
|
||||
uses(Modelica(version = "4.1.0")),
|
||||
experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-06, Interval = 0.02),
|
||||
Diagram(coordinateSystem(extent = {{-60, 140}, {120, -60}}), graphics = {Text(origin = {-40, -52}, extent = {{-12, 4}, {12, -4}}, textString = "v_p"), Text(origin = {40, -52}, extent = {{-12, 4}, {12, -4}}, textString = "v_com"), Text(origin = {0, 134}, extent = {{-12, 4}, {12, -4}}, textString = "w_com")}),
|
||||
Diagram(coordinateSystem(extent = {{-60, 140}, {120, -60}})),
|
||||
Icon(coordinateSystem(extent = {{-200, -200}, {200, 200}})),
|
||||
version = "");
|
||||
end test2d;
|
||||
Reference in New Issue
Block a user