Changeset 1120
- Timestamp:
- 05/04/08 21:40:31 (5 months ago)
- Location:
- trunk/Modelica
- Files:
-
- 3 modified
-
Mechanics/Rotational.mo (modified) (179 diffs)
-
Mechanics/Translational.mo (modified) (142 diffs)
-
package.mo (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modelica/Mechanics/Rotational.mo
r1100 r1120 1 1 within Modelica.Mechanics; 2 package Rotational 3 "Library to model 1-dimensional, rotational mechanical systems" 2 package Rotational 3 "Library to model 1-dimensional, rotational mechanical systems" 4 4 extends Modelica.Icons.Library2; 5 5 import SI = Modelica.SIunits; 6 6 7 7 annotation ( 8 8 version="1.1.1", versionDate="2007-11-22", … … 49 49 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 50 50 100}}), graphics={ 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}), 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}), 60 60 Rectangle( 61 extent={{-47,-17},{27,-80}}, 62 lineColor={0,0,0}, 63 fillPattern=FillPattern.HorizontalCylinder, 64 fillColor={192,192,192}), 61 extent={{-47,-17},{27,-80}}, 62 lineColor={0,0,0}, 63 fillPattern=FillPattern.HorizontalCylinder, 64 fillColor={192,192,192}), 65 65 Rectangle( 66 extent={{-87,-41},{-47,-54}}, 67 lineColor={0,0,0}, 68 fillPattern=FillPattern.HorizontalCylinder, 69 fillColor={192,192,192}), 66 extent={{-87,-41},{-47,-54}}, 67 lineColor={0,0,0}, 68 fillPattern=FillPattern.HorizontalCylinder, 69 fillColor={192,192,192}), 70 70 Rectangle( 71 extent={{27,-42},{66,-56}}, 72 lineColor={0,0,0}, 73 fillPattern=FillPattern.HorizontalCylinder, 71 extent={{27,-42},{66,-56}}, 72 lineColor={0,0,0}, 73 fillPattern=FillPattern.HorizontalCylinder, 74 74 fillColor={192,192,192})})); 75 76 package UsersGuide "User's Guide of Rotational Library" 77 75 76 package UsersGuide "User's Guide of Rotational Library" 77 78 78 annotation (DocumentationClass=true, Documentation(info="<HTML> 79 79 <p> … … 84 84 85 85 </HTML>")); 86 87 class Overview "Overview" 88 86 87 class Overview "Overview" 88 89 89 annotation (DocumentationClass=true, Documentation(info="<HTML> 90 90 … … 145 145 146 146 </HTML>")); 147 147 148 148 end Overview; 149 150 class FlangeConnectors "Flange Connectors" 151 149 150 class FlangeConnectors "Flange Connectors" 151 152 152 annotation (DocumentationClass=true, Documentation(info="<HTML> 153 153 <p> … … 172 172 </pre> 173 173 </HTML>")); 174 174 175 175 end FlangeConnectors; 176 177 class SupportTorques "Support Torques" 178 176 177 class SupportTorques "Support Torques" 178 179 179 annotation (DocumentationClass=true, Documentation(info="<HTML> 180 180 … … 201 201 202 202 </HTML>")); 203 203 204 204 end SupportTorques; 205 206 class SignConventions "Sign Conventions" 207 205 206 class SignConventions "Sign Conventions" 207 208 208 annotation (DocumentationClass=true, Documentation(info="<HTML> 209 209 … … 261 261 </p> 262 262 </HTML>")); 263 263 264 264 end SignConventions; 265 266 class UserDefinedComponents "User Defined Components" 267 265 266 class UserDefinedComponents "User Defined Components" 267 268 268 annotation (DocumentationClass=true, Documentation(info="<HTML> 269 269 <p> … … 392 392 </p> 393 393 </HTML>")); 394 394 395 395 end UserDefinedComponents; 396 397 class RequirementsForSimulationTool "Requirements for Simulation Tools" 398 396 397 class RequirementsForSimulationTool "Requirements for Simulation Tools" 398 399 399 annotation (DocumentationClass=true, Documentation(info="<HTML> 400 400 … … 450 450 451 451 </HTML>")); 452 452 453 453 end RequirementsForSimulationTool; 454 455 class Contact "Contact" 456 454 455 class Contact "Contact" 456 457 457 annotation (Documentation(info="<html> 458 458 <dl> … … 484 484 ")); 485 485 end Contact; 486 486 487 487 end UsersGuide; 488 489 package Examples "Demonstration examples of the components of this package" 490 488 489 package Examples "Demonstration examples of the components of this package" 490 491 491 extends Modelica.Icons.Library; 492 492 493 493 annotation ( Documentation(info="<html> 494 494 <p> … … 500 500 </HTML> 501 501 ")); 502 model First "First example: simple drive train" 502 model First "First example: simple drive train" 503 503 import SI = Modelica.SIunits; 504 504 505 505 extends Modelica.Icons.Example; 506 507 parameter Modelica.SIunits.Torque amplitude=10 506 507 parameter Modelica.SIunits.Torque amplitude=10 508 508 "Amplitude of driving torque"; 509 509 parameter SI.Frequency freqHz=5 "Frequency of driving torque"; … … 512 512 parameter Real ratio=10 "Gear ratio"; 513 513 parameter Real damping=10 "Damping in bearing of gear"; 514 514 515 515 annotation (Documentation(info="<html> 516 516 <p>The drive train consists of a motor inertia which is driven by … … 529 529 graphics), 530 530 experiment); 531 531 532 532 Rotational.Components.Fixed fixed 533 533 annotation (Placement(transformation(extent={{38, … … 562 562 annotation (Placement(transformation(extent={{-98,-8},{-82,8}}, 563 563 rotation=0))); 564 equation 564 equation 565 565 connect(inertia1.flange_b, idealGear.flange_a) 566 566 annotation (Line(points={{-22,0},{-8,0}}, color={0,0,0})); … … 586 586 smooth=Smooth.None)); 587 587 end First; 588 589 model FirstGrounded 590 "First example: simple drive train with grounded elments" 588 589 model FirstGrounded 590 "First example: simple drive train with grounded elments" 591 591 import SI = Modelica.SIunits; 592 592 593 593 extends Modelica.Icons.Example; 594 595 parameter Modelica.SIunits.Torque amplitude=10 594 595 parameter Modelica.SIunits.Torque amplitude=10 596 596 "Amplitude of driving torque"; 597 597 parameter SI.Frequency freqHz=5 "Frequency of driving torque"; … … 600 600 parameter Real ratio=10 "Gear ratio"; 601 601 parameter Real damping=10 "Damping in bearing of gear"; 602 602 603 603 annotation (Documentation(info="<html> 604 604 <p>The drive train consists of a motor inertia which is driven by … … 617 617 graphics), 618 618 experiment(StopTime=1)); 619 619 620 620 Rotational.Components.Fixed fixed 621 621 annotation (Placement(transformation(extent={{38,-48}, … … 649 649 annotation (Placement(transformation(extent={{-98,-8},{-82,8}}, 650 650 rotation=0))); 651 equation 651 equation 652 652 connect(inertia1.flange_b, idealGear.flange_a) 653 653 annotation (Line(points={{-22,0},{-8,0}}, color={0,0,0})); … … 669 669 smooth=Smooth.None)); 670 670 end FirstGrounded; 671 672 model Friction "Drive train with clutch and brake" 671 672 model Friction "Drive train with clutch and brake" 673 673 import Modelica.Constants.pi; 674 674 import SI = Modelica.SIunits; 675 675 676 676 extends Modelica.Icons.Example; 677 677 678 678 parameter SI.Time startTime=0.5 "Start time of step"; 679 679 680 680 output SI.Torque tMotor "driving torque of inertia3"; 681 681 output SI.Torque tClutch "friction torque of clutch"; 682 682 output SI.Torque tBrake "friction torque of brake"; 683 683 output SI.Torque tSpring "spring torque"; 684 684 685 685 annotation (Documentation(info="<html> 686 686 <p>This drive train contains a frictional <b>clutch</b> and a <b>brake</b>. … … 706 706 grid={2,2}), graphics), 707 707 experiment(StopTime=3)); 708 708 709 709 Rotational.Sources.Torque torque(useSupport=true) 710 710 annotation (Placement(transformation(extent={{-90,-10}, … … 770 770 annotation (Placement(transformation(extent={{-10,-30}, 771 771 {10,-10}}, rotation=0))); 772 equation 772 equation 773 773 tMotor = torque.tau; 774 774 tClutch = clutch.tau; 775 775 tBrake = brake.tau; 776 776 tSpring = spring.tau; 777 777 778 778 connect(torque.flange, inertia3.flange_a) 779 779 annotation (Line(points={{-70,0},{-70,0},{-60,0}}, … … 808 808 -20},{0,-20}}, color={0,0,0})); 809 809 end Friction; 810 811 model CoupledClutches "Drive train with 3 dynamically coupled clutches" 812 810 811 model CoupledClutches "Drive train with 3 dynamically coupled clutches" 812 813 813 import SI = Modelica.SIunits; 814 814 815 815 extends Modelica.Icons.Example; 816 817 parameter SI.Frequency freqHz=0.2 816 817 parameter SI.Frequency freqHz=0.2 818 818 "frequency of sine function to invoke clutch1"; 819 819 parameter SI.Time T2=0.4 "time when clutch2 is invoked"; 820 820 parameter SI.Time T3=0.9 "time when clutch3 is invoked"; 821 821 822 822 annotation (Documentation(info="<html> 823 823 <p>This example demonstrates how variable structure … … 841 841 locked, forward sliding.</p> 842 842 843 </HTML>"), __Dymola_Commands(file="Scripts/__Dymola_CoupledClutches.mos" 843 </HTML>"), __Dymola_Commands(file="Scripts/__Dymola_CoupledClutches.mos" 844 844 "Simulate and Plot"), 845 845 Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-140,-80},{ … … 848 848 graphics), 849 849 experiment(StopTime=1.5)); 850 850 851 851 Rotational.Components.Inertia J1( 852 852 J=1, … … 905 905 annotation (Placement(transformation(extent={{-100, 906 906 -30},{-80,-10}}, rotation=0))); 907 equation 907 equation 908 908 connect(torque.flange, J1.flange_a) 909 909 annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0})); … … 937 937 color={0,0,0})); 938 938 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 943 943 import SI = Modelica.SIunits; 944 944 945 945 extends Modelica.Icons.Example; 946 946 SI.Power PowerLoss "power lost in the gear"; … … 1000 1000 annotation (Placement(transformation(extent={{-10, 1001 1001 -30},{10,-10}}, rotation=0))); 1002 equation 1002 equation 1003 1003 connect(Inertia1.flange_b, gear.flange_a) 1004 1004 annotation (Line(points={{-20,10},{-10,10}}, color={0,0,0})); … … 1011 1011 PowerLoss = gear.flange_a.tau*der(gear.flange_a.phi) + gear.flange_b.tau* 1012 1012 der(gear.flange_b.phi); 1013 1013 1014 1014 connect(DriveSine.y, torque1.tau) annotation (Line(points={{-79,10},{-72, 1015 1015 10}}, color={0,0,127})); … … 1023 1023 {60,-20},{60,0}}, color={0,0,0})); 1024 1024 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 1029 1029 import SI = Modelica.SIunits; 1030 1030 1031 1031 extends Modelica.Icons.Example; 1032 1032 SI.Power PowerLoss "power lost in the gear"; 1033 1033 1034 1034 annotation (Documentation(info="<html> 1035 1035 <p> … … 1097 1097 annotation (Placement(transformation(extent={{-20,-30}, 1098 1098 {0,-10}}, rotation=0))); 1099 equation 1099 equation 1100 1100 PowerLoss = gear.flange_a.tau*der(gear.flange_a.phi) + gear.flange_b.tau* 1101 1101 der(gear.flange_b.phi); … … 1126 1126 color={0,0,0})); 1127 1127 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" 1130 1130 extends Modelica.Icons.Example; 1131 1131 Rotational.Components.Inertia shaft( phi(fixed=true, start=0), w( … … 1179 1179 extent={{-10,-10},{10,10}}, 1180 1180 rotation=90))); 1181 equation 1181 equation 1182 1182 connect(torque.flange, shaft.flange_a) 1183 1183 annotation (Line(points={{-30,50},{-20,50}}, color={0,0,0})); … … 1201 1201 {-40,-60},{-40,40}}, color={0,0,0})); 1202 1202 end ElasticBearing; 1203 1204 model Backlash "Example to demonstrate backlash" 1203 1204 model Backlash "Example to demonstrate backlash" 1205 1205 extends Modelica.Icons.Example; 1206 1206 annotation (Diagram(coordinateSystem(preserveAspectRatio=true, … … 1241 1241 displayUnit="deg")) 1242 1242 annotation (Placement(transformation(extent={{20,-50},{40,-30}}))); 1243 equation 1243 equation 1244 1244 connect(springDamper.flange_b, inertia1.flange_a) 1245 1245 annotation (Line( … … 1261 1261 smooth=Smooth.None)); 1262 1262 end Backlash; 1263 1264 model RollingWheel "Demonstrate coupling Rotational - Translational" 1263 1264 model RollingWheel "Demonstrate coupling Rotational - Translational" 1265 1265 extends Modelica.Icons.Example; 1266 1266 Rotational.Components.IdealRollingWheel idealRollingWheel(radius=1) … … 1276 1276 Translational.Components.Mass mass(L=0, m=1) 1277 1277 annotation (Placement(transformation(extent={{20,-10},{40,10}}))); 1278 Translational.Sources.QuadraticSpeedDependentForce 1278 Translational.Sources.QuadraticSpeedDependentForce 1279 1279 quadraticSpeedDependentForce( 1280 1280 f_nominal=-10, … … 1282 1282 v_nominal=5) 1283 1283 annotation (Placement(transformation(extent={{72,-10},{52,10}}))); 1284 equation 1285 1284 equation 1285 1286 1286 annotation ( 1287 1287 Documentation(info="<html> … … 1314 1314 end RollingWheel; 1315 1315 end Examples; 1316 1317 package Components "Components for 1D rotational mechanical drive trains" 1316 1317 package Components "Components for 1D rotational mechanical drive trains" 1318 1318 extends Modelica.Icons.Library2; 1319 1319 annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, 1320 1320 -100},{100,100}}), graphics={ 1321 1321 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}), 1326 1326 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}), 1331 1331 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, 1335 1335 fillColor={192,192,192})}), Documentation(info="<html> 1336 1336 <p> … … 1338 1338 </p> 1339 1339 </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" 1342 1342 parameter SI.Angle phi0=0 "Fixed offset angle of housing"; 1343 1343 1344 1344 Interfaces.Flange_b flange "(right) flange fixed in housing" 1345 1345 annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation= … … 1351 1351 grid={2,2}), graphics={ 1352 1352 Text( 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}), 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}), 1361 1361 Line(points={{0,-40},{0,-10}}, color={0,0,0})}), 1362 1362 Documentation(info="<html> … … 1383 1383 Line(points={{-40,-40},{-80,-80}}, color={0,0,0}), 1384 1384 Line(points={{0,-40},{0,-4}}, color={0,0,0})})); 1385 1386 equation 1385 1386 equation 1387 1387 flange.phi = phi0; 1388 1388 end Fixed; 1389 1390 model Inertia "1D-rotational component with inertia" 1389 1390 model Inertia "1D-rotational component with inertia" 1391 1391 import SI = Modelica.SIunits; 1392 1392 Rotational.Interfaces.Flange_a flange_a "Left flange of shaft" … … 1397 1397 rotation=0))); 1398 1398 parameter SI.Inertia J(min=0, start=1) "Moment of inertia"; 1399 parameter StateSelect stateSelect=StateSelect.default 1399 parameter StateSelect stateSelect=StateSelect.default 1400 1400 "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) 1402 1402 "Absolute rotation angle of component" annotation(Dialog(group="Initialization", __Dymola_initialDialog=true)); 1403 SI.AngularVelocity w(stateSelect=stateSelect) 1403 SI.AngularVelocity w(stateSelect=stateSelect) 1404 1404 "Absolute angular velocity of component (= der(phi))" annotation(Dialog(group="Initialization", __Dymola_initialDialog=true)); 1405 SI.AngularAcceleration a 1405 SI.AngularAcceleration a 1406 1406 "Absolute angular acceleration of component (= der(w))" annotation(Dialog(group="Initialization", __Dymola_initialDialog=true)); 1407 1407 1408 1408 annotation ( 1409 1409 Documentation(info="<html> … … 1418 1418 grid={1,1}), graphics={ 1419 1419 Rectangle( 1420 extent={{-100,10},{-50,-10}}, 1421 lineColor={0,0,0}, 1422 fillPattern=FillPattern.HorizontalCylinder, 1423 fillColor={192,192,192}), 1424 Rectangle( 1425 extent={{50,10},{100,-10}}, 1426 lineColor={0,0,0}, 1427
