Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions Tutorial2024/AuxiliaryComponents/CraneCrab.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
within Tutorial2024.AuxiliaryComponents;
model CraneCrab
extends Modelica.Blocks.Icons.Block;
Modelica.Mechanics.MultiBody.Parts.Body body(r_CM={0,0,0},
m=1) annotation (Placement(transformation(extent={{12,12},{32,32}})));
Modelica.Mechanics.MultiBody.Parts.Body body1(r_CM={0,0,0},
m=1) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-60})));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation(r={1,0,0}) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-26})));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed annotation (Placement(transformation(extent={{-64,12},{-44,32}})));
Modelica.Mechanics.MultiBody.Joints.Prismatic x(useAxisFlange=true,
s(fixed=true),
v(fixed=true)) annotation (Placement(transformation(extent={{-30,12},
{-10,32}})));
Modelica.Mechanics.MultiBody.Joints.Revolute revolute(useAxisFlange=true,
phi(fixed=true, start=1.3962634015955),
w(fixed=true)) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270)));
Modelica.Mechanics.Rotational.Sensors.AngleSensor angleSensor annotation (Placement(transformation(extent={{30,-10},{
50,10}})));
Modelica.Mechanics.Translational.Sources.Force force annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-40,50})));
Modelica.Blocks.Interfaces.RealInput f "Force" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}),
iconTransformation(extent={{-140,-20},{-100,20}})));
Modelica.Blocks.Interfaces.RealOutput phi "Angle" annotation (Placement(transformation(extent={{100,-10},{120,10}}),
iconTransformation(extent={{100,-10},{120,10}})));
equation
connect(fixed.frame_b, x.frame_a) annotation (Line(
points={{-44,22},{-30,22}},
color={95,95,95},
thickness=0.5));
connect(x.frame_b, body.frame_a) annotation (Line(
points={{-10,22},{12,22}},
color={95,95,95},
thickness=0.5));
connect(body.frame_a, revolute.frame_a) annotation (Line(
points={{12,22},{0,22},{0,10}},
color={95,95,95},
thickness=0.5));
connect(revolute.frame_b, fixedTranslation.frame_a) annotation (Line(
points={{0,-10},{0,-16}},
color={95,95,95},
thickness=0.5));
connect(fixedTranslation.frame_b, body1.frame_a) annotation (Line(
points={{0,-36},{0,-50}},
color={95,95,95},
thickness=0.5));
connect(force.flange, x.axis) annotation (Line(points={{-30,50},{-12,50},{-12,28}},
color={0,127,0}));
connect(f, force.f) annotation (Line(points={{-120,0},{-70,0},{-70,50},{-52,50}}, color={0,0,127}));
connect(angleSensor.phi, phi) annotation (Line(points={{51,0},{110,0}}, color={0,0,127}));
connect(revolute.axis, angleSensor.flange) annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-44,-18},{46,-62}},
lineColor={28,108,200},
fillColor={0,0,0},
fillPattern=FillPattern.Solid),
Line(
points={{20,58},{-2,-40}},
color={0,0,0},
thickness=1),
Ellipse(
extent={{8,78},{36,48}},
lineColor={28,108,200},
fillColor={0,0,0},
fillPattern=FillPattern.Solid),
Line(points={{-72,-66},{78,-66}}, color={0,0,0}),
Line(points={{-84,-86},{-56,-70}}, color={0,0,0}),
Line(points={{-46,-86},{-18,-70}}, color={0,0,0}),
Line(points={{-4,-86},{24,-70}}, color={0,0,0}),
Line(points={{38,-86},{66,-70}}, color={0,0,0})}), Diagram(coordinateSystem(preserveAspectRatio=false)),
experiment(__Dymola_NumberOfIntervals=5000, __Dymola_Algorithm="Dassl"),
Documentation(info="<html>
<p>
Model of an inverse pendulum.
</p>
</html>"));
end CraneCrab;
46 changes: 46 additions & 0 deletions Tutorial2024/AuxiliaryComponents/CraneCrab2.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
within Tutorial2024.AuxiliaryComponents;

model CraneCrab2
extends Modelica.Blocks.Icons.Block;
PlanarMechanics.Parts.Fixed fixed annotation(
Placement(transformation(origin = {-70, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
PlanarMechanics.Parts.Body carriage(I = 0.001, m = 1) annotation(
Placement(transformation(origin = {10, 0}, extent = {{0, -10}, {20, 10}})));
Modelica.Mechanics.Translational.Sources.Force force(useSupport = false) annotation(
Placement(transformation(origin = {-80, 0}, extent = {{20, 30}, {40, 50}}, rotation = -0)));
PlanarMechanics.Joints.Prismatic prismatic(r = {1, 0}, useFlange = true) annotation(
Placement(transformation(origin = {10, 0}, extent = {{-54, 10}, {-34, -10}})));
PlanarMechanics.Parts.FixedTranslation rod(r = {0, 0.5}) annotation(
Placement(transformation(origin = {10, 0}, extent = {{-10, -60}, {10, -40}})));
PlanarMechanics.Parts.Body pendulum(I = 0.001, m = 0.5) annotation(
Placement(transformation(origin = {10, 0}, extent = {{20, -60}, {40, -40}})));
Modelica.Mechanics.Rotational.Sensors.AngleSensor angleSensor annotation(
Placement(transformation(origin = {10, 0}, extent = {{-4, -40}, {16, -20}})));
PlanarMechanics.Joints.Revolute revolute1(useFlange = true, phi(start = 0.1745329251994329, fixed = true), w(start = 0, fixed = true)) annotation(
Placement(transformation(origin = {-10, -30}, extent = {{-10, 10}, {10, -10}}, rotation = 270)));
Modelica.Blocks.Interfaces.RealInput u annotation(
Placement(transformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}), iconTransformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}})));
Modelica.Blocks.Interfaces.RealOutput y annotation(
Placement(transformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {110, -2}, extent = {{-10, -10}, {10, 10}})));
equation
connect(prismatic.frame_b, carriage.frame_a) annotation(
Line(points = {{-24, 0}, {10, 0}}, color = {95, 95, 95}));
connect(revolute1.frame_b, rod.frame_a) annotation(
Line(points = {{-10, -40}, {-10, -50}, {0, -50}}, color = {95, 95, 95}));
connect(fixed.frame, prismatic.frame_a) annotation(
Line(points = {{-60, 0}, {-44, 0}}, color = {95, 95, 95}));
connect(revolute1.frame_a, carriage.frame_a) annotation(
Line(points = {{-10, -20}, {-10, 0}, {10, 0}}, color = {95, 95, 95}));
connect(force.flange, prismatic.flange_a) annotation(
Line(points = {{-40, 40}, {-34, 40}, {-34, 10}}, color = {0, 127, 0}));
connect(revolute1.flange_a, angleSensor.flange) annotation(
Line(points = {{0, -30}, {6, -30}}));
connect(rod.frame_b, pendulum.frame_a) annotation(
Line(points = {{20, -50}, {30, -50}}, color = {95, 95, 95}));
connect(u, force.f) annotation(
Line(points = {{-120, 0}, {-92, 0}, {-92, 40}, {-62, 40}}, color = {0, 0, 127}));
connect(angleSensor.phi, y) annotation(
Line(points = {{28, -30}, {60, -30}, {60, 0}, {110, 0}}, color = {0, 0, 127}));
annotation(
Icon(graphics = {Line(points = {{-4, -86}, {24, -70}}), Line(points = {{-46, -86}, {-18, -70}}), Line(points = {{20, 58}, {-2, -40}}), Line(points = {{38, -86}, {66, -70}}), Line(points = {{-72, -66}, {78, -66}}), Rectangle(lineColor = {28, 108, 200}, fillPattern = FillPattern.Solid, extent = {{-44, -18}, {46, -62}}), Line(points = {{-84, -86}, {-56, -70}}), Ellipse(lineColor = {28, 108, 200}, fillPattern = FillPattern.Solid, extent = {{8, 78}, {36, 48}})}));
end CraneCrab2;
5 changes: 0 additions & 5 deletions Tutorial2024/AuxiliaryComponents/DryFriction.bak-mo

