Skip to content

Commit 4fe2358

Browse files
committed
Rename lever and change its icon
1 parent b65221b commit 4fe2358

File tree

5 files changed

+79
-84
lines changed

5 files changed

+79
-84
lines changed

Modelica/Mechanics/Translational/Components/IdealLever.mo renamed to Modelica/Mechanics/Translational/Components/IdealGear.mo

+23-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
within Modelica.Mechanics.Translational.Components;
2-
model IdealLever "Ideal lever without mass"
2+
model IdealGear "Ideal gear without mass"
33
extends Modelica.Mechanics.Translational.Interfaces.PartialElementaryTwoFlangesAndSupport2;
44
parameter Real ratio(start=1)
55
"Transmission ratio (flange_a.s/flange_b.s)";
@@ -51,45 +51,31 @@ to <var>i</var> only when <code>flange_a</code> is the driving flange.
5151
Icon(
5252
coordinateSystem(preserveAspectRatio=true,
5353
extent={{-100,-100},{100,100}}),
54-
graphics={
55-
Polygon(
56-
points={{-6,-30},{-6,50},{0,50},{6,50},{6,-30},{-6,-30}},
57-
lineColor={0,0,0},
58-
fillColor={160,215,160},
59-
fillPattern=FillPattern.Solid),
54+
graphics={ Line(points={{70,0},{100,0}}, color={0,127,0}),
55+
Line(points={{-100,0},{-70,0}},color={0,127,0}),
6056
Ellipse(
61-
extent={{-20,-10},{20,-50}},
62-
fillColor={160,215,160},
57+
extent={{-38,38},{38,-38}},
58+
fillColor={255,255,255},
6359
fillPattern=FillPattern.Solid,
64-
pattern=LinePattern.None),
65-
Ellipse(
66-
extent={{-20,-10},{20,-50}},
67-
startAngle=-73,
68-
endAngle=253,
69-
closure=EllipseClosure.None),
60+
lineColor={95,95,95}),
7061
Ellipse(
71-
extent={{-10,-20},{10,-40}},
72-
fillColor={175,190,175},
62+
extent={{-16,16},{16,-16}},
63+
fillColor={255,255,255},
64+
fillPattern=FillPattern.Solid,
65+
lineColor={95,95,95}),
66+
Polygon(
67+
points={{76,-10},{76,0},{76,24},{-42,24},{-42,16},{56,16},{66,-10},{76,-10}},
68+
lineColor={0,127,0},
69+
fillColor={160,215,160},
7370
fillPattern=FillPattern.Solid),
7471
Line(
75-
points={{0,-54},{0,-30}},
72+
points={{0,-54},{0,0}},
7673
color={0,127,0}),
7774
Line(
7875
points={{0,-100},{0,-78}},
7976
color={0,127,0}),
80-
Line(
81-
points={{-98,0},{0,50}},
82-
color={0,127,0}),
83-
Line(
84-
points={{0,20},{100,0}},
85-
color={0,127,0}),
86-
Ellipse(
87-
extent={{-4,54},{4,46}},
88-
lineColor={0,127,0},
89-
fillColor={160,215,160},
90-
fillPattern=FillPattern.Solid),
9177
Ellipse(
92-
extent={{-4,24},{4,16}},
78+
extent={{-4,4},{4,-4}},
9379
lineColor={0,127,0},
9480
fillColor={160,215,160},
9581
fillPattern=FillPattern.Solid),
@@ -99,5 +85,10 @@ to <var>i</var> only when <code>flange_a</code> is the driving flange.
9985
textString="%name"),
10086
Text(
10187
extent={{-100,-50},{100,-80}},
102-
textString="ratio=%ratio")}));
103-
end IdealLever;
88+
textString="ratio=%ratio"),
89+
Polygon(
90+
points={{50,48},{50,38},{-52,38},{-66,-10},{-76,-10},{-76,48},{50,48}},
91+
lineColor={95,95,95},
92+
fillColor={131,175,131},
93+
fillPattern=FillPattern.Solid)}));
94+
end IdealGear;

