Changeset 1100 for trunk/Modelica

Show
Ignore:
Timestamp:
03/06/08 16:25:49 (9 months ago)
Author:
AHaumer
Message:

Solved the issue with double inheritance (although allowed by the Standard now but not really nice) of tau in Rotational.Components.Clutch (inherited from Interfaces.PartialCompliantWithRelativeStates and from Interfaces.PartialFriction):
Removed tau from Interfaces.PartialFriction (since not needed here).
As a consequence, tau had to be defined in Components.BearingFriction and Components.Brake which extend from Interfaces.PartialElementaryTwoFlangesAndSupport (where tau is not present) and Interfaces.PartialFriction (where tau has been removed).
Done the same in Translational.

Location:
trunk/Modelica/Mechanics
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/Modelica/Mechanics/Rotational.mo

    r1072 r1100  
    11within Modelica.Mechanics; 
    2 package Rotational 
    3   "Library to model 1-dimensional, rotational mechanical systems" 
     2package Rotational  
     3  "Library to model 1-dimensional, rotational mechanical systems"  
    44  extends Modelica.Icons.Library2; 
    55  import SI = Modelica.SIunits; 
    6  
     6   
    77  annotation ( 
    8   version="1.1.1", versionDate="2007-11-22" 
    9     , 
     8  version="1.1.1", versionDate="2007-11-22", 
    109    Documentation(info="<html> 
    1110  
     
    5049    Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 
    5150            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}), 
     51        Line(points={{-83,-66},{-63,-66}}, color={0,0,0}),  
     52        Line(points={{36,-68},{56,-68}}, color={0,0,0}),  
     53        Line(points={{-73,-66},{-73,-91}}, color={0,0,0}),  
     54        Line(points={{46,-68},{46,-91}}, color={0,0,0}),  
     55        Line(points={{-83,-29},{-63,-29}}, color={0,0,0}),  
     56        Line(points={{36,-32},{56,-32}}, color={0,0,0}),  
     57        Line(points={{-73,-9},{-73,-29}}, color={0,0,0}),  
     58        Line(points={{46,-12},{46,-32}}, color={0,0,0}),  
     59        Line(points={{-73,-91},{46,-91}}, color={0,0,0}),  
    6160        Rectangle( 
    62           extent={{-47,-17},{27,-80}}, 
    63           lineColor={0,0,0}, 
    64           fillPattern=FillPattern.HorizontalCylinder, 
    65           fillColor={192,192,192}), 
     61          extent={{-47,-17},{27,-80}},  
     62          lineColor={0,0,0},  
     63          fillPattern=FillPattern.HorizontalCylinder,  
     64          fillColor={192,192,192}),  
    6665        Rectangle( 
    67           extent={{-87,-41},{-47,-54}}, 
    68           lineColor={0,0,0}, 
    69           fillPattern=FillPattern.HorizontalCylinder, 
    70           fillColor={192,192,192}), 
     66          extent={{-87,-41},{-47,-54}},  
     67          lineColor={0,0,0},  
     68          fillPattern=FillPattern.HorizontalCylinder,  
     69          fillColor={192,192,192}),  
    7170        Rectangle( 
    72           extent={{27,-42},{66,-56}}, 
    73           lineColor={0,0,0}, 
    74           fillPattern=FillPattern.HorizontalCylinder, 
     71          extent={{27,-42},{66,-56}},  
     72          lineColor={0,0,0},  
     73          fillPattern=FillPattern.HorizontalCylinder,  
    7574          fillColor={192,192,192})})); 
    76  
    77 package UsersGuide "User's Guide of Rotational Library" 
    78  
     75   
     76package UsersGuide "User's Guide of Rotational Library"  
     77     
    7978  annotation (DocumentationClass=true, Documentation(info="<HTML> 
    8079<p> 
     
    8584 
    8685</HTML>")); 
    87  
    88   class Overview "Overview" 
    89  
     86     
     87  class Overview "Overview"  
     88       
    9089    annotation (DocumentationClass=true, Documentation(info="<HTML> 
    9190  
     
    146145  
    147146</HTML>")); 
    148  
     147       
    149148  end Overview; 
    150  
    151   class FlangeConnectors "Flange Connectors" 
    152  
     149     
     150  class FlangeConnectors "Flange Connectors"  
     151       
    153152    annotation (DocumentationClass=true, Documentation(info="<HTML> 
    154153<p> 
     
    173172</pre> 
    174173</HTML>")); 
    175  
     174       
    176175  end FlangeConnectors; 
    177  
    178   class SupportTorques "Support Torques" 
    179  
     176     
     177  class SupportTorques "Support Torques"  
     178       
    180179    annotation (DocumentationClass=true, Documentation(info="<HTML> 
    181180  
     
    202201  
    203202</HTML>")); 
    204  
     203       
    205204  end SupportTorques; 
    206  
    207   class SignConventions "Sign Conventions" 
    208  
     205     
     206  class SignConventions "Sign Conventions"  
     207       
    209208    annotation (DocumentationClass=true, Documentation(info="<HTML> 
    210209  
     
    262261</p> 
    263262</HTML>")); 
    264  
     263       
    265264  end SignConventions; 
    266  
    267   class UserDefinedComponents "User Defined Components" 
    268  
     265     
     266  class UserDefinedComponents "User Defined Components"  
     267       
    269268    annotation (DocumentationClass=true, Documentation(info="<HTML> 
    270269<p> 
     
    393392</p> 
    394393</HTML>")); 
    395  
     394       
    396395  end UserDefinedComponents; 
    397  
    398   class RequirementsForSimulationTool "Requirements for Simulation Tools" 
    399  
     396     
     397  class RequirementsForSimulationTool "Requirements for Simulation Tools"  
     398       
    400399    annotation (DocumentationClass=true, Documentation(info="<HTML> 
    401400  
     
    451450  
    452451</HTML>")); 
    453  
     452       
    454453  end RequirementsForSimulationTool; 
    455  
    456   class Contact "Contact" 
    457  
     454     
     455  class Contact "Contact"  
     456       
    458457    annotation (Documentation(info="<html> 
    459458<dl> 
     
    485484")); 
    486485  end Contact; 
    487  
     486     
    488487end UsersGuide; 
    489  
    490   package Examples "Demonstration examples of the components of this package" 
    491  
     488   
     489  package Examples "Demonstration examples of the components of this package"  
     490     
    492491    extends Modelica.Icons.Library; 
    493  
     492     
    494493    annotation ( Documentation(info="<html> 
    495494<p> 
     
    501500</HTML> 
    502501")); 
    503     model First "First example: simple drive train" 
     502    model First "First example: simple drive train"  
    504503      import SI = Modelica.SIunits; 
    505  
     504       
    506505      extends Modelica.Icons.Example; 
    507  
    508       parameter Modelica.SIunits.Torque amplitude=10 
     506       
     507      parameter Modelica.SIunits.Torque amplitude=10  
    509508        "Amplitude of driving torque"; 
    510509      parameter SI.Frequency freqHz=5 "Frequency of driving torque"; 
     
    513512      parameter Real ratio=10 "Gear ratio"; 
    514513      parameter Real damping=10 "Damping in bearing of gear"; 
    515  
     514       
    516515      annotation (Documentation(info="<html> 
    517516<p>The drive train consists of a motor inertia which is driven by 
     
    530529                   graphics), 
    531530        experiment); 
    532  
     531       
    533532      Rotational.Components.Fixed fixed  
    534533                             annotation (Placement(transformation(extent={{38, 
     
    563562        annotation (Placement(transformation(extent={{-98,-8},{-82,8}}, 
    564563              rotation=0))); 
    565     equation 
     564    equation  
    566565      connect(inertia1.flange_b, idealGear.flange_a)  
    567566        annotation (Line(points={{-22,0},{-8,0}},  color={0,0,0})); 
     
    587586          smooth=Smooth.None)); 
    588587    end First; 
    589  
    590     model FirstGrounded 
    591       "First example: simple drive train with grounded elments" 
     588     
     589    model FirstGrounded  
     590      "First example: simple drive train with grounded elments"  
    592591      import SI = Modelica.SIunits; 
    593  
     592       
    594593      extends Modelica.Icons.Example; 
    595  
    596       parameter Modelica.SIunits.Torque amplitude=10 
     594       
     595      parameter Modelica.SIunits.Torque amplitude=10  
    597596        "Amplitude of driving torque"; 
    598597      parameter SI.Frequency freqHz=5 "Frequency of driving torque"; 
     
    601600      parameter Real ratio=10 "Gear ratio"; 
    602601      parameter Real damping=10 "Damping in bearing of gear"; 
    603  
     602       
    604603      annotation (Documentation(info="<html> 
    605604<p>The drive train consists of a motor inertia which is driven by 
     
    618617                   graphics), 
    619618        experiment(StopTime=1)); 
    620  
     619       
    621620      Rotational.Components.Fixed fixed  
    622621                             annotation (Placement(transformation(extent={{38,-48}, 
     
    650649        annotation (Placement(transformation(extent={{-98,-8},{-82,8}}, 
    651650              rotation=0))); 
    652     equation 
     651    equation  
    653652      connect(inertia1.flange_b, idealGear.flange_a)  
    654653        annotation (Line(points={{-22,0},{-8,0}},  color={0,0,0})); 
     
    670669          smooth=Smooth.None)); 
    671670    end FirstGrounded; 
    672  
    673     model Friction "Drive train with clutch and brake" 
     671     
     672    model Friction "Drive train with clutch and brake"  
    674673      import Modelica.Constants.pi; 
    675674      import SI = Modelica.SIunits; 
    676  
     675       
    677676      extends Modelica.Icons.Example; 
    678  
     677       
    679678      parameter SI.Time startTime=0.5 "Start time of step"; 
    680  
     679       
    681680      output SI.Torque tMotor "driving torque of inertia3"; 
    682681      output SI.Torque tClutch "friction torque of clutch"; 
    683682      output SI.Torque tBrake "friction torque of brake"; 
    684683      output SI.Torque tSpring "spring torque"; 
    685  
     684       
    686685      annotation (Documentation(info="<html> 
    687686<p>This drive train contains a frictional <b>clutch</b> and a <b>brake</b>. 
     
    707706            grid={2,2}), graphics), 
    708707        experiment(StopTime=3)); 
    709  
     708       
    710709      Rotational.Sources.Torque torque(useSupport=true)  
    711710                               annotation (Placement(transformation(extent={{-90,-10}, 
     
    771770                             annotation (Placement(transformation(extent={{-10,-30}, 
    772771                {10,-10}},     rotation=0))); 
    773     equation 
     772    equation  
    774773      tMotor = torque.tau; 
    775774      tClutch = clutch.tau; 
    776775      tBrake = brake.tau; 
    777776      tSpring = spring.tau; 
    778  
     777       
    779778      connect(torque.flange, inertia3.flange_a)  
    780779        annotation (Line(points={{-70,0},{-70,0},{-60,0}}, 
     
    809808              -20},{0,-20}},    color={0,0,0})); 
    810809    end Friction; 
    811  
    812     model CoupledClutches "Drive train with 3 dynamically coupled clutches" 
    813  
     810     
     811    model CoupledClutches "Drive train with 3 dynamically coupled clutches"  
     812       
    814813      import SI = Modelica.SIunits; 
    815  
     814       
    816815      extends Modelica.Icons.Example; 
    817  
    818       parameter SI.Frequency freqHz=0.2 
     816       
     817      parameter SI.Frequency freqHz=0.2  
    819818        "frequency of sine function to invoke clutch1"; 
    820819      parameter SI.Time T2=0.4 "time when clutch2 is invoked"; 
    821820      parameter SI.Time T3=0.9 "time when clutch3 is invoked"; 
    822  
     821       
    823822      annotation (Documentation(info="<html> 
    824823<p>This example demonstrates how variable structure 
     
    842841locked, forward sliding.</p> 
    843842  
    844 </HTML>"), __Dymola_Commands(file="Scripts/__Dymola_CoupledClutches.mos" "Simulate and Plot"), 
     843</HTML>"), __Dymola_Commands(file="Scripts/__Dymola_CoupledClutches.mos"  
     844            "Simulate and Plot"), 
    845845        Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-140,-80},{ 
    846846                140,80}}, 
     
    848848                graphics), 
    849849        experiment(StopTime=1.5)); 
    850  
     850       
    851851      Rotational.Components.Inertia J1( 
    852852        J=1, 
     
    905905                             annotation (Placement(transformation(extent={{-100, 
    906906                -30},{-80,-10}}, rotation=0))); 
    907     equation 
     907    equation  
    908908      connect(torque.flange, J1.flange_a)  
    909909        annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0})); 
     
    937937                         color={0,0,0})); 
    938938    end CoupledClutches; 
    939  
    940     model LossyGearDemo1 
    941       "Example to show that gear efficiency may lead to stuck motion" 
    942  
     939     
     940    model LossyGearDemo1  
     941      "Example to show that gear efficiency may lead to stuck motion"  
     942       
    943943      import SI = Modelica.SIunits; 
    944  
     944       
    945945      extends Modelica.Icons.Example; 
    946946      SI.Power PowerLoss "power lost in the gear"; 
     
    10001000                             annotation (Placement(transformation(extent={{-10, 
    10011001                -30},{10,-10}}, rotation=0))); 
    1002     equation 
     1002    equation  
    10031003      connect(Inertia1.flange_b, gear.flange_a)  
    10041004        annotation (Line(points={{-20,10},{-10,10}}, color={0,0,0})); 
     
    10111011      PowerLoss = gear.flange_a.tau*der(gear.flange_a.phi) + gear.flange_b.tau* 
    10121012        der(gear.flange_b.phi); 
    1013  
     1013       
    10141014      connect(DriveSine.y, torque1.tau) annotation (Line(points={{-79,10},{-72, 
    10151015              10}}, color={0,0,127})); 
     
    10231023              {60,-20},{60,0}}, color={0,0,0})); 
    10241024    end LossyGearDemo1; 
    1025  
    1026     model LossyGearDemo2 
    1027       "Example to show combination of LossyGear and BearingFriction" 
    1028  
     1025     
     1026    model LossyGearDemo2  
     1027      "Example to show combination of LossyGear and BearingFriction"  
     1028       
    10291029      import SI = Modelica.SIunits; 
    1030  
     1030       
    10311031      extends Modelica.Icons.Example; 
    10321032      SI.Power PowerLoss "power lost in the gear"; 
    1033  
     1033       
    10341034      annotation (Documentation(info="<html> 
    10351035<p> 
     
    10971097                             annotation (Placement(transformation(extent={{-20,-30}, 
    10981098                {0,-10}},       rotation=0))); 
    1099     equation 
     1099    equation  
    11001100      PowerLoss = gear.flange_a.tau*der(gear.flange_a.phi) + gear.flange_b.tau* 
    11011101        der(gear.flange_b.phi); 
     
    11261126                                  color={0,0,0})); 
    11271127    end LossyGearDemo2; 
    1128  
    1129     model ElasticBearing "Example to show possible usage of support flange" 
     1128     
     1129    model ElasticBearing "Example to show possible usage of support flange"  
    11301130      extends Modelica.Icons.Example; 
    11311131      Rotational.Components.Inertia shaft(        phi(fixed=true, start=0), w( 
     
    11791179            extent={{-10,-10},{10,10}}, 
    11801180            rotation=90))); 
    1181     equation 
     1181    equation  
    11821182      connect(torque.flange, shaft.flange_a)  
    11831183        annotation (Line(points={{-30,50},{-20,50}}, color={0,0,0})); 
     
    12011201              {-40,-60},{-40,40}}, color={0,0,0})); 
    12021202    end ElasticBearing; 
    1203  
    1204     model Backlash "Example to demonstrate backlash" 
     1203     
     1204    model Backlash "Example to demonstrate backlash"  
    12051205      extends Modelica.Icons.Example; 
    12061206      annotation (Diagram(coordinateSystem(preserveAspectRatio=true, 
     
    12411241          displayUnit="deg"))  
    12421242        annotation (Placement(transformation(extent={{20,-50},{40,-30}}))); 
    1243     equation 
     1243    equation  
    12441244      connect(springDamper.flange_b, inertia1.flange_a)  
    12451245                                                       annotation (Line( 
     
    12611261          smooth=Smooth.None)); 
    12621262    end Backlash; 
    1263  
    1264     model RollingWheel "Demonstrate coupling Rotational - Translational" 
     1263     
     1264    model RollingWheel "Demonstrate coupling Rotational - Translational"  
    12651265      extends Modelica.Icons.Example; 
    12661266      Rotational.Components.IdealRollingWheel idealRollingWheel(radius=1)  
     
    12761276      Translational.Components.Mass mass(L=0, m=1)  
    12771277        annotation (Placement(transformation(extent={{20,-10},{40,10}}))); 
    1278       Translational.Sources.QuadraticSpeedDependentForce 
     1278      Translational.Sources.QuadraticSpeedDependentForce  
    12791279        quadraticSpeedDependentForce( 
    12801280        f_nominal=-10, 
     
    12821282        v_nominal=5)  
    12831283        annotation (Placement(transformation(extent={{72,-10},{52,10}}))); 
    1284     equation 
    1285  
     1284    equation  
     1285       
    12861286      annotation ( 
    12871287        Documentation(info="<html> 
     
    13141314    end RollingWheel; 
    13151315  end Examples; 
    1316  
    1317   package Components "Components for 1D rotational mechanical drive trains" 
     1316   
     1317  package Components "Components for 1D rotational mechanical drive trains"  
    13181318    extends Modelica.Icons.Library2; 
    13191319    annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
    13201320              -100},{100,100}}), graphics={ 
    13211321          Rectangle( 
    1322             extent={{-58,8},{42,-92}}, 
    1323             lineColor={0,0,0}, 
    1324             fillPattern=FillPattern.HorizontalCylinder, 
    1325             fillColor={192,192,192}), 
     1322            extent={{-58,8},{42,-92}},  
     1323            lineColor={0,0,0},  
     1324            fillPattern=FillPattern.HorizontalCylinder,  
     1325            fillColor={192,192,192}),  
    13261326          Rectangle( 
    1327             extent={{-100,-32},{-58,-52}}, 
    1328             lineColor={0,0,0}, 
    1329             fillPattern=FillPattern.HorizontalCylinder, 
    1330             fillColor={192,192,192}), 
     1327            extent={{-100,-32},{-58,-52}},  
     1328            lineColor={0,0,0},  
     1329            fillPattern=FillPattern.HorizontalCylinder,  
     1330            fillColor={192,192,192}),  
    13311331          Rectangle( 
    1332             extent={{42,-32},{80,-52}}, 
    1333             lineColor={0,0,0}, 
    1334             fillPattern=FillPattern.HorizontalCylinder, 
     1332            extent={{42,-32},{80,-52}},  
     1333            lineColor={0,0,0},  
     1334            fillPattern=FillPattern.HorizontalCylinder,  
    13351335            fillColor={192,192,192})}),                     Documentation(info="<html> 
    13361336<p> 
     
    13381338</p> 
    13391339</html>")); 
    1340  
    1341     model Fixed "Flange fixed in housing at a given angle" 
     1340     
     1341    model Fixed "Flange fixed in housing at a given angle"  
    13421342      parameter SI.Angle phi0=0 "Fixed offset angle of housing"; 
    1343  
     1343       
    13441344      Interfaces.Flange_b flange "(right) flange fixed in housing"  
    13451345        annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation= 
    13461346               0))); 
    13471347      annotation ( 
    1348          
    13491348        Icon(coordinateSystem( 
    13501349            preserveAspectRatio=true, 
     
    13521351            grid={2,2}), graphics={ 
    13531352            Text( 
    1354               extent={{-150,-90},{150,-130}}, 
    1355               lineColor={0,0,255}, 
    1356               textString="%name"), 
    1357             Line(points={{-80,-40},{80,-40}}, color={0,0,0}), 
    1358             Line(points={{80,-40},{40,-80}}, color={0,0,0}), 
    1359             Line(points={{40,-40},{0,-80}}, color={0,0,0}), 
    1360             Line(points={{0,-40},{-40,-80}}, color={0,0,0}), 
    1361             Line(points={{-40,-40},{-80,-80}}, color={0,0,0}), 
     1353              extent={{-150,-90},{150,-130}},  
     1354              lineColor={0,0,255},  
     1355              textString="%name"),  
     1356            Line(points={{-80,-40},{80,-40}}, color={0,0,0}),  
     1357            Line(points={{80,-40},{40,-80}}, color={0,0,0}),  
     1358            Line(points={{40,-40},{0,-80}}, color={0,0,0}),  
     1359            Line(points={{0,-40},{-40,-80}}, color={0,0,0}),  
     1360            Line(points={{-40,-40},{-80,-80}}, color={0,0,0}),  
    13621361            Line(points={{0,-40},{0,-10}}, color={0,0,0})}), 
    13631362        Documentation(info="<html> 
     
    13841383            Line(points={{-40,-40},{-80,-80}}, color={0,0,0}), 
    13851384            Line(points={{0,-40},{0,-4}}, color={0,0,0})})); 
    1386     equation 
     1385       
     1386    equation  
    13871387      flange.phi = phi0; 
    13881388    end Fixed; 
    1389  
    1390     model Inertia "1D-rotational component with inertia" 
     1389     
     1390    model Inertia "1D-rotational component with inertia"  
    13911391      import SI = Modelica.SIunits; 
    13921392      Rotational.Interfaces.Flange_a flange_a "Left flange of shaft"  
     
    13971397              rotation=0))); 
    13981398      parameter SI.Inertia J(min=0, start=1) "Moment of inertia"; 
    1399       parameter StateSelect stateSelect=StateSelect.default 
     1399      parameter StateSelect stateSelect=StateSelect.default  
    14001400        "Priority to use phi and w as states" annotation(HideResult=true,Dialog(tab="Advanced")); 
    1401       SI.Angle phi(stateSelect=stateSelect) 
     1401      SI.Angle phi(stateSelect=stateSelect)  
    14021402        "Absolute rotation angle of component" annotation(Dialog(group="Initialization", __Dymola_initialDialog=true)); 
    1403       SI.AngularVelocity w(stateSelect=stateSelect) 
     1403      SI.AngularVelocity w(stateSelect=stateSelect)  
    14041404        "Absolute angular velocity of component (= der(phi))" annotation(Dialog(group="Initialization", __Dymola_initialDialog=true)); 
    1405       SI.AngularAcceleration a 
     1405      SI.AngularAcceleration a  
    14061406        "Absolute angular acceleration of component (= der(w))" annotation(Dialog(group="Initialization", __Dymola_initialDialog=true)); 
    1407  
     1407       
    14081408      annotation ( 
    1409          
    14101409        Documentation(info="<html> 
    1411