This file was deleted.

2 changes: 2 additions & 0 deletions Tutorial2024/AuxiliaryComponents/package.order
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
IdealDryFriction
ThermalCollector
CraneCrab
CraneCrab2
5 changes: 0 additions & 5 deletions Tutorial2024/StepByStep/AuxiliaryComponents/DryFriction.mo

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions Tutorial2024/StepByStep/AuxiliaryComponents/package.bak-mo

This file was deleted.

2 changes: 0 additions & 2 deletions Tutorial2024/StepByStep/AuxiliaryComponents/package.order

This file was deleted.

13 changes: 13 additions & 0 deletions Tutorial2024/StepByStep/Step1_FreeBody2.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
within Tutorial2024.StepByStep;
model Step1_FreeBody2 "free falling body"
extends Modelica.Icons.Example;

inner PlanarMechanics.PlanarWorld planarWorld
annotation (Placement(transformation(extent={{-80,-80},{-60,-60}})));
PlanarMechanics.Parts.Body body(m=1, I=0.001, r(start = {0, 0}), v(start = {5, 5}))
annotation (Placement(transformation(extent={{-8,-10},{12,10}})));
annotation (experiment(
StopTime=1,
__Dymola_NumberOfIntervals=1500,
__Dymola_Algorithm="Dassl"));
end Step1_FreeBody2;
24 changes: 24 additions & 0 deletions Tutorial2024/StepByStep/Step2_FixedBody2.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
within Tutorial2024.StepByStep;
model Step2_FixedBody2 "fixated body"
extends Modelica.Icons.Example;