Modelica/Mechanics/Translational/Components/package.order

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SpringDamper
77
ElastoGap
88
SupportFriction
99
Brake
10+
IdealGear
1011
IdealGearR2T
11-
IdealLever
1212
IdealRollingWheel
1313
RollingResistance
1414
Vehicle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
within Modelica.Mechanics.Translational.Examples;
2+
model GearGrounded "Translational grounded gear"
3+
extends Modelica.Icons.Example;
4+
5+
Sources.Force force(
6+
useSupport=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
7+
Components.IdealGear idealGear(ratio=1.6, useSupport=true) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
8+
Components.Mass mass1(
9+
m=0.1) annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
10+
Components.Mass mass2(
11+
m=7,
12+
s(fixed=true, start=0),
13+
v(fixed=true, start=0)) annotation (Placement(transformation(extent={{20,-10},{40,10}})));
14+
Components.SpringDamper springDamper(c=160, d=10) annotation (Placement(transformation(extent={{50,-10},{70,10}})));
15+
Components.SpringDamper springDamperSupport(
16+
s_rel(fixed=true),
17+
v_rel(fixed=true),
18+
c=800,
19+
d=50) annotation (Placement(transformation(extent={{-40,-50},{-20,-30}})));
20+
Blocks.Sources.Ramp ramp(
21+
height=10,
22+
duration=0.6,
23+
startTime=0.2)
24+
annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
25+
Components.Fixed fixed annotation (Placement(transformation(extent={{-68,-50},{-48,-30}})));
26+
Components.Fixed fixed1 annotation (Placement(transformation(extent={{70,-10},{90,10}})));
27+
equation
28+
connect(mass1.flange_b, idealGear.flange_a) annotation (Line(points={{-20,0},{-10,0}}, color={0,127,0}));
29+
connect(idealGear.flange_b, mass2.flange_a) annotation (Line(points={{10,0},{20,0}}, color={0,127,0}));
30+
connect(ramp.y, force.f) annotation (Line(points={{-79,0},{-72,0}}, color={0,0,127}));
31+
connect(force.flange, mass1.flange_a) annotation (Line(points={{-50,0},{-40,0}}, color={0,127,0}));
32+
connect(fixed.flange, springDamperSupport.flange_a) annotation (Line(points={{-58,-40},{-40,-40}}, color={0,127,0}));
33+
connect(springDamperSupport.flange_b, idealGear.support) annotation (Line(points={{-20,-40},{0,-40},{0,-10}}, color={0,127,0}));
34+
connect(mass2.flange_b, springDamper.flange_a) annotation (Line(points={{40,0},{50,0}}, color={0,127,0}));
35+
connect(springDamper.flange_b, fixed1.flange) annotation (Line(points={{70,0},{80,0}}, color={0,127,0}));
36+
annotation (
37+
experiment(
38+
StopTime=3.0,
39+
Interval=0.001),
40+
Documentation(info="<html>
41+
<p>
42+
The <code>flange_a</code> of the lever is driven by a sine-wave motor force.
43+
Via a lever the translational energy is transmitted to a load mass.
44+
The lever is elastically mounted.
45+
For ratio <code>idealLever.ratio&nbsp;&gt;&nbsp;1</code> the 2nd class lever is
46+
realized, i.e. the driven flange <code>flange_b</code> is located between the
47+
driving flange <code>flange_a</code> and the lever&apos;s <code>support</code>.
48+
</p>
49+
<p>
50+
Simulate for 1&nbsp;second and plot the velocities of masses:
51+
<code>mass2.v</code>, <code>mass2.v</code>
52+
</p>
53+
</html>"));
54+
end GearGrounded;

Modelica/Mechanics/Translational/Examples/LeverGrounded.mo

-50
This file was deleted.

Modelica/Mechanics/Translational/Examples/package.order

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WhyArrows
44
Accelerate
55
CompareBrakingForce
66
Damper
7-
LeverGrounded
7+
GearGrounded
88
Oscillator
99
Sensors
1010
Friction

0 commit comments

Comments
 (0)