Skip to content

Instantly share code, notes, and snippets.

@johanrhodin
Created September 30, 2015 21:20
Show Gist options
  • Save johanrhodin/394d85af7346173600c1 to your computer and use it in GitHub Desktop.
Save johanrhodin/394d85af7346173600c1 to your computer and use it in GitHub Desktop.
Small model to illustrate the use of the f_crit parameter for Modelica.Mechanics.Rotational.Sources.Position
model RevolutePosition
Modelica.Blocks.Sources.CombiTimeTable combiTimeTable1(tableName = "var1", tableOnFile = true, smoothness = Modelica.Blocks.Types.Smoothness.ContinuousDerivative, extrapolation = Modelica.Blocks.Types.Extrapolation.HoldLastPoint, fileName = Modelica.Utilities.Files.loadResource("modelica://RevolutePosition/TestProfile1.txt")) annotation(Placement(visible = true, transformation(origin = {20, 20}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Sources.Position position1(useSupport = false, f_crit = 0.1, exact = false) annotation(Placement(visible = true, transformation(origin = {-20, 20}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Body body(r_CM = {0.1, 0, 0}, m = 1) annotation(Placement(visible = true, transformation(origin = {-70, -20}, extent = {{-10, -10}, {10, 10}}, rotation = -540)));
inner Modelica.Mechanics.MultiBody.World world(enableAnimation = false) annotation(Placement(visible = true, transformation(origin = {20, -20}, extent = {{-10, 10}, {10, -10}}, rotation = 180)));
Modelica.Mechanics.MultiBody.Joints.Revolute revolute(useAxisFlange = true) annotation(Placement(visible = true, transformation(origin = {-40, -20}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
equation
connect(position1.flange, revolute.axis) annotation(Line(visible = true, origin = {-36.667, 10}, points = {{6.667, 10}, {-3.333, 10}, {-3.333, -20}}));
connect(revolute.frame_a, world.frame_b) annotation(Line(visible = true, origin = {-10, -20}, points = {{-20, 0}, {20, 0}}));
connect(revolute.frame_b, body.frame_a) annotation(Line(visible = true, origin = {-55, -20}, points = {{5, 0}, {-5, 0}}));
connect(position1.phi_ref, combiTimeTable1.y[1]) annotation(Line(visible = true, origin = {0.5, 20}, points = {{-8.5, 0}, {8.5, 0}}, color = {0, 0, 127}));
annotation(Documentation(info = "<p>Simple model to help a Wolfram Community user [<a href=\"http://community.wolfram.com/groups/-/m/t/555357\">link</a>].</p>", revisions = ""), experiment(StopTime = 60), Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})));
end RevolutePosition;
@johanrhodin
Copy link
Author

Full discussion on Wolfram Community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment