27 lines
1.7 KiB
Plaintext
27 lines
1.7 KiB
Plaintext
model Simple2DPendulum
|
|
inner Modelica.Mechanics.MultiBody.World world annotation(
|
|
Placement(transformation(origin = {-40, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
Modelica.Mechanics.MultiBody.Joints.Revolute revolute(phi(start = -1.5707963267948966, fixed = true, displayUnit = "deg"), useAxisFlange = true) annotation(
|
|
Placement(transformation(origin = {40, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
Modelica.Mechanics.MultiBody.Parts.Body body(r_CM = {0, -0.5, 0}, m = 1, I_11 = 0.001, I_22 = 0.001, I_33 = 0.001) annotation(
|
|
Placement(transformation(origin = {70, 0}, extent = {{-10, -10}, {10, 10}})));
|
|
Modelica.Mechanics.Rotational.Components.Damper damper(d = 0.02) annotation(
|
|
Placement(transformation(origin = {40, 38}, extent = {{-10, -10}, {10, 10}})));
|
|
Modelica.Mechanics.MultiBody.Joints.Prismatic prismatic annotation(
|
|
Placement(transformation(extent = {{-10, -10}, {10, 10}})));
|
|
equation
|
|
connect(revolute.frame_b, body.frame_a) annotation(
|
|
Line(points = {{50, 0}, {60, 0}}, color = {95, 95, 95}));
|
|
connect(damper.flange_b, revolute.axis) annotation(
|
|
Line(points = {{50, 38}, {58, 38}, {58, 20}, {40, 20}, {40, 10}}));
|
|
connect(damper.flange_a, revolute.support) annotation(
|
|
Line(points = {{30, 38}, {22, 38}, {22, 20}, {34, 20}, {34, 10}}));
|
|
connect(prismatic.frame_b, revolute.frame_a) annotation(
|
|
Line(points = {{10, 0}, {30, 0}}, color = {95, 95, 95}));
|
|
connect(world.frame_b, prismatic.frame_a) annotation(
|
|
Line(points = {{-30, 0}, {-10, 0}}, color = {95, 95, 95}));
|
|
|
|
annotation(
|
|
uses(Modelica(version = "4.1.0")),
|
|
experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-06, Interval = 0.02));
|
|
end Simple2DPendulum; |