diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d62d5e0..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -**/*.ipynb_checkpoints/ diff --git a/.impact/project.json b/.impact/project.json index 3d65b88..4b20ae4 100644 --- a/.impact/project.json +++ b/.impact/project.json @@ -1,5 +1,5 @@ { - "name": "Gitdemo", + "name": "Modelonexamples_10", "format": "1.0.0", "dependencies": [ { @@ -9,47 +9,11 @@ ], "content": [ { - "relpath": "Resources/Views", - "contentType": "VIEWS", - "defaultDisabled": false, - "id": "d049e25f59784e9dbdb3c20787f96d28" - }, - { - "relpath": "Resources/Favorites", - "contentType": "FAVORITES", - "defaultDisabled": false, - "id": "aec8e400200c449d8b85a62a04bfd30e" - }, - { - "relpath": "Resources/CustomFunctions", - "contentType": "CUSTOM_FUNCTIONS", - "defaultDisabled": false, - "id": "406f14bcf0914ae5a7f298d7ca23dc94" - }, - { - "relpath": "Resources/Custom", - "contentType": "GENERIC", - "defaultDisabled": false, - "id": "3e90195b07f6455fa38dd2dd168b8209" - }, - { - "relpath": "ReferenceResults", - "contentType": "REFERENCE_RESULTS", - "defaultDisabled": false, - "id": "8ae62e121ce54595981e0a806cf7b6f6" - }, - { - "relpath": "Resources/ExperimentDefinitions", - "contentType": "EXPERIMENT_DEFINITIONS", - "defaultDisabled": false, - "id": "642bdb01133c42b8a7d46f0f8386e48e" - }, - { - "relpath": "Test", + "relpath": "TestPackage", "contentType": "MODELICA", - "name": "Test", + "name": "TestPackage", "defaultDisabled": false, - "id": "438ad9f417f141b79910fd749a9a9ec1" + "id": "77d3ee4fbe1743f5b16633a829e027de" } ], "executionOptions": [] diff --git a/Test/DoublePendulum.mo b/Test/DoublePendulum.mo deleted file mode 100644 index 81504af..0000000 --- a/Test/DoublePendulum.mo +++ /dev/null @@ -1,61 +0,0 @@ -within Test; - -model DoublePendulum - "Simple double pendulum with two revolute joints and two bodies" - - extends .Modelica.Icons.Example; - inner .Modelica.Mechanics.MultiBody.World world annotation (Placement( - transformation(extent={{-100,-10},{-80,10}}))); - .Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(useAxisFlange=true,phi(fixed=true), - w(fixed=true)) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); - .Modelica.Mechanics.Rotational.Components.Damper damper( - d=0.1) - annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); - .Modelica.Mechanics.MultiBody.Parts.BodyBox boxBody1(r={0.5,0,0}, width=0.06) - annotation (Placement(transformation(extent={{-20,-10},{0,10}}))); - .Modelica.Mechanics.MultiBody.Joints.Revolute revolute2(phi(fixed=true), w( - fixed=true)) annotation (Placement(transformation(extent={{20,-10},{40,10}}))); - .Modelica.Mechanics.MultiBody.Parts.BodyBox boxBody2(r={0.5,0,0}, width=0.06) - annotation (Placement(transformation(extent={{60,-10},{80,10}}))); -equation - - connect(damper.flange_b, revolute1.axis) annotation (Line(points={{-40,40},{-40,20},{-50,20},{-50,10}})); - connect(revolute1.support, damper.flange_a) annotation (Line(points={{-56,10},{-56,20},{-60,20},{-60,40}})); - connect(revolute1.frame_b, boxBody1.frame_a) - annotation (Line( - points={{-40,0},{-20,0}}, - color={95,95,95}, - thickness=0.5)); - connect(revolute2.frame_b, boxBody2.frame_a) - annotation (Line( - points={{40,0},{60,0}}, - color={95,95,95}, - thickness=0.5)); - connect(boxBody1.frame_b, revolute2.frame_a) - annotation (Line( - points={{0,0},{20,0}}, - color={95,95,95}, - thickness=0.5)); - connect(world.frame_b, revolute1.frame_a) - annotation (Line( - points={{-80,0},{-60,0}}, - color={95,95,95}, - thickness=0.5)); - annotation ( - experiment(StopTime=3), - Documentation(info=" -
-This example demonstrates that by using joint and body -elements animation is automatically available. Also the revolute -joints are animated. Note, that animation of every component -can be switched of by setting the first parameter animation -to false or by setting enableAnimation in the world -object to false to switch off animation of all components. -
- ---")); -end DoublePendulum; diff --git a/Test/package.mo b/Test/package.mo deleted file mode 100644 index b54aa93..0000000 --- a/Test/package.mo +++ /dev/null @@ -1,3 +0,0 @@ -package Test extends .Modelica.Icons.Package; - annotation(uses(Modelica(version = "4.0.0"))); -end Test; \ No newline at end of file diff --git a/Test/package.order b/Test/package.order deleted file mode 100644 index acd275c..0000000 --- a/Test/package.order +++ /dev/null @@ -1 +0,0 @@ -DoublePendulum \ No newline at end of file diff --git a/TestPackage/SignConvention.mo b/TestPackage/SignConvention.mo new file mode 100644 index 0000000..63a35e3 --- /dev/null +++ b/TestPackage/SignConvention.mo @@ -0,0 +1,92 @@ +within TestPackage; + +model SignConvention "Examples for the used sign conventions" + extends .Modelica.Icons.Example; + .Modelica.Mechanics.Translational.Components.Mass mass1( + L=1, + s(fixed=true), + v(fixed=true), + m=1) annotation (Placement(transformation(extent={{40,60},{60,80}}))); + .Modelica.Mechanics.Translational.Sources.Force force1 annotation (Placement(transformation( + extent={{0,60},{20,80}}))); + .Modelica.Blocks.Sources.Constant constant1(k=1) annotation (Placement( + transformation(extent={{-40,60},{-20,80}}))); + .Modelica.Mechanics.Translational.Components.Mass mass2( + L=1, + s(fixed=true), + v(fixed=true), + m=1) annotation (Placement(transformation(extent={{40,0},{60,20}}))); + .Modelica.Mechanics.Translational.Sources.Force force2 annotation (Placement(transformation( + extent={{0,20},{20,40}}))); + .Modelica.Blocks.Sources.Constant constant2(k=1) annotation (Placement( + transformation(extent={{-40,20},{-20,40}}))); + .Modelica.Mechanics.Translational.Components.Mass mass3( + L=1, + s(fixed=true), + v(fixed=true), + m=1) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}))); + .Modelica.Mechanics.Translational.Sources.Force force3(useSupport=false) + annotation (Placement( + transformation(extent={{20,-40},{0,-20}}))); + .Modelica.Blocks.Sources.Constant constant3(k=1) annotation (Placement( + transformation(extent={{60,-40},{40,-20}}))); + .Modelica.Mechanics.Translational.Components.Fixed fixed + annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); +equation + connect(constant1.y, force1.f) + annotation (Line(points={{-19,70},{-2,70}}, color={0,0,127})); + connect(constant2.y, force2.f) + annotation (Line(points={{-19,30},{-2,30}}, color={0,0,127})); + connect(constant3.y, force3.f) + annotation (Line(points={{39,-30},{22,-30}}, color={0,0,127})); + connect(force1.flange, mass1.flange_a) annotation (Line( + points={{20,70},{40,70}}, color={0,127,0})); + connect(force2.flange, mass2.flange_b) annotation (Line( + points={{20,30},{70,30},{70,10},{60,10}}, color={0,127,0})); + connect(mass3.flange_b, force3.flange) annotation (Line( + points={{-20,-30},{0,-30}}, color={0,127,0})); + connect(fixed.flange, force3.support) annotation (Line( + points={{10,-50},{10,-40}}, color={0,127,0})); + annotation ( + Documentation(info=" +-
+If all arrows point in the same direction, a positive force +results in a positive acceleration a, velocity v and position s. +
++For a force of 1 N and a mass of 1 kg this leads to +
+++a = 1 m/s2 +v = 1 m/s after 1 s (SlidingMass1.v) +s = 0.5 m after 1 s (SlidingMass1.s) +
+The acceleration is not available for plotting. +
++System 1) and 2) are equivalent. It doesn't matter whether the +force pushes at flange_a in system 1 or pulls at flange_b in system 2. +
+It is of course possible to ignore the arrows and connect the models +in an arbitrary way. But then it is hard see in what direction the +force acts. +
+In the third system the two arrows are opposed which means that the +force acts in the opposite direction (in the same direction as in +the two other examples). +
+"), + Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100}, + {100,100}}),graphics={Text( + extent={{-100,80},{-82,60}}, + textString="1)", + lineColor={0,0,255}),Text( + extent={{-100,40},{-82,20}}, + textString="2)", + lineColor={0,0,255}),Text( + extent={{-100,-20},{-82,-40}}, + textString="3)", + lineColor={0,0,255})}), + experiment(StopTime=1.0, Interval=0.001)); +end SignConvention; diff --git a/TestPackage/package.mo b/TestPackage/package.mo new file mode 100644 index 0000000..3b80a77 --- /dev/null +++ b/TestPackage/package.mo @@ -0,0 +1,3 @@ +package TestPackage extends .Modelica.Icons.Package; + annotation(uses(Modelica(version = "4.0.0"))); +end TestPackage; \ No newline at end of file diff --git a/TestPackage/package.order b/TestPackage/package.order new file mode 100644 index 0000000..8047e14 --- /dev/null +++ b/TestPackage/package.order @@ -0,0 +1 @@ +SignConvention \ No newline at end of file