inner PlanarMechanics.PlanarWorld planarWorld
annotation (Placement(transformation(extent={{-80,-80},{-60,-60}})));
PlanarMechanics.Parts.Body body(m=1, I=0.001, r(start = {0, 0}))
annotation (Placement(transformation(extent={{20,-10},{40,10}})));
PlanarMechanics.Parts.Fixed fixed annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={-30,0})));
PlanarMechanics.Parts.SpringDamper springDamper(c_y = 10, d_y = 2*sqrt(10)/2) annotation (
Placement(transformation(extent = {{-10, -10}, {10, 10}})));
equation
connect(fixed.frame, springDamper.frame_a) annotation (
Line(points = {{-20, 0}, {-10, 0}}, color = {95, 95, 95}));
connect(springDamper.frame_b, body.frame_a) annotation (
Line(points = {{10, 0}, {20, 0}}, color = {95, 95, 95}));
annotation (experiment(
StopTime=5,
__Dymola_NumberOfIntervals=1500,
__Dymola_Algorithm="Dassl"));
end Step2_FixedBody2;
77 changes: 77 additions & 0 deletions Tutorial2024/StepByStep/Step3_Pendulum2.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
within Tutorial2024.StepByStep;
model Step3_Pendulum2 "Pendulum"
extends Modelica.Icons.Example;
inner PlanarMechanics.PlanarWorld planarWorld annotation (
Placement(transformation(origin = {240, -20}, extent = {{-160, -60}, {-140, -40}})));
PlanarMechanics.Parts.Body body(m = 1, I = 0.001) annotation (
Placement(transformation(origin = {40, 30}, extent = {{20, -10}, {40, 10}})));
PlanarMechanics.Parts.Fixed fixed annotation (
Placement(transformation(origin = {-50, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
PlanarMechanics.Parts.FixedTranslation rod(r = {2, 0}) annotation (
Placement(transformation(origin = {10, 30}, extent = {{-10, -10}, {10, 10}})));
PlanarMechanics.Joints.Revolute revolute(phi(start = 0, fixed = true)) annotation (
Placement(transformation(origin = {10, 30}, extent = {{-40, -10}, {-20, 10}})));
PlanarMechanics.Parts.Fixed fixed1 annotation (
Placement(transformation(origin = {-50, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
PlanarMechanics.Joints.Revolute revolute1 annotation (
Placement(transformation(origin = {10, 70}, extent = {{-40, -10}, {-20, 10}})));
PlanarMechanics.Parts.FixedTranslation fixedTranslation(r = {1, 0}) annotation (
Placement(transformation(origin = {10, 70}, extent = {{-10, -10}, {10, 10}})));
PlanarMechanics.Parts.Body body1(I = 0.001, m = 1) annotation (
Placement(transformation(origin = {12, 70}, extent = {{20, -10}, {40, 10}})));
PlanarMechanics.Joints.Prismatic prismatic1(r = {0, -1}, useFlange = false) annotation (
Placement(transformation(origin = {-36, 4}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Mechanics.Translational.Components.Spring spring(c = 100) annotation (
Placement(transformation(origin = {-10, -40}, extent = {{-10, -10}, {10, 10}})));
PlanarMechanics.Joints.Prismatic prismatic(useFlange = true, r = {1, 0}) annotation (
Placement(transformation(origin = {-10, -10}, extent = {{-10, -10}, {10, 10}})));
PlanarMechanics.Joints.Revolute revolute2(phi(fixed = false)) annotation (
Placement(transformation(origin = {0, 30}, extent = {{20, -50}, {40, -30}})));
PlanarMechanics.Parts.Spring spring1(c_x = 100, c_y = 1e-9, c_phi = 1e-9) annotation (
Placement(transformation(origin = {20, 60}, extent = {{-40, -160}, {-20, -140}})));
PlanarMechanics.Parts.Body body2(m = 1, I = 0.001) annotation (
Placement(transformation(origin = {20, -70}, extent = {{20, -10}, {40, 10}})));
PlanarMechanics.Parts.Fixed fixed2 annotation (
Placement(transformation(origin = {-70, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
PlanarMechanics.Parts.FixedTranslation rod1(r = {2, 0}) annotation (
Placement(transformation(origin = {10, 40}, extent = {{-30, -120}, {-10, -100}})));
PlanarMechanics.Joints.Revolute revolute3(phi(start = 0, fixed = true)) annotation (
Placement(transformation(origin = {10, 40}, extent = {{-60, -120}, {-40, -100}})));
equation
connect(rod.frame_b, body.frame_a) annotation (
Line(points = {{20, 30}, {60, 30}}, color = {95, 95, 95}));
connect(fixed.frame, revolute.frame_a) annotation (
Line(points = {{-40, 30}, {-30, 30}}, color = {95, 95, 95}));
connect(revolute.frame_b, rod.frame_a) annotation (
Line(points = {{-10, 30}, {0, 30}}, color = {95, 95, 95}));
connect(fixed1.frame, revolute1.frame_a) annotation (
Line(points = {{-40, 70}, {-30, 70}}, color = {95, 95, 95}));
connect(fixedTranslation.frame_b, body1.frame_a) annotation (
Line(points = {{20, 70}, {32, 70}}, color = {95, 95, 95}));
connect(revolute1.frame_b, fixedTranslation.frame_a) annotation (
Line(points = {{-10, 70}, {0, 70}}, color = {95, 95, 95}));
connect(fixed.frame, prismatic1.frame_a) annotation (
Line(points = {{-40, 30}, {-36, 30}, {-36, 14}}, color = {95, 95, 95}));
connect(prismatic1.frame_b, prismatic.frame_a) annotation (
Line(points = {{-36, -6}, {-35.5, -6}, {-35.5, -4}, {-37, -4}, {-37, -10}, {-20, -10}}, color = {95, 95, 95}));
connect(prismatic.support, spring.flange_a) annotation (
Line(points = {{-16, -20}, {-16, -30}, {-20, -30}, {-20, -40}}, color = {0, 127, 0}));
connect(prismatic.flange_a, spring.flange_b) annotation (
Line(points = {{-10, -20}, {0, -20}, {0, -40}}, color = {0, 127, 0}));
connect(prismatic.frame_b, revolute2.frame_a) annotation (
Line(points = {{0, -10}, {20, -10}}, color = {95, 95, 95}));
connect(revolute2.frame_b, body.frame_a) annotation (
Line(points = {{40, -10}, {54, -10}, {54, 30}, {60, 30}}, color = {95, 95, 95}));
connect(rod1.frame_b, body2.frame_a) annotation (
Line(points = {{0, -70}, {40, -70}}, color = {95, 95, 95}));
connect(fixed2.frame, revolute3.frame_a) annotation (
Line(points = {{-60, -70}, {-50, -70}}, color = {95, 95, 95}));
connect(revolute3.frame_b, rod1.frame_a) annotation (
Line(points = {{-30, -70}, {-20, -70}}, color = {95, 95, 95}));
connect(spring1.frame_b, body2.frame_a) annotation (
Line(points = {{0, -90}, {20, -90}, {20, -70}, {40, -70}}, color = {95, 95, 95}));
connect(fixed2.frame, spring1.frame_a) annotation (
Line(points = {{-60, -70}, {-60, -90}, {-20, -90}}, color = {95, 95, 95}));
annotation (
experiment(StopTime = 5, Tolerance = 1e-09, __Dymola_Algorithm = "Dassl"));
end Step3_Pendulum2;
53 changes: 0 additions & 53 deletions Tutorial2024/StepByStep/Step5_ActuatedCraneCrab.bak-mo

This file was deleted.

Loading