model test2d import _1D = BondGraph._1D; import _2D = BondGraph._2D; _1D.J1 w_com(N = 4, s = {1, -1, -1, -1}) annotation( Placement(transformation(origin = {0, 120}, extent = {{-10, -10}, {10, 10}}))); _2D.TransRotUtils.mTFrot2lin mTFrot2lin(r_body = {0.5, 0}) annotation( Placement(transformation(origin = {0, 80}, extent = {{-10, -10}, {10, 10}}, rotation = -90))); _2D.J0 j0(N = 3, s = {1, 1, -1}) annotation( Placement(transformation(origin = {0, 40}, extent = {{-10, -10}, {10, 10}}))); _2D.J1 v_p_bff(N = 2, s = {1, 1}) annotation( Placement(transformation(origin = {-40, 40}, extent = {{-10, -10}, {10, 10}}))); _2D.J1 v_com_bff(N = 2, s = {-1, -1}) annotation( Placement(transformation(origin = {40, 40}, extent = {{-10, -10}, {10, 10}}))); _2D.TransRotUtils.rTF rTF annotation( Placement(transformation(origin = {40, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); _1D.fsensor wsensor annotation( Placement(transformation(origin = {50, 90}, extent = {{-10, -10}, {10, 10}}))); Modelica.Blocks.Continuous.Integrator w2phi(k = 1) annotation( Placement(transformation(origin = {90, 90}, extent = {{-10, -10}, {10, 10}}))); _2D.J1 v_com_in(N = 4, s = {1, -1, 1, 1}) annotation( Placement(transformation(origin = {40, -40}, extent = {{-10, -10}, {10, 10}}))); _2D.I mass(I = [1, 0; 0, 1]) annotation( Placement(transformation(origin = {80, -40}, extent = {{-10, -10}, {10, 10}}))); BondGraph._2D.Sf ground(f0 = {0, 0}) annotation( Placement(transformation(origin = {-80, 40}, extent = {{-10, -10}, {10, 10}}))); BondGraph._1D.I m_inertial(I = 0.001) annotation( Placement(transformation(origin = {40, 120}, extent = {{-10, -10}, {10, 10}}))); BondGraph._1D.Sf ground2(f0 = 0) annotation( Placement(transformation(origin = {-80, 120}, extent = {{-10, -10}, {10, 10}}))); BondGraph._1D.J0 j1(N = 3, s = {1, -1, -1}) annotation( Placement(transformation(origin = {-40, 120}, extent = {{-10, -10}, {10, 10}}))); BondGraph._1D.J1 w_hinge(N = 2, s = {1, -1}) annotation( Placement(transformation(origin = {-40, 90}, extent = {{-10, -10}, {10, 10}}))); BondGraph._1D.R hinge_r(R = 0.08) annotation( Placement(transformation(origin = {-80, 90}, extent = {{-10, -10}, {10, 10}}))); BondGraph._2D.Se g(e0 = {0, -9.81}) annotation( Placement(transformation(origin = {2, -40}, extent = {{-10, -10}, {10, 10}}))); BondGraph._2D.fsensor2d v_inertial annotation( Placement(transformation(origin = {40, -60}, extent = {{-10, -10}, {10, 10}}, rotation = -90))); Modelica.Blocks.Continuous.Integrator vx_to_x(k = 1, y_start = -0.5) annotation( Placement(transformation(origin = {70, -70}, extent = {{-10, -10}, {10, 10}}))); Modelica.Blocks.Continuous.Integrator vy_to_y(k = 1) annotation( Placement(transformation(origin = {70, -100}, extent = {{-10, -10}, {10, 10}}))); vis2d vis2d1 annotation( Placement(transformation(origin = {150, -6}, extent = {{-10, -10}, {10, 10}}))); equation 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(wsensor.f, w2phi.u) annotation( Line(points = {{58, 90}, {78, 90}}, color = {0, 0, 127})); connect(w2phi.y, rTF.phi) annotation( Line(points = {{102, 90}, {110, 90}, {110, 0}, {48, 0}}, color = {0, 0, 127}, arrow = {Arrow.None, Arrow.Filled})); 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}, pattern = LinePattern.Dash, thickness = 0.75, arrow = {Arrow.None, Arrow.Open}, arrowSize = 6)); connect(w_com.P[1], m_inertial.p) annotation( Line(points = {{0, 120}, {40, 120}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6)); connect(ground2.p, j1.P[1]) annotation( Line(points = {{-72, 120}, {-40, 120}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6)); connect(j1.P[2], w_com.P[4]) annotation( Line(points = {{-40, 120}, {0, 120}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.Half, Arrow.None}, arrowSize = 6)); connect(ground.p, v_p_bff.P[2]) annotation( Line(points = {{-72, 40}, {-40, 40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6)); connect(j1.P[3], w_hinge.P[1]) annotation( Line(points = {{-40, 120}, {-40, 90}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6)); connect(w_hinge.P[2], hinge_r.p) annotation( Line(points = {{-40, 90}, {-80, 90}}, color = {0, 0, 127}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6)); connect(g.p, v_com_in.P[3]) annotation( Line(points = {{10, -40}, {40, -40}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6)); connect(v_com_bff.P[2], rTF.p2) annotation( Line(points = {{40, 40}, {40, 8}}, color = {0, 85, 0}, thickness = 0.75, arrow = {Arrow.None, Arrow.Half}, arrowSize = 6)); connect(rTF.p1, v_com_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(v_com_in.P[4], v_inertial.p) annotation( Line(points = {{40, -40}, {40, -54}}, color = {0, 85, 0}, pattern = LinePattern.Dash, thickness = 0.75, arrow = {Arrow.None, Arrow.Open}, arrowSize = 6)); connect(v_inertial.f0, vx_to_x.u) annotation( Line(points = {{42, -66}, {42, -70}, {58, -70}}, color = {0, 0, 127})); connect(v_inertial.f1, vy_to_y.u) annotation( Line(points = {{38, -66}, {38, -100}, {58, -100}}, color = {0, 0, 127})); connect(w2phi.y, vis2d1.phi) annotation( Line(points = {{102, 90}, {110, 90}, {110, 0}, {141, 0}}, color = {0, 0, 127})); connect(vx_to_x.y, vis2d1.x) annotation( Line(points = {{82, -70}, {110, -70}, {110, -6}, {141, -6}}, color = {0, 0, 127})); connect(vy_to_y.y, vis2d1.y) annotation( Line(points = {{82, -100}, {118, -100}, {118, -12}, {141, -12}}, color = {0, 0, 127})); annotation( uses(Modelica(version = "4.1.0")), experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-06, Interval = 0.02), Diagram(coordinateSystem(extent = {{-100, 140}, {160, -120}})), Icon(coordinateSystem(extent = {{-200, -200}, {200, 200}})), version = ""); end test2d;