Changeset 1100
- Timestamp:
- 03/06/08 16:25:49 (6 months ago)
- Location:
- trunk/Modelica/Mechanics
- Files:
-
- 2 modified
-
Rotational.mo (modified) (181 diffs)
-
Translational.mo (modified) (143 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modelica/Mechanics/Rotational.mo
r1072 r1100 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 version="1.1.1", versionDate="2007-11-22" 9 , 8 version="1.1.1", versionDate="2007-11-22", 10 9 Documentation(info="<html> 11 10 … … 50 49 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 51 50 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}), 61 60 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}), 66 65 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}), 71 70 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, 75 74 fillColor={192,192,192})})); 76 77 package UsersGuide "User's Guide of Rotational Library" 78 75 76 package UsersGuide "User's Guide of Rotational Library" 77 79 78 annotation (DocumentationClass=true, Documentation(info="<HTML> 80 79 <p> … … 85 84 86 85 </HTML>")); 87 88 class Overview "Overview" 89 86 87 class Overview "Overview" 88 90 89 annotation (DocumentationClass=true, Documentation(info="<HTML> 91 90 … … 146 145 147 146 </HTML>")); 148 147 149 148 end Overview; 150 151 class FlangeConnectors "Flange Connectors" 152 149 150 class FlangeConnectors "Flange Connectors" 151 153 152 annotation (DocumentationClass=true, Documentation(info="<HTML> 154 153 <p> … … 173 172 </pre> 174 173 </HTML>")); 175 174 176 175 end FlangeConnectors; 177 178 class SupportTorques "Support Torques" 179 176 177 class SupportTorques "Support Torques" 178 180 179 annotation (DocumentationClass=true, Documentation(info="<HTML> 181 180 … … 202 201 203 202 </HTML>")); 204 203 205 204 end SupportTorques; 206 207 class SignConventions "Sign Conventions" 208 205 206 class SignConventions "Sign Conventions" 207 209 208 annotation (DocumentationClass=true, Documentation(info="<HTML> 210 209 … … 262 261 </p> 263 262 </HTML>")); 264 263 265 264 end SignConventions; 266 267 class UserDefinedComponents "User Defined Components" 268 265 266 class UserDefinedComponents "User Defined Components" 267 269 268 annotation (DocumentationClass=true, Documentation(info="<HTML> 270 269 <p> … … 393 392 </p> 394 393 </HTML>")); 395 394 396 395 end UserDefinedComponents; 397 398 class RequirementsForSimulationTool "Requirements for Simulation Tools" 399 396 397 class RequirementsForSimulationTool "Requirements for Simulation Tools" 398 400 399 annotation (DocumentationClass=true, Documentation(info="<HTML> 401 400 … … 451 450 452 451 </HTML>")); 453 452 454 453 end RequirementsForSimulationTool; 455 456 class Contact "Contact" 457 454 455 class Contact "Contact" 456 458 457 annotation (Documentation(info="<html> 459 458 <dl> … … 485 484 ")); 486 485 end Contact; 487 486 488 487 end 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 492 491 extends Modelica.Icons.Library; 493 492 494 493 annotation ( Documentation(info="<html> 495 494 <p> … … 501 500 </HTML> 502 501 ")); 503 model First "First example: simple drive train" 502 model First "First example: simple drive train" 504 503 import SI = Modelica.SIunits; 505 504 506 505 extends Modelica.Icons.Example; 507 508 parameter Modelica.SIunits.Torque amplitude=10 506 507 parameter Modelica.SIunits.Torque amplitude=10 509 508 "Amplitude of driving torque"; 510 509 parameter SI.Frequency freqHz=5 "Frequency of driving torque"; … … 513 512 parameter Real ratio=10 "Gear ratio"; 514 513 parameter Real damping=10 "Damping in bearing of gear"; 515 514 516 515 annotation (Documentation(info="<html> 517 516 <p>The drive train consists of a motor inertia which is driven by … … 530 529 graphics), 531 530 experiment); 532 531 533 532 Rotational.Components.Fixed fixed 534 533 annotation (Placement(transformation(extent={{38, … … 563 562 annotation (Placement(transformation(extent={{-98,-8},{-82,8}}, 564 563 rotation=0))); 565 equation 564 equation 566 565 connect(inertia1.flange_b, idealGear.flange_a) 567 566 annotation (Line(points={{-22,0},{-8,0}}, color={0,0,0})); … … 587 586 smooth=Smooth.None)); 588 587 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" 592 591 import SI = Modelica.SIunits; 593 592 594 593 extends Modelica.Icons.Example; 595 596 parameter Modelica.SIunits.Torque amplitude=10 594 595 parameter Modelica.SIunits.Torque amplitude=10 597 596 "Amplitude of driving torque"; 598 597 parameter SI.Frequency freqHz=5 "Frequency of driving torque"; … … 601 600 parameter Real ratio=10 "Gear ratio"; 602 601 parameter Real damping=10 "Damping in bearing of gear"; 603 602 604 603 annotation (Documentation(info="<html> 605 604 <p>The drive train consists of a motor inertia which is driven by … … 618 617 graphics), 619 618 experiment(StopTime=1)); 620 619 621 620 Rotational.Components.Fixed fixed 622 621 annotation (Placement(transformation(extent={{38,-48}, … … 650 649 annotation (Placement(transformation(extent={{-98,-8},{-82,8}}, 651 650 rotation=0))); 652 equation 651 equation 653 652 connect(inertia1.flange_b, idealGear.flange_a) 654 653 annotation (Line(points={{-22,0},{-8,0}}, color={0,0,0})); … … 670 669 smooth=Smooth.None)); 671 670 end FirstGrounded; 672 673 model Friction "Drive train with clutch and brake" 671 672 model Friction "Drive train with clutch and brake" 674 673 import Modelica.Constants.pi; 675 674 import SI = Modelica.SIunits; 676 675 677 676 extends Modelica.Icons.Example; 678 677 679 678 parameter SI.Time startTime=0.5 "Start time of step"; 680 679 681 680 output SI.Torque tMotor "driving torque of inertia3"; 682 681 output SI.Torque tClutch "friction torque of clutch"; 683 682 output SI.Torque tBrake "friction torque of brake"; 684 683 output SI.Torque tSpring "spring torque"; 685 684 686 685 annotation (Documentation(info="<html> 687 686 <p>This drive train contains a frictional <b>clutch</b> and a <b>brake</b>. … … 707 706 grid={2,2}), graphics), 708 707 experiment(StopTime=3)); 709 708 710 709 Rotational.Sources.Torque torque(useSupport=true) 711 710 annotation (Placement(transformation(extent={{-90,-10}, … … 771 770 annotation (Placement(transformation(extent={{-10,-30}, 772 771 {10,-10}}, rotation=0))); 773 equation 772 equation 774 773 tMotor = torque.tau; 775 774 tClutch = clutch.tau; 776 775 tBrake = brake.tau; 777 776 tSpring = spring.tau; 778 777 779 778 connect(torque.flange, inertia3.flange_a) 780 779 annotation (Line(points={{-70,0},{-70,0},{-60,0}}, … … 809 808 -20},{0,-20}}, color={0,0,0})); 810 809 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 814 813 import SI = Modelica.SIunits; 815 814 816 815 extends Modelica.Icons.Example; 817 818 parameter SI.Frequency freqHz=0.2 816 817 parameter SI.Frequency freqHz=0.2 819 818 "frequency of sine function to invoke clutch1"; 820 819 parameter SI.Time T2=0.4 "time when clutch2 is invoked"; 821 820 parameter SI.Time T3=0.9 "time when clutch3 is invoked"; 822 821 823 822 annotation (Documentation(info="<html> 824 823 <p>This example demonstrates how variable structure … … 842 841 locked, forward sliding.</p> 843 842 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"), 845 845 Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-140,-80},{ 846 846 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= 1346 1346 0))); 1347 1347 annotation ( 1348 1349 1348 Icon(coordinateSystem( 1350 1349 preserveAspectRatio=true, … … 1352 1351 grid={2,2}), graphics={ 1353 1352 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}), 1362 1361 Line(points={{0,-40},{0,-10}}, color={0,0,0})}), 1363 1362 Documentation(info="<html> … … 1384 1383 Line(points={{-40,-40},{-80,-80}}, color={0,0,0}), 1385 1384 Line(points={{0,-40},{0,-4}}, color={0,0,0})})); 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 1410 1409 Documentation(info="<html> 1411 1410 <p>
