Files
BondGraph/test2d.mo
2026-03-08 23:43:57 +01:00

63 lines
4.7 KiB
Plaintext

model test2d
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(
Placement(transformation(origin = {50, 120}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
BondGraphLib2D.TransRotUtils.mTFrot2lin mTFrot2lin(r_body = {0.1, 0}) annotation(
Placement(transformation(origin = {0, 80}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
BondGraphLib2D.J0 j0(N = 3, s = {1, 1, -1}) annotation(
Placement(transformation(origin = {0, 40}, extent = {{-10, -10}, {10, 10}})));
BondGraphLib2D.J1 v_p_bff(N = 2, s = {1, -1}) annotation(
Placement(transformation(origin = {-40, 40}, extent = {{-10, -10}, {10, 10}})));
BondGraphLib2D.J1 v_com_bff(N = 2, s = {-1, -1}) annotation(
Placement(transformation(origin = {40, 40}, extent = {{-10, -10}, {10, 10}})));
BondGraphLib2D.TransRotUtils.rTF rTF annotation(
Placement(transformation(origin = {40, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
BondGraphLib2D.TransRotUtils.rTF rTF1 annotation(
Placement(transformation(origin = {-40, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));
BondGraphLib.fsensor wsensor annotation(
Placement(transformation(origin = {50, 90}, extent = {{-10, -10}, {10, 10}})));
Modelica.Blocks.Continuous.Integrator w2phi annotation(
Placement(transformation(origin = {90, 90}, extent = {{-10, -10}, {10, 10}})));
BondGraphLib2D.J1 v_y_in(N = 1, s = {1}) annotation(
Placement(transformation(origin = {-40, -40}, extent = {{-10, -10}, {10, 10}})));
BondGraphLib2D.J1 v_com_in(N = 2, s = {1, -1}) annotation(
Placement(transformation(origin = {40, -40}, extent = {{-10, -10}, {10, 10}})));
BondGraphLib2D.I mass annotation(
Placement(transformation(origin = {80, -40}, extent = {{-10, -10}, {10, 10}})));
equation
connect(sf.p, w_com.P[1]) annotation(
Line(points = {{42, 120}, {0, 120}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
connect(w_com.P[2], mTFrot2lin.pR) annotation(
Line(points = {{0, 120}, {0, 88}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
connect(mTFrot2lin.pT, j0.P[1]) annotation(
Line(points = {{0, 72}, {0, 40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
connect(v_com_bff.P[1], j0.P[2]) annotation(
Line(points = {{40, 40}, {0, 40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
connect(j0.P[3], v_p_bff.P[1]) annotation(
Line(origin = {-1, 0},points = {{0, 40}, {-40, 40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
connect(v_com_bff.P[2], rTF.p1) annotation(
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(
Line(points = {{102, 90}, {110, 90}, {110, 20}, {0, 20}, {0, 0}, {-32, 0}}, color = {0, 0, 127}, arrow = {Arrow.None, Arrow.Filled}));
connect(w2phi.y, rTF.phi) annotation(
Line(points = {{102, 90}, {110, 90}, {110, 20}, {0, 20}, {0, 0}, {32, 0}}, color = {0, 0, 127}, arrow = {Arrow.None, Arrow.Filled}));
connect(rTF1.p2, v_y_in.P[1]) annotation(
Line(points = {{-40, -8}, {-40, -40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6));
connect(rTF.p2, v_com_in.P[1]) annotation(
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));
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")}),
Icon(coordinateSystem(extent = {{-200, -200}, {200, 200}})),
version = "");
end test2d;