-
Notifications
You must be signed in to change notification settings - Fork 173
Add 1d translational lever #4538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
tobolar
wants to merge
9
commits into
modelica:master
Choose a base branch
from
tobolar:addLever_1dTranslational
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ac8fc82
Add translational model of lever
tobolar 763e58b
Add test GearAndLever
tobolar abed982
Update ModelicaTest/Resources/Reference/ModelicaTest/Translational/Ge…
tobolar b65221b
Merge branch 'master' into addLever_1dTranslational
tobolar bc4cf65
Rename lever and change its icon
tobolar 383f609
Change documentation
tobolar f11e4f7
Merge branch 'master' into addLever_1dTranslational
tobolar 627fafb
Rename test GearAndLever to IdealGears
tobolar 219a870
Do not check ratio's magnitude
tobolar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
within Modelica.Mechanics.Translational.Components; | ||
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)"; | ||
|
||
equation | ||
s_a = ratio*s_b; | ||
0 = ratio*flange_a.f + flange_b.f; | ||
|
||
annotation ( | ||
Documentation(info="<html> | ||
<p> | ||
This element characterizes any type of gear which is fixed in the | ||
ground and which has one driving flange and one driven flange. | ||
The gear is <strong>ideal</strong>, i.e., it does not have mass, elasticity, damping | ||
or backlash. If these effects have to be considered, the gear has to be | ||
connected to other elements in an appropriate way. | ||
</p> | ||
</html>"), | ||
Icon( | ||
coordinateSystem(preserveAspectRatio=true, | ||
extent={{-100,-100},{100,100}}), | ||
graphics={ Line(points={{70,0},{100,0}}, color={0,127,0}), | ||
Line(points={{-100,0},{-70,0}},color={0,127,0}), | ||
Ellipse( | ||
extent={{-38,38},{38,-38}}, | ||
fillColor={255,255,255}, | ||
fillPattern=FillPattern.Solid, | ||
lineColor={95,95,95}), | ||
Ellipse( | ||
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,0}}, | ||
color={0,127,0}), | ||
Line( | ||
points={{0,-100},{0,-78}}, | ||
color={0,127,0}), | ||
Ellipse( | ||
extent={{-4,4},{4,-4}}, | ||
lineColor={0,127,0}, | ||
fillColor={160,215,160}, | ||
fillPattern=FillPattern.Solid), | ||
Text( | ||
extent={{-150,100},{150,60}}, | ||
textColor={0,0,255}, | ||
textString="%name"), | ||
Text( | ||
extent={{-100,-50},{100,-80}}, | ||
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
within Modelica.Mechanics.Translational.Examples; | ||
model GearGrounded "Translational grounded gear" | ||
extends Modelica.Icons.Example; | ||
|
||
Sources.Force force 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, | ||
s_rel0=0.1) 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, | ||
offset=springDamper.s_rel0*springDamper.c/idealGear.ratio, | ||
startTime=0.3) | ||
annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); | ||
Components.Fixed fixed annotation (Placement(transformation(extent={{-70,-50},{-50,-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={{-60,-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 ideal gear is driven by an external ramp-formed | ||
force. | ||
Via the elastically mounted gear the translational energy is transmitted to | ||
a load mass where a preload force of <code>springDamper</code> acts against | ||
the external force. | ||
For ratio <code>idealGear.ratio > 1</code> the driven flange | ||
<code>flange_b</code> performs smaler movement then the driving flange | ||
<code>flange_a</code>. | ||
</p> | ||
<p> | ||
Simulate for 3 seconds and plot e.g. the position of masses: | ||
<code>mass1.s</code>, <code>mass2.s</code> | ||
</p> | ||
</html>")); | ||
end GearGrounded; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ WhyArrows | |
Accelerate | ||
CompareBrakingForce | ||
Damper | ||
GearGrounded | ||
Oscillator | ||
Sensors | ||
Friction | ||
|
5 changes: 5 additions & 0 deletions
5
...s/Reference/Modelica/Mechanics/Translational/Examples/FirstGrounded/comparisonSignals.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
time | ||
damper.s_rel | ||
damper.v_rel | ||
mass3.s | ||
mass3.v | ||
tobolar marked this conversation as resolved.
Show resolved
Hide resolved
|
10 changes: 10 additions & 0 deletions
10
...icaTest/Resources/Reference/ModelicaTest/Translational/GearAndLever/comparisonSignals.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
time | ||
inertia1.phi | ||
inertia1.w | ||
inertia3.phi | ||
inertia3.w | ||
mass1.s | ||
mass1.v | ||
mass3.s | ||
mass3.v | ||
tobolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost all elements where it is relevant to have a connection to ground/support/housing has an optional such connector. any particular reason this one is different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular reason for this. I simply took and modified documentation of
Modelica.Mechanics.Rotational.Components.IdealGear
which refers to the ground in the same manner.