I am trying to build a model for "walking sticks". It would look like this when done:
and here is the top part animated (in mathematica):
I built the top part of the top part (z2-z3-z4) but for some reason I get "Model is structurally singular" error. Any idea why would be appreciated.
model WalkingSticks
inner Modelica.Mechanics.MultiBody.World world(gravityType = Modelica.Mechanics.MultiBody.Types.GravityTypes.NoGravity) annotation(Placement(visible = true, transformation(origin = {48, -86}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
parameter Modelica.SIunits.Length z1 = 15;
parameter Modelica.SIunits.Length z2 = 2.78;
parameter Modelica.SIunits.Length z3 = 20.02;
parameter Modelica.SIunits.Length z4 = 12;
parameter Modelica.SIunits.Length z5 = 20.02;
parameter Modelica.SIunits.Length z6 = 12;
parameter Modelica.SIunits.Length d = 0.1;
Modelica.Mechanics.MultiBody.Parts.BodyCylinder Z2(r = {z2, 0, 0}, diameter = d) annotation(Placement(visible = true, transformation(origin = {48, -4}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
Modelica.Mechanics.MultiBody.Joints.Revolute RA0(w.start = 1) annotation(Placement(visible = true, transformation(origin = {48, -44}, extent = {{-10, -10}, {10, 10}}, rotation = -270)));
Modelica.Mechanics.MultiBody.Joints.Revolute R23 annotation(Placement(visible = true, transformation(origin = {26, 22}, extent = {{-10, -10}, {10, 10}}, rotation = -540)));
Modelica.Mechanics.MultiBody.Parts.BodyCylinder Z3(r = {z3, 0, 0}, diameter = d) annotation(Placement(visible = true, transformation(origin = {-20, 22}, extent = {{-10, -10}, {10, 10}}, rotation = -360)));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation(r = {-z1, 0, 0}) annotation(Placement(visible = true, transformation(origin = {0, -72}, extent = {{-10, -10}, {10, 10}}, rotation = -180)));
Modelica.Mechanics.MultiBody.Parts.BodyCylinder Z4(r = {z4, 0, 0}, diameter = d) annotation(Placement(visible = true, transformation(origin = {-56, -40}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Mechanics.MultiBody.Joints.Revolute R34 annotation(Placement(visible = true, transformation(origin = {-56, 4}, extent = {{-10, -10}, {10, 10}}, rotation = -450)));
Modelica.Mechanics.MultiBody.Joints.Revolute RB0 annotation(Placement(visible = true, transformation(origin = {-34, -72}, extent = {{-10, -10}, {10, 10}}, rotation = -180)));
equation
connect(RB0.frame_b, Z4.frame_b) annotation(Line(visible = true, origin = {-52, -64.667}, points = {{8, -7.333}, {-4, -7.333}, {-4, 14.667}}));
connect(RB0.frame_a, fixedTranslation.frame_b) annotation(Line(visible = true, origin = {-17, -72}, points = {{-7, 0}, {7, 0}}));
connect(RA0.frame_a, world.frame_b) annotation(Line(visible = true, origin = {48, -65}, points = {{0, 11}, {0, -11}}));
connect(fixedTranslation.frame_a, world.frame_b) annotation(Line(visible = true, origin = {35.333, -73.333}, points = {{-25.333, 1.333}, {12.667, 1.333}, {12.667, -2.667}}));
connect(R34.frame_b, Z4.frame_a) annotation(Line(visible = true, origin = {-56, -18}, points = {{0, 12}, {-0, -12}}));
connect(Z3.frame_a, R34.frame_a) annotation(Line(visible = true, origin = {-47.333, 19.333}, points = {{17.333, 2.667}, {-8.667, 2.667}, {-8.667, -5.333}}));
connect(R23.frame_b, Z3.frame_b) annotation(Line(visible = true, origin = {3, 22}, points = {{13, 0}, {-13, 0}}));
connect(R23.frame_a, Z2.frame_b) annotation(Line(visible = true, origin = {44, 16.667}, points = {{-8, 5.333}, {4, 5.333}, {4, -10.667}}));
connect(Z2.frame_a, RA0.frame_b) annotation(Line(visible = true, origin = {48, -24}, points = {{0, 10}, {0, -10}}));
annotation(experiment(StopTime = 12.56637), Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end WalkingSticks;