Skip to content

Commit

Permalink
Rename lever and change its icon
Browse files Browse the repository at this point in the history
  • Loading branch information
tobolar committed Feb 25, 2025
1 parent b65221b commit 4fe2358
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 84 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
within Modelica.Mechanics.Translational.Components;
model IdealLever "Ideal lever without mass"
model IdealGear "Ideal gear without mass"
extends Modelica.Mechanics.Translational.Interfaces.PartialElementaryTwoFlangesAndSupport2;
parameter Real ratio(start=1)
"Transmission ratio (flange_a.s/flange_b.s)";
Expand Down Expand Up @@ -51,45 +51,31 @@ to <var>i</var> only when <code>flange_a</code> is the driving flange.
Icon(
coordinateSystem(preserveAspectRatio=true,
extent={{-100,-100},{100,100}}),
graphics={
Polygon(
points={{-6,-30},{-6,50},{0,50},{6,50},{6,-30},{-6,-30}},
lineColor={0,0,0},
fillColor={160,215,160},
fillPattern=FillPattern.Solid),
graphics={ Line(points={{70,0},{100,0}}, color={0,127,0}),
Line(points={{-100,0},{-70,0}},color={0,127,0}),
Ellipse(
extent={{-20,-10},{20,-50}},
fillColor={160,215,160},
extent={{-38,38},{38,-38}},
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None),
Ellipse(
extent={{-20,-10},{20,-50}},
startAngle=-73,
endAngle=253,
closure=EllipseClosure.None),
lineColor={95,95,95}),
Ellipse(
extent={{-10,-20},{10,-40}},
fillColor={175,190,175},
extent={{-16,16},{16,-16}},
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
lineColor={95,95,95}),
Polygon(
points={{76,-10},{76,0},{76,24},{-42,24},{-42,16},{56,16},{66,-10},{76,-10}},
lineColor={0,127,0},
fillColor={160,215,160},
fillPattern=FillPattern.Solid),
Line(
points={{0,-54},{0,-30}},
points={{0,-54},{0,0}},
color={0,127,0}),
Line(
points={{0,-100},{0,-78}},
color={0,127,0}),
Line(
points={{-98,0},{0,50}},
color={0,127,0}),
Line(
points={{0,20},{100,0}},
color={0,127,0}),
Ellipse(
extent={{-4,54},{4,46}},
lineColor={0,127,0},
fillColor={160,215,160},
fillPattern=FillPattern.Solid),
Ellipse(
extent={{-4,24},{4,16}},
extent={{-4,4},{4,-4}},
lineColor={0,127,0},
fillColor={160,215,160},
fillPattern=FillPattern.Solid),
Expand All @@ -99,5 +85,10 @@ to <var>i</var> only when <code>flange_a</code> is the driving flange.
textString="%name"),
Text(
extent={{-100,-50},{100,-80}},
textString="ratio=%ratio")}));
end IdealLever;
textString="ratio=%ratio"),
Polygon(
points={{50,48},{50,38},{-52,38},{-66,-10},{-76,-10},{-76,48},{50,48}},
lineColor={95,95,95},
fillColor={131,175,131},
fillPattern=FillPattern.Solid)}));
end IdealGear;
2 changes: 1 addition & 1 deletion Modelica/Mechanics/Translational/Components/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ SpringDamper
ElastoGap
SupportFriction
Brake
IdealGear
IdealGearR2T
IdealLever
IdealRollingWheel
RollingResistance
Vehicle
Expand Down
54 changes: 54 additions & 0 deletions Modelica/Mechanics/Translational/Examples/GearGrounded.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
within Modelica.Mechanics.Translational.Examples;
model GearGrounded "Translational grounded gear"
extends Modelica.Icons.Example;

Sources.Force force(
useSupport=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
Components.IdealGear idealGear(ratio=1.6, useSupport=true) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
Components.Mass mass1(
m=0.1) annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
Components.Mass mass2(
m=7,
s(fixed=true, start=0),
v(fixed=true, start=0)) annotation (Placement(transformation(extent={{20,-10},{40,10}})));
Components.SpringDamper springDamper(c=160, d=10) annotation (Placement(transformation(extent={{50,-10},{70,10}})));
Components.SpringDamper springDamperSupport(
s_rel(fixed=true),
v_rel(fixed=true),
c=800,
d=50) annotation (Placement(transformation(extent={{-40,-50},{-20,-30}})));
Blocks.Sources.Ramp ramp(
height=10,
duration=0.6,
startTime=0.2)
annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
Components.Fixed fixed annotation (Placement(transformation(extent={{-68,-50},{-48,-30}})));
Components.Fixed fixed1 annotation (Placement(transformation(extent={{70,-10},{90,10}})));
equation
connect(mass1.flange_b, idealGear.flange_a) annotation (Line(points={{-20,0},{-10,0}}, color={0,127,0}));
connect(idealGear.flange_b, mass2.flange_a) annotation (Line(points={{10,0},{20,0}}, color={0,127,0}));
connect(ramp.y, force.f) annotation (Line(points={{-79,0},{-72,0}}, color={0,0,127}));
connect(force.flange, mass1.flange_a) annotation (Line(points={{-50,0},{-40,0}}, color={0,127,0}));
connect(fixed.flange, springDamperSupport.flange_a) annotation (Line(points={{-58,-40},{-40,-40}}, color={0,127,0}));
connect(springDamperSupport.flange_b, idealGear.support) annotation (Line(points={{-20,-40},{0,-40},{0,-10}}, color={0,127,0}));
connect(mass2.flange_b, springDamper.flange_a) annotation (Line(points={{40,0},{50,0}}, color={0,127,0}));
connect(springDamper.flange_b, fixed1.flange) annotation (Line(points={{70,0},{80,0}}, color={0,127,0}));
annotation (
experiment(
StopTime=3.0,
Interval=0.001),
Documentation(info="<html>
<p>
The <code>flange_a</code> of the lever is driven by a sine-wave motor force.
Via a lever the translational energy is transmitted to a load mass.
The lever is elastically mounted.
For ratio <code>idealLever.ratio&nbsp;&gt;&nbsp;1</code> the 2nd class lever is
realized, i.e. the driven flange <code>flange_b</code> is located between the
driving flange <code>flange_a</code> and the lever&apos;s <code>support</code>.
</p>
<p>
Simulate for 1&nbsp;second and plot the velocities of masses:
<code>mass2.v</code>, <code>mass2.v</code>
</p>
</html>"));
end GearGrounded;
50 changes: 0 additions & 50 deletions Modelica/Mechanics/Translational/Examples/LeverGrounded.mo

This file was deleted.

2 changes: 1 addition & 1 deletion Modelica/Mechanics/Translational/Examples/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WhyArrows
Accelerate
CompareBrakingForce
Damper
LeverGrounded
GearGrounded
Oscillator
Sensors
Friction
Expand Down

0 comments on commit 4fe2358

Please sign in to comment.