Skip to content

Commit 12eed54

Browse files
committed
Rename lever and change its icon
1 parent b65221b commit 12eed54

File tree

4 files changed

+51
-54
lines changed

4 files changed

+51
-54
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
@@ -1,37 +1,43 @@
11
within Modelica.Mechanics.Translational.Examples;
2-
model LeverGrounded "Translational grounded lever"
2+
model GearGrounded "Translational grounded gear"
33
extends Modelica.Icons.Example;
44

55
Sources.Force force(
6-
useSupport=false) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
6+
useSupport=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
77
Components.Mass mass1(
8-
m=0.1) annotation (Placement(transformation(extent={{-20,-10},{0,10}})));
9-
Components.IdealLever idealLever(
10-
ratio=1.6, useSupport=true)
11-
annotation (Placement(transformation(extent={{10,-10},{30,10}})));
8+
m=0.1) annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
9+
Components.IdealGear idealLever(ratio=1.6, useSupport=true) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
1210
Components.Mass mass2(
1311
m=7,
1412
s(fixed=true, start=0),
15-
v(fixed=true, start=0)) annotation (Placement(transformation(extent={{40,-10},{60,10}})));
16-
Modelica.Blocks.Sources.Sine sine(amplitude=10,
17-
f=5)
18-
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
19-
Components.Fixed fixed annotation (Placement(transformation(extent={{-48,-60},{-28,-40}})));
13+
v(fixed=true, start=0)) annotation (Placement(transformation(extent={{20,-10},{40,10}})));
14+
Blocks.Sources.Ramp ramp(
15+
height=10,
16+
duration=0.6,
17+
startTime=0.2)
18+
annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
19+
Components.Fixed fixed annotation (Placement(transformation(extent={{-68,-50},{-48,-30}})));
2020
Components.SpringDamper springDamper(
2121
s_rel(fixed=true),
2222
v_rel(fixed=true),
2323
c=800,
24-
d=50) annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
24+
d=50) annotation (Placement(transformation(extent={{-40,-50},{-20,-30}})));
25+
Components.Fixed fixed1 annotation (Placement(transformation(extent={{70,-10},{90,10}})));
26+
Components.SpringDamper
27+
springDamper1(c=160, d=10)
28+
annotation (Placement(transformation(extent={{50,-10},{70,10}})));
2529
equation
26-
connect(mass1.flange_b, idealLever.flange_a) annotation (Line(points={{0,0},{10,0}}, color={0,127,0}));
27-
connect(idealLever.flange_b, mass2.flange_a) annotation (Line(points={{30,0},{40,0}}, color={0,127,0}));
28-
connect(sine.y, force.f) annotation (Line(points={{-59,0},{-52,0}}, color={0,0,127}));
29-
connect(force.flange, mass1.flange_a) annotation (Line(points={{-30,0},{-20,0}}, color={0,127,0}));
30-
connect(fixed.flange, springDamper.flange_a) annotation (Line(points={{-38,-50},{-20,-50}}, color={0,127,0}));
31-
connect(springDamper.flange_b, idealLever.support) annotation (Line(points={{0,-50},{20,-50},{20,-10}}, color={0,127,0}));
30+
connect(mass1.flange_b, idealLever.flange_a) annotation (Line(points={{-20,0},{-10,0}}, color={0,127,0}));
31+
connect(idealLever.flange_b, mass2.flange_a) annotation (Line(points={{10,0},{20,0}}, color={0,127,0}));
32+
connect(ramp.y, force.f) annotation (Line(points={{-79,0},{-72,0}}, color={0,0,127}));
33+
connect(force.flange, mass1.flange_a) annotation (Line(points={{-50,0},{-40,0}}, color={0,127,0}));
34+
connect(fixed.flange, springDamper.flange_a) annotation (Line(points={{-58,-40},{-40,-40}}, color={0,127,0}));
35+
connect(springDamper.flange_b, idealLever.support) annotation (Line(points={{-20,-40},{0,-40},{0,-10}}, color={0,127,0}));
36+
connect(mass2.flange_b, springDamper1.flange_a) annotation (Line(points={{40,0},{50,0}}, color={0,127,0}));
37+
connect(springDamper1.flange_b, fixed1.flange) annotation (Line(points={{70,0},{80,0}}, color={0,127,0}));
3238
annotation (
3339
experiment(
34-
StopTime=1.0,
40+
StopTime=3.0,
3541
Interval=0.001),
3642
Documentation(info="<html>
3743
<p>
@@ -47,4 +53,4 @@ Simulate for 1&nbsp;second and plot the velocities of masses:
4753
<code>mass2.v</code>, <code>mass2.v</code>
4854
</p>
4955
</html>"));
50-
end LeverGrounded;
56+
end GearGrounded;

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)