root/branches/maintenance/3.0/Modelica/Mechanics/Rotational.mo

Revision 1159, 256.0 kB (checked in by dietmarw, 2 months ago)

fixes #100 (in maintenance/3.0) by changing the annotation to a vendor specific annotation

From: Dietmar Winkler <Dietmar.Winkler@…>

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1within Modelica.Mechanics;
2package Rotational
3  "Library to model 1-dimensional, rotational mechanical systems"
4  extends Modelica.Icons.Library2;
5  import SI = Modelica.SIunits;
6
7  annotation (
8  version="1.1.1", versionDate="2007-11-22"
9    ,
10    Documentation(info="<html>
11 
12<p>
13Library <b>Rotational</b> is a <b>free</b> Modelica package providing
141-dimensional, rotational mechanical components to model in a convenient way
15drive trains with frictional losses. A typical, simple example is shown
16in the next figure:
17</p>
18 
19<p><img src=\"../Images/Rotational/driveExample.png\"></p>
20 
21<p>
22For an introduction, have especially a look at:
23</p>
24<ul>
25<li> <a href=\"Modelica://Modelica.Mechanics.Rotational.UsersGuide\">Rotational.UsersGuide</a>
26     discusses the most important aspects how to use this library.</li>
27<li> <a href=\"Modelica://Modelica.Mechanics.Rotational.Examples\">Rotational.Examples</a>
28     contains examples that demonstrate the usage of this library.</li>
29</ul>
30 
31<p>
32In version 3.0 of the Modelica Standard Library, the basic design of the
33library has changed: Previously, bearing connectors could or could not be connected.
34In 3.0, the bearing connector is renamed to \"support\" and this connector
35is enabled via parameter \"useSupport\". If the support connector is enabled,
36it must be connected, and if it is not enabled, it must not be connected.
37</p>
38 
39<p>
40Copyright &copy; 1998-2008, Modelica Association and DLR.
41</p>
42<p>
43<i>This Modelica package is <b>free</b> software; it can be redistributed and/or modified
44under the terms of the <b>Modelica license</b>, see the license conditions
45and the accompanying <b>disclaimer</b> 
46<a href=\"Modelica://Modelica.UsersGuide.ModelicaLicense\">here</a>.</i>
47</p><br>
48</html>
49", revisions=""),
50    Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,
51            100}}), graphics={
52        Line(points={{-83,-66},{-63,-66}}, color={0,0,0}),
53        Line(points={{36,-68},{56,-68}}, color={0,0,0}),
54        Line(points={{-73,-66},{-73,-91}}, color={0,0,0}),
55        Line(points={{46,-68},{46,-91}}, color={0,0,0}),
56        Line(points={{-83,-29},{-63,-29}}, color={0,0,0}),
57        Line(points={{36,-32},{56,-32}}, color={0,0,0}),
58        Line(points={{-73,-9},{-73,-29}}, color={0,0,0}),
59        Line(points={{46,-12},{46,-32}}, color={0,0,0}),
60        Line(points={{-73,-91},{46,-91}}, color={0,0,0}),
61        Rectangle(
62          extent={{-47,-17},{27,-80}},
63          lineColor={0,0,0},
64          fillPattern=FillPattern.HorizontalCylinder,
65          fillColor={192,192,192}),
66        Rectangle(
67          extent={{-87,-41},{-47,-54}},
68          lineColor={0,0,0},
69          fillPattern=FillPattern.HorizontalCylinder,
70          fillColor={192,192,192}),
71        Rectangle(
72          extent={{27,-42},{66,-56}},
73          lineColor={0,0,0},
74          fillPattern=FillPattern.HorizontalCylinder,
75          fillColor={192,192,192})}));
76
77package UsersGuide "User's Guide of Rotational Library"
78
79  annotation (__Dymola_DocumentationClass=true, Documentation(info="<HTML>
80<p>
81Library <b>Rotational</b> is a <b>free</b> Modelica package providing
821-dimensional, rotational mechanical components to model in a convenient way
83drive trains with frictional losses.
84</p>
85
86</HTML>"));
87
88  class Overview "Overview"
89
90    annotation (__Dymola_DocumentationClass=true, Documentation(info="<HTML>
91 
92<p>
93This package contains components to model <b>1-dimensional rotational
94mechanical</b> systems, including different types of gearboxes,
95shafts with inertia, external torques, spring/damper elements,
96frictional elements, backlash, elements to measure angle, angular velocity,
97angular acceleration and the cut-torque of a flange. In sublibrary
98<b>Examples</b> several examples are present to demonstrate the usage of
99the elements. Just open the corresponding example model and simulate
100the model according to the provided description.
101</p>
102<p>
103A unique feature of this library is the <b>component-oriented</b>
104modeling of <b>Coulomb friction</b> elements, such as friction in bearings,
105clutches, brakes, and gear efficiency. Even (dynamically) coupled
106friction elements, e.g., as in automatic gearboxes, can be handeled
107<b>without</b> introducing stiffness which leads to fast simulations.
108The underlying theory is new and is based on the solution of mixed
109continuous/discrete systems of equations, i.e., equations where the
110<b>unknowns</b> are of type <b>Real</b>, <b>Integer</b> or <b>Boolean</b>.
111Provided appropriate numerical algorithms for the solution of such types of
112systems are available in the simulation tool, the simulation of
113(dynamically) coupled friction elements of this library is
114<b>efficient</b> and <b>reliable</b>.
115</p>
116<p><IMG SRC=\"../Images/Rotational/drive1.png\" ALT=\"drive1\"></p>
117<p>
118A simple example of the usage of this library is given in the
119figure above. This drive consists of a shaft with inertia J1=0.2 which
120is connected via an ideal gearbox with gear ratio=5 to a second shaft
121with inertia J2=5. The left shaft is driven via an external,
122sinusoidal torque.
123The <b>filled</b> and <b>non-filled grey squares</b> at the left and
124right side of a component represent <b>mechanical flanges</b>.
125Drawing a line between such squares means that the corresponding
126flanges are <b>rigidly attached</b> to each other.
127By convention in this library, the connector characterized as a
128<b>filled</b> grey square is called <b>flange_a</b> and placed at the
129left side of the component in the \"design view\" and the connector
130characterized as a <b>non-filled</b> grey square is called <b>flange_b</b>
131and placed at the right side of the component in the \"design view\".
132The two connectors are completely <b>identical</b>, with the only
133exception that the graphical layout is a little bit different in order
134to distinguish them for easier access of the connector variables.
135For example, <tt>J1.flange_a.tau</tt> is the cut-torque in the connector
136<tt>flange_a</tt> of component <tt>J1</tt>.
137</p>
138<p>
139The components of this
140library can be <b>connected</b> together in an <b>arbitrary</b> way. E.g., it is
141possible to connect two springs or two shafts with inertia directly
142together, see figure below.
143</p>
144<p><IMG SRC=\"../Images/Rotational/driveConnections1.png\" ALT=\"driveConnections1\"></p>
145<p><IMG SRC=\"../Images/Rotational/driveConnections2.png\" ALT=\"driveConnections2\"></p>
146 
147</HTML>"));
148
149  end Overview;
150
151  class FlangeConnectors "Flange Connectors"
152
153    annotation (__Dymola_DocumentationClass=true, Documentation(info="<HTML>
154<p>
155A flange is described by the connector class
156Interfaces.<b>Flange_a</b>
157or Interfaces.<b>Flange_b</b>. As already noted, the two connector
158classes are completely identical. There is only a difference in the icons,
159in order to easier identify a flange variable in a diagram.
160Both connector classes contain the following variables:
161</p>
162<pre>
163   Modelica.SIunits.Angle       phi  \"Absolute rotation angle of flange\";
164   <b>flow</b> Modelica.SIunits.Torque tau  \"Cut-torque in the flange\";
165</pre>
166<p>
167If needed, the angular velocity <tt>w</tt> and the
168angular acceleration <tt>a</tt> of a flange connector can be
169determined by differentiation of the flange angle <tt>phi</tt>:
170</p>
171<pre>
172     w = <b>der</b>(phi);    a = <b>der</b>(w);
173</pre>
174</HTML>"));
175
176  end FlangeConnectors;
177
178  class SupportTorques "Support Torques"
179
180    annotation (__Dymola_DocumentationClass=true, Documentation(info="<HTML>
181 
182<p>The following figure shows examples of components equipped with
183a support flange (framed flange in the lower center), which can be used
184to fix components on the ground or on other rotating elements or to combine
185them with force elements. Via Boolean parameter <b>useSupport</b>, the
186support torque is enabled or disabled. If it is enabled, it must be connected.
187If it is disabled, it must not be connected.
188Enabled support flanges offer, e.g., the possibility to model gearboxes mounted on
189the ground via spring-damper-systems (cf. example
190<a href=\"Modelica://Modelica.Mechanics.Rotational.Examples.ElasticBearing\">ElasticBearing</a>).
191</p>
192 
193<p><IMG SRC=\"../Images/Rotational/bearing.png\" ALT=\"bearing\"></p>
194 
195<p>
196Depending on the setting of <b>useSupport</b>, the icon of the corresponding
197component is changing, to either show the support flange or a ground mounting.
198For example, the two implementations in the following figure give
199identical results.</p>
200 
201<p><IMG SRC=\"../Images/Rotational/bearing2.png\" ALT=\"bearing2\"></p>
202 
203</HTML>"));
204
205  end SupportTorques;
206
207  class SignConventions "Sign Conventions"
208
209    annotation (__Dymola_DocumentationClass=true, Documentation(info="<HTML>
210 
211<p>
212The variables of a component of this library can be accessed in the
213usual way. However, since most of these variables are basically elements
214of <b>vectors</b>, i.e., have a direction, the question arises how the
215signs of variables shall be interpreted. The basic idea is explained
216at hand of the following figure:
217</p>
218<p><IMG SRC=\"../Images/Rotational/drive2.png\" ALT=\"drive2\"></p>
219<p>
220In the figure, three identical drive trains are shown. The only
221difference is that the gear of the middle drive train and the
222gear as well as the right inertia of the lower drive train
223are horizontally flipped with regards to the upper drive train.
224The signs of variables are now interpreted in the following way:
225Due to the 1-dimensional nature of the model, all components are
226basically connected together along one line (more complicated
227cases are discussed below). First, one has to define
228a <b>positive</b> direction of this line, called <b>axis of rotation</b>.
229In the top part of the figure this is characterized by an arrow
230defined as <tt>axis of rotation</tt>. The simple rule is now:
231If a variable of a component is positive and can be interpreted as
232the element of a vector (e.g. torque or angular velocity vector), the
233corresponding vector is directed into the positive direction
234of the axis of rotation. In the following figure, the right-most
235inertias of the figure above are displayed with the positive
236vector direction displayed according to this rule:
237</p>
238<p><IMG SRC=\"../Images/Rotational/drive3.png\" ALT=\"drive3\"></p>
239<p>
240The cut-torques <tt>J2.flange_a.tau, J4.flange_a.tau, J6.flange_b.tau</tt>
241of the right inertias are all identical and are directed into the
242direction of rotation if the values are positive. Similiarily,
243the angular velocities <tt>J2.w, J4.w, J6.w</tt> of the right inertias
244are all identical and are also directed into the
245direction of rotation if the values are positive. Some special
246cases are shown in the next figure:
247</p>
248<p><IMG SRC=\"../Images/Rotational/drive4.png\" ALT=\"drive4\"></p>
249<p>
250In the upper part of the figure, two variants of the connection of an
251external torque and an inertia are shown. In both cases, a positive
252signal input into the torque component accelerates the inertias
253<tt>inertia1, inertia2</tt> into the positive axis of rotation,
254i.e., the angular accelerations <tt>inertia1.a, inertia2.a</tt>
255are positive and are directed along the \"axis of rotation\" arrow.
256In the lower part of the figure the connection of inertias with
257a planetary gear is shown. Note, that the three flanges of the
258planetary gearbox are located along the axis of rotation and that
259the axis direction determines the positive rotation along these
260flanges. As a result, the positive rotation for <tt>inertia4, inertia6</tt>
261is as indicated with the additional grey arrows.
262</p>
263</HTML>"));
264
265  end SignConventions;
266
267  class UserDefinedComponents "User Defined Components"
268
269    annotation (__Dymola_DocumentationClass=true, Documentation(info="<HTML>
270<p>
271In this section some hints are given to define your own
2721-dimensional rotational components which are compatible with the
273elements of this package.
274It is convenient to define a new
275component by inheritance from one of the following base classes,
276which are defined in sublibrary Interfaces:
277</p>
278<table BORDER=1 CELLSPACING=0 CELLPADDING=2>
279<tr><th>Name</th><th>Description</th></tr>
280<tr>
281  <td valign=\"top\"><a href=\"Modelica://Modelica.Mechanics.Rotational.Interfaces.PartialRigid\">PartialRigid</a>
282</td>
283  <td valign=\"top\">Rigid connection of two rotational 1-dim. flanges
284                   (used for elements with inertia).
285  </td>
286</tr>
287
288<tr>
289  <td valign=\"top\"><a href=\"Modelica://Modelica.Mechanics.Rotational.Interfaces.PartialCompliant\">PartialCompliant</a>
290  </td>
291  <td valign=\"top\">Compliant connection of two rotational 1-dim. flanges
292                   (used for force laws such as a spring or a damper).</td>
293</tr>
294
295<tr>
296  <td valign=\"top\"><a href=\"Modelica://Modelica.Mechanics.Rotational.Interfaces.PartialGear\">PartialGear</a>
297</td>
298  <td valign=\"top\"> Partial model for a 1-dim. rotational gear consisting of the flange of
299                    an input shaft, the flange of an output shaft and the support.
300  </td>
301</tr>
302
303<tr>
304  <td valign=\"top\"><a href=\"Modelica://Modelica.Mechanics.Rotational.Interfaces.PartialTorque\">PartialTorque</a>
305</td>
306  <td valign=\"top\"> Partial model of a torque acting at the flange (accelerates the flange).
307  </td>
308</tr>
309
310<tr>
311  <td valign=\"top\"><a href=\"Modelica://Modelica.Mechanics.Rotational.Interfaces.PartialTwoFlanges\">PartialTwoFlanges</a>
312</td>
313  <td valign=\"top\">General connection of two rotational 1-dim. flanges.
314  </td>
315</tr>
316
317<tr>
318  <td valign=\"top\"><a href=\"Modelica://Modelica.Mechanics.Rotational.Interfaces.PartialAbsoluteSensor\">PartialAbsoluteSensor</a>
319</td>
320  <td valign=\"top\">Measure absolute flange variables.
321  </td>
322</tr>
323
324<tr>
325  <td valign=\"top\"><a href=\"Modelica://Modelica.Mechanics.Rotational.Interfaces.PartialRelativeSensor\">PartialRelativeSensor</a>
326</td>
327  <td valign=\"top\">Measure relative flange variables.
328  </td>
329</tr>
330</table>
331
332<p>
333The difference between these base classes are the auxiliary
334variables defined in the model and the relations between
335the flange variables already defined in the base class.
336For example, in model <b>PartialRigid</b> the flanges flange_a and
337flange_b are rigidly connected, i.e., flange_a.phi = flange_b.phi,
338whereas in model <b>PartialCompliant</b> the cut-torques are the
339same, i.e., flange_a.tau + flange_b.tau = 0.
340</p>
341<p>
342The equations of a mechanical component are vector equations, i.e.,
343they need to be expressed in a common coordinate system.
344Therefore, for a component a <b>local axis of rotation</b> has to be
345defined. All vector quantities, such as cut-torques or angular
346velocities have to be expressed according to this definition.
347Examples for such a definition are given in the following figure
348for an inertia component and a planetary gearbox:
349</p>
350<p><IMG SRC=\"../Images/Rotational/driveAxis.png\" ALT=\"driveAxis\"></p>
351<p>
352As can be seen, all vectors are directed into the direction
353of the rotation axis. The angles in the flanges are defined
354correspondingly. For example, the angle <tt>sun.phi</tt> in the
355flange of the sun wheel of the planetary gearbox is positive,
356if rotated in mathematical positive direction (= counter clock
357wise) along the axis of rotation.
358</p>
359<p>
360On first view, one may assume that the selected local
361coordinate system has an influence on the usage of the
362component. But this is not the case, as shown in the next figure:
363</p>
364<p><IMG SRC=\"../Images/Rotational/inertias.png\" ALT=\"inertias\"></p>
365<p>
366In the figure the <b>local</b> axes of rotation of the components
367are shown. The connection of two inertias in the left and in the
368right part of the figure are completely equivalent, i.e., the right
369part is just a different drawing of the left part. This is due to the
370fact, that by a connection, the two local coordinate systems are
371made identical and the (automatically) generated connection equations
372(= angles are identical, cut-torques sum-up to zero) are also
373expressed in this common coordinate system. Therefore, even if in
374the left figure it seems to be that the angular velocity vector of
375<tt>J2</tt> goes from right to left, in reality it goes from
376left to right as shown in the right part of the figure, where the
377local coordinate systems are drawn such that they are aligned.
378Note, that the simple rule stated in section 4 (Sign conventions)
379also determines that
380the angular velocity of <tt>J2</tt> in the left part of the
381figure is directed from left to right.
382</p>
383<p>
384To summarize, the local coordinate system selected for a component
385is just necessary, in order that the equations of this component
386are expressed correctly. The selection of the coordinate system
387is arbitrary and has no influence on the usage of the component.
388Especially, the actual direction of, e.g., a cut-torque is most
389easily determined by the rule of section 4. A more strict determination
390by aligning coordinate systems and then using the vector direction
391of the local coordinate systems, often requires a re-drawing of the
392diagram and is therefore less convenient to use.
393</p>
394</HTML>"));
395
396  end UserDefinedComponents;
397
398  class RequirementsForSimulationTool "Requirements for Simulation Tools"
399
400    annotation (__Dymola_DocumentationClass=true, Documentation(info="<HTML>
401 
402<p>
403This library is designed in a fully object oriented way in order that
404components can be connected together in every meaningful combination
405(e.g. direct connection of two springs or two inertias).
406As a consequence, most models lead to a system of
407differential-algebraic equations of <b>index 3</b> (= constraint
408equations have to be differentiated twice in order to arrive at
409a state space representation) and the Modelica translator or
410the simulator has to cope with this system representation.
411According to our present knowledge, this requires that the
412Modelica translator is able to symbolically differentiate equations
413(otherwise it is e.g. not possible to provide consistent initial
414conditions; even if consistent initial conditions are present, most
415numerical DAE integrators can cope at most with index 2 DAEs).
416</p>
417</p>
418The elements of this library can be connected together in an
419arbitrary way. However, difficulties may occur, if the elements which can <b>lock</b> the
420<b>relative motion</b> between two flanges are connected <b>rigidly</b>
421together such that essentially the <b>same relative motion</b> can be locked.
422The reason is
423that the cut-torque in the locked phase is not uniquely defined if the
424elements are locked at the same time instant (i.e., there does not exist a
425unique solution) and some simulation systems may not be
426able to handle this situation, since this leads to a singularity during
427simulation. Currently, this type of problem can occur with the
428Coulomb friction elements <b>BearingFriction, Clutch, Brake, LossyGear</b> when
429the elements become stuck:
430</p>
431<p><IMG SRC=\"../Images/Rotational/driveConnections3.png\" ALT=\"driveConnections3\"></p>
432<p>
433In the figure above two typical situations are shown: In the upper part of
434the figure, the series connection of rigidly attached BearingFriction and
435Clutch components are shown. This does not hurt, because the BearingFriction
436element can lock the relative motion between the element and the housing,
437whereas the clutch element can lock the relative motion between the two
438connected flanges. Contrary, the drive train in the lower part of the figure
439may give rise to simulation problems, because the BearingFriction element
440and the Brake element can lock the relative motion between a flange and
441the housing and these flanges are rigidly connected together, i.e.,
442essentially the same relative motion can be locked. These difficulties
443may be solved by either introducing a compliance between these flanges
444or by combining the BearingFriction and Brake element into
445one component and resolving the ambiguity of the frictional torque in the
446stuck mode. A tool may handle this situation also <b>automatically</b>,
447by picking one solution of the infinitely many, e.g., the one where
448the difference to the value of the previous time instant is as small
449as possible.
450</p>
451 
452</HTML>"));
453
454  end RequirementsForSimulationTool;
455
456  class Contact "Contact"
457
458    annotation (Documentation(info="<html>
459<dl>
460<dt><b>Library Officer</b>
461<dd><a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> <br>
462    Deutsches Zentrum f&uuml;r Luft und Raumfahrt e.V. (DLR)<br>
463    Institut f&uuml;r Robotik und Mechatronik (DLR-RM)<br> 
464    Abteilung Systemdynamik und Regelungstechnik<br>
465    Postfach 1116<br>
466    D-82230 Wessling<br>
467    Germany<br>
468    email: <A HREF=\"mailto:Martin.Otter@dlr.de\">Martin.Otter@dlr.de</A><br><br>
469</dl>
470
471<p>
472<b>Contributors to this library:</b>
473</p>
474
475<ul>
476<li> <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> (DLR-RM)</li>
477<li> Christian Schweiger (DLR-RM, until 2006).</li>
478<li> <a href=\"http://www.haumer.at/\">Anton Haumer</a><br>
479     Technical Consulting & Electrical Engineering<br>
480     A-3423 St.Andrae-Woerdern, Austria<br>
481     email: <a href=\"mailto:a.haumer@haumer.at\">a.haumer@haumer.at</a></li>
482</ul>
483
484</html>
485"));
486  end Contact;
487
488end UsersGuide;
489
490  package Examples "Demonstration examples of the components of this package"
491
492    extends Modelica.Icons.Library;
493
494    annotation ( Documentation(info="<html>
495<p>
496This package contains example models to demonstrate the usage of the
497Modelica.Mechanics.Rotational package. Open the models and
498simulate them according to the provided description in the models.
499</p>
500 
501</HTML>
502"));
503    model First "First example: simple drive train"
504      import SI = Modelica.SIunits;
505
506      extends Modelica.Icons.Example;
507
508      parameter Modelica.SIunits.Torque amplitude=10
509        "Amplitude of driving torque";
510      parameter SI.Frequency freqHz=5 "Frequency of driving torque";
511      parameter SI.Inertia Jmotor(min=0)=0.1 "Motor inertia";
512      parameter SI.Inertia Jload(min=0)=2 "Load inertia";
513      parameter Real ratio=10 "Gear ratio";
514      parameter Real damping=10 "Damping in bearing of gear";
515
516      annotation (Documentation(info="<html>
517<p>The drive train consists of a motor inertia which is driven by
518a sine-wave motor torque. Via a gearbox the rotational energy is
519transmitted to a load inertia. Elasticity in the gearbox is modeled
520by a spring element. A linear damper is used to model the
521damping in the gearbox bearing.</p>
522<p>Note, that a force component (like the damper of this example)
523which is acting between a shaft and the housing has to be fixed
524in the housing on one side via component Fixed.</p>
525<p>Simulate for 1 second and plot the following variables:<br>
526   angular velocities of inertias inertia2 and 3: inertia2.w, inertia3.w</p>
527 
528</html>"), Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,
529                -100},{100,100}}),
530                   graphics),
531        experiment);
532
533      Rotational.Components.Fixed fixed
534                             annotation (Placement(transformation(extent={{38,
535                -48},{54,-32}}, rotation=0)));
536      Rotational.Sources.Torque torque(useSupport=true) 
537                               annotation (Placement(transformation(extent={{-68,-8},
538                {-52,8}},         rotation=0)));
539      Rotational.Components.Inertia inertia1(        J=Jmotor) 
540        annotation (Placement(transformation(extent={{-38,-8},{-22,8}},
541              rotation=0)));
542      Rotational.Components.IdealGear idealGear(        ratio=ratio, useSupport=
543           true) 
544        annotation (Placement(transformation(extent={{-8,-8},{8,8}},  rotation=
545                0)));
546      Rotational.Components.Inertia inertia2(        J=2,
547        phi(fixed=true, start=0),
548        w(fixed=true)) 
549                    annotation (Placement(transformation(extent={{22,-8},{38,8}},
550              rotation=0)));
551      Rotational.Components.Spring spring(        c=1.e4,
552        phi_rel(fixed=true))           annotation (Placement(transformation(
553              extent={{52,-8},{68,8}}, rotation=0)));
554      Rotational.Components.Inertia inertia3(        J=Jload, w(fixed=true)) 
555                    annotation (Placement(transformation(extent={{82,-8},{98,8}},
556              rotation=0)));
557      Rotational.Components.Damper damper(        d=damping) 
558        annotation (Placement(transformation(
559            origin={46,-22},
560            extent={{-8,-8},{8,8}},
561            rotation=270)));
562      Modelica.Blocks.Sources.Sine sine(amplitude=amplitude, freqHz=freqHz) 
563        annotation (Placement(transformation(extent={{-98,-8},{-82,8}},
564              rotation=0)));
565    equation
566      connect(inertia1.flange_b, idealGear.flange_a) 
567        annotation (Line(points={{-22,0},{-8,0}},  color={0,0,0}));
568      connect(idealGear.flange_b, inertia2.flange_a) 
569        annotation (Line(points={{8,0},{22,0}}, color={0,0,0}));
570      connect(inertia2.flange_b, spring.flange_a) 
571        annotation (Line(points={{38,0},{52,0}}, color={0,0,0}));
572      connect(spring.flange_b, inertia3.flange_a) 
573        annotation (Line(points={{68,0},{82,0}}, color={0,0,0}));
574      connect(damper.flange_a, inertia2.flange_b) 
575        annotation (Line(points={{46,-14},{46,0},{38,0}}, color={0,0,0}));
576      connect(damper.flange_b, fixed.flange) 
577        annotation (Line(points={{46,-30},{46,-40}}, color={0,0,0}));
578      connect(sine.y, torque.tau) annotation (Line(points={{-81.2,0},{-69.6,0}},
579            color={0,0,127}));
580      connect(torque.support, fixed.flange)   annotation (Line(points={{-60,-8},
581              {-60,-40},{46,-40}}, color={0,0,0}));
582      connect(idealGear.support, fixed.flange)   annotation (Line(points={{0,-8},{
583              0,-40},{46,-40}},       color={0,0,0}));
584      connect(torque.flange, inertia1.flange_a) annotation (Line(
585          points={{-52,0},{-38,0}},
586          color={0,0,0},
587          smooth=Smooth.None));
588    end First;
589
590    model FirstGrounded
591      "First example: simple drive train with grounded elments"
592      import SI = Modelica.SIunits;
593
594      extends Modelica.Icons.Example;
595
596      parameter Modelica.SIunits.Torque amplitude=10
597        "Amplitude of driving torque";
598      parameter SI.Frequency freqHz=5 "Frequency of driving torque";
599      parameter SI.Inertia Jmotor(min=0)=0.1 "Motor inertia";
600      parameter SI.Inertia Jload(min=0)=2 "Load inertia";
601      parameter Real ratio=10 "Gear ratio";
602      parameter Real damping=10 "Damping in bearing of gear";
603
604      annotation (Documentation(info="<html>
605<p>The drive train consists of a motor inertia which is driven by
606a sine-wave motor torque. Via a gearbox the rotational energy is
607transmitted to a load inertia. Elasticity in the gearbox is modeled
608by a spring element. A linear damper is used to model the
609damping in the gearbox bearing.</p>
610<p>Note, that a force component (like the damper of this example)
611which is acting between a shaft and the housing has to be fixed
612in the housing on one side via component Fixed.</p>
613<p>Simulate for 1 second and plot the following variables:<br>
614   angular velocities of inertias inertia2 and 3: inertia2.w, inertia3.w</p>
615 
616</HTML>"), Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,
617                -100},{100,100}}),
618                   graphics),
619        experiment(StopTime=1));
620
621      Rotational.Components.Fixed fixed
622                             annotation (Placement(transformation(extent={{38,-48},
623                {54,-32}},      rotation=0)));
624      Rotational.Sources.Torque torque(useSupport=false) 
625                               annotation (Placement(transformation(extent={{-68,-8},
626                {-52,8}},         rotation=0)));
627      Rotational.Components.Inertia inertia1(        J=Jmotor) 
628        annotation (Placement(transformation(extent={{-38,-8},{-22,8}},
629              rotation=0)));
630      Rotational.Components.IdealGear idealGear(ratio=ratio, useSupport=false) 
631        annotation (Placement(transformation(extent={{-8,-8},{8,8}},  rotation=
632                0)));
633      Rotational.Components.Inertia inertia2(        J=2,
634        phi(fixed=true, start=0),
635        w(fixed=true)) 
636                    annotation (Placement(transformation(extent={{22,-8},{38,8}},
637              rotation=0)));
638      Rotational.Components.Spring spring(        c=1.e4,
639        phi_rel(fixed=true))           annotation (Placement(transformation(
640              extent={{52,-8},{68,8}}, rotation=0)));
641      Rotational.Components.Inertia inertia3(        J=Jload, w(fixed=true)) 
642                    annotation (Placement(transformation(extent={{82,-8},{98,8}},
643              rotation=0)));
644      Rotational.Components.Damper damper(        d=damping) 
645        annotation (Placement(transformation(
646            origin={46,-22},
647            extent={{-8,-8},{8,8}},
648            rotation=270)));
649      Modelica.Blocks.Sources.Sine sine(amplitude=amplitude, freqHz=freqHz) 
650        annotation (Placement(transformation(extent={{-98,-8},{-82,8}},
651              rotation=0)));
652    equation
653      connect(inertia1.flange_b, idealGear.flange_a) 
654        annotation (Line(points={{-22,0},{-8,0}},  color={0,0,0}));
655      connect(idealGear.flange_b, inertia2.flange_a) 
656        annotation (Line(points={{8,0},{22,0}}, color={0,0,0}));
657      connect(inertia2.flange_b, spring.flange_a) 
658        annotation (Line(points={{38,0},{52,0}}, color={0,0,0}));
659      connect(spring.flange_b, inertia3.flange_a) 
660        annotation (Line(points={{68,0},{82,0}}, color={0,0,0}));
661      connect(damper.flange_a, inertia2.flange_b) 
662        annotation (Line(points={{46,-14},{46,0},{38,0}}, color={0,0,0}));
663      connect(damper.flange_b, fixed.flange) 
664        annotation (Line(points={{46,-30},{46,-40}}, color={0,0,0}));
665      connect(sine.y, torque.tau) annotation (Line(points={{-81.2,0},{-69.6,0}},
666            color={0,0,127}));
667      connect(torque.flange, inertia1.flange_a) annotation (Line(
668          points={{-52,0},{-38,0}},
669          color={0,0,0},
670          smooth=Smooth.None));
671    end FirstGrounded;
672