- Timestamp:
- 05/25/08 10:33:05 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/maintenance/3.0/Modelica/Mechanics/Translational.mo
r1119 r1129 5 5 import SI = Modelica.SIunits; 6 6 annotation ( 7 version="1.1.1", versionDate="2007-11-22", 7 version="1.1.1", versionDate="2007-11-22" 8 , 8 9 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 9 10 100}}), graphics={ … … 158 159 159 160 annotation ( 161 160 162 Documentation(info="<html> 161 163 <p> … … 167 169 </HTML> 168 170 ")); 169 170 171 model SignConvention "Examples for the used sign conventions." 171 172 extends Modelica.Icons.Example; … … 276 277 extends Modelica.Icons.Example; 277 278 annotation ( 279 278 280 Documentation(info="<html> 279 281 <p> … … 397 399 extends Modelica.Icons.Example; 398 400 annotation ( 401 399 402 Documentation(info="<html> 400 403 <p> … … 434 437 color={0,0,255})}), 435 438 experiment(StopTime=1)); 436 437 439 Translational.Components.Fixed fixed 438 440 annotation (Placement(transformation(extent={{ … … 627 629 extends Modelica.Icons.Example; 628 630 annotation ( 631 629 632 Documentation(info="<html> 630 633 <p> … … 655 658 grid={2,2}), graphics), 656 659 experiment(StopTime=1)); 657 658 660 Translational.Components.Mass mass1( 659 661 L=1, … … 728 730 extends Modelica.Icons.Example; 729 731 annotation ( 732 730 733 Documentation(info="<html> 731 734 <p> … … 755 758 grid={2,2}), graphics), 756 759 experiment(StopTime=1)); 757 758 760 Translational.Sensors.ForceSensor forceSensor annotation (Placement( 759 761 transformation(extent={{-20,40},{0,60}}, rotation=0))); … … 823 825 extent={{-100,20},{-80,0}}, 824 826 textString="2)", 825 lineColor={0,0,255})}), 827 lineColor={0,0,255})}) 828 , 826 829 Documentation(info="<html> 827 830 <ol> … … 892 895 893 896 annotation ( 897 894 898 Diagram(coordinateSystem( 895 899 preserveAspectRatio=true, … … 1191 1195 1192 1196 annotation ( 1197 1193 1198 Icon(coordinateSystem( 1194 1199 preserveAspectRatio=true, … … 1223 1228 </HTML> 1224 1229 ")); 1225 1226 1230 Interfaces.Flange_b flange annotation (Placement(transformation( 1227 1231 origin={0,0}, … … 1242 1246 1243 1247 annotation ( 1248 1244 1249 Documentation(info="<html> 1245 1250 <p> … … 1323 1328 textString="Position s", 1324 1329 lineColor={0,0,255})})); 1325 1326 1330 equation 1327 1331 v = der(s); … … 1334 1338 1335 1339 annotation ( 1340 1336 1341 Documentation(info="<html> 1337 1342 <p> … … 1399 1404 textString="Length L", 1400 1405 lineColor={0,0,255})})); 1401 1402 1406 equation 1403 1407 0 = flange_a.f + flange_b.f; … … 1411 1415 1412 1416 annotation ( 1417 1413 1418 Documentation(info="<html> 1414 1419 <p> … … 1454 1459 Line(points={{-86,0},{-60,0},{-44,-30},{-16,30},{14,-30},{44,30},{ 1455 1460 60,0},{84,0}}, color={0,0,0})})); 1456 1457 1461 equation 1458 1462 f = c*(s_rel - s_rel0); … … 1464 1468 "damping constant"; 1465 1469 annotation ( 1470 1466 1471 Documentation(info="<html> 1467 1472 <p> … … 1520 1525 lineColor={128,128,128}, 1521 1526 textString="der(s_rel)")})); 1522 1523 1527 equation 1524 1528 f = d*v_rel; … … 1533 1537 parameter SI.Position s_rel0=0 "unstretched spring length"; 1534 1538 annotation ( 1539 1535 1540 Documentation(info="<html> 1536 1541 <p> … … 1605 1610 Line(points={{-90,0},{-80,0}}, color={0,0,0}), 1606 1611 Line(points={{90,0},{80,0}}, color={0,0,0})})); 1607 1608 1612 equation 1609 1613 f = c*(s_rel - s_rel0) + d*v_rel; … … 1619 1623 1620 1624 annotation ( 1625 1621 1626 Documentation(info="<html> 1622 1627 <p> … … 1784 1789 textString="%name", 1785 1790 lineColor={0,0,255})})); 1786 1787 1791 /* 1788 1792 Please note that initialization might fail due to the nonlinear spring characteristic … … 2473 2477 <li><i>June 10, 2002 by P. Beater, StateSelect.always for variables s and v (instead of fixed=true). </i> </li> 2474 2478 </ul> 2475 </html>"), 2479 </html>") 2480 , 2476 2481 Icon(coordinateSystem( 2477 2482 preserveAspectRatio=true, … … 2677 2682 constant SI.Acceleration unitAcceleration = 1 annotation(HideResult=true); 2678 2683 constant SI.Force unitForce = 1 annotation(HideResult=true); 2679 Real sa0 = (f0_max + (f0_max - f0))/unitForce2680 "Value of sa when start of forward sliding at w=0";2681 2684 equation 2682 2685 /* Friction characteristic … … 2685 2688 if for each configuration special code shall be generated) 2686 2689 */ 2687 startForward = pre(mode) == Stuck and sa > f0_max/unitForce and s < (smax - L/2) or 2690 startForward = pre(mode) == Stuck and 2691 (pre(startForward) or sa > f0_max/unitForce and sa > f0/unitForce and s < (smax - L/2)) or 2688 2692 pre(mode) == Backward and v_relfric > v_small or initial() and v_relfric > 0; 2689 startBackward = pre(mode) == Stuck and sa < -f0_max/unitForce and s > (smin + L/2) or 2693 startBackward = pre(mode) == Stuck and 2694 (pre(startBackward) or sa < -f0_max/unitForce and sa < -f0/unitForce and s > (smin + L/2)) or 2690 2695 pre(mode) == Forward and v_relfric < -v_small or initial() and v_relfric < 0; 2691 2696 locked = not free and … … 2693 2698 a_relfric/unitAcceleration = if locked then 0 else 2694 2699 if free then sa else 2695 if startForward then sa - sa0else2696 if startBackward then sa + sa0else2697 if pre(mode) == Forward then sa - sa0else2698 sa + sa0;2700 if startForward then sa - f0/unitForce else 2701 if startBackward then sa + f0/unitForce else 2702 if pre(mode) == Forward then sa - f0/unitForce else 2703 sa + f0/unitForce; 2699 2704 /* Friction torque has to be defined in a subclass. Example for a clutch: 2700 2705 f = if locked then sa else … … 2766 2771 SI.Acceleration a_rel(start=0) "relative angular acceleration"; 2767 2772 annotation ( 2773 2768 2774 Documentation(info="<html> 2769 2775 <p> … … 2860 2866 color={0,0,0}, 2861 2867 pattern=LinePattern.Dash)})); 2862 2863 2868 equation 2864 2869 s_rel = flange_b.s - flange_a.s; … … 2906 2911 constant Real bf=0.6180 "s*s coefficient of Bessel filter"; 2907 2912 annotation ( 2913 2908 2914 Documentation(info="<HTML> 2909 2915 <p> … … 2976 2982 extent={{-100,-100},{100,100}}, 2977 2983 grid={2,2}), graphics)); 2978 2979 2984 initial equation 2980 2985 if not exact then … … 3010 3015 transformation(extent={{-140,-20},{-100,20}}, rotation=0))); 3011 3016 annotation ( 3017 3012 3018 Documentation(info="<HTML> 3013 3019 <p> … … 3080 3086 extent={{-100,-100},{100,100}}, 3081 3087 grid={2,2}), graphics)); 3082 3083 3088 protected 3084 3089 parameter Modelica.SIunits.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit … … 3114 3119 rotation=0))); 3115 3120 annotation ( 3121 3116 3122 Documentation(info="<html> 3117 3123 <p> … … 3160 3166 extent={{-100,-100},{100,100}}, 3161 3167 grid={2,2}), graphics)); 3162 3163 3168 equation 3164 3169 v = der(s); … … 3232 3237 extent={{150,60},{-150,100}}, 3233 3238 textString="%name", 3234 lineColor={0,0,255})})); 3239 lineColor={0,0,255})}) 3240 ); 3235 3241 protected 3236 3242 function position … … 3282 3288 extent={{-140,-20},{-100,20}}, rotation=0))); 3283 3289 annotation ( 3290 3284 3291 Documentation(info="<html> 3285 3292 <p> … … 3328 3335 extent={{-100,-100},{100,100}}, 3329 3336 grid={2,2}), graphics)); 3330 3331 3337 equation 3332 3338 flange.f = -f; … … 3343 3349 origin={0,40}))); 3344 3350 annotation ( 3351 3345 3352 Documentation(info="<html> 3346 3353 <p> … … 3381 3388 extent={{-100,-100},{100,100}}, 3382 3389 grid={2,2}), graphics)); 3383 3384 3390 equation 3385 3391 flange_a.f = f; … … 3515 3521 3516 3522 annotation ( 3523 3517 3524 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 3518 3525 100}}), graphics={ … … 3550 3557 -10},{120,10}}))); 3551 3558 annotation ( 3559 3552 3560 Documentation(info="<html> 3553 3561 <p> … … 3570 3578 extent={{-100,-100},{100,100}}, 3571 3579 grid={1,1}), graphics)); 3572 3573 3580 equation 3574 3581 s = flange.s; … … 3582 3589 rotation=0))); 3583 3590 annotation ( 3591 3584 3592 Documentation(info="<html> 3585 3593 <p> … … 3602 3610 extent={{-100,-100},{100,100}}, 3603 3611 grid={1,1}), graphics)); 3604 3605 3612 equation 3606 3613 v = der(flange.s); … … 3615 3622 rotation=0))); 3616 3623 annotation ( 3624 3617 3625 Documentation(info="<html> 3618 3626 <p> … … 3636 3644 extent={{-100,-100},{100,100}}, 3637 3645 grid={1,1}), graphics)); 3638 3639 3646 equation 3640 3647 v = der(flange.s); … … 3650 3657 origin={0,-110}))); 3651 3658 annotation ( 3659 3652 3660 Documentation(info="<html> 3653 3661 <p> … … 3673 3681 extent={{-100,-100},{100,100}}, 3674 3682 grid={1,1}), graphics)); 3675 3676 3683 equation 3677 3684 s_rel = flange_b.s - flange_a.s; … … 3689 3696 origin={0,-110}))); 3690 3697 annotation ( 3698 3691 3699 Documentation(info="<html> 3692 3700 <p> … … 3719 3727 extent={{-100,-100},{100,100}}, 3720 3728 grid={1,1}), graphics)); 3721 3722 3729 equation 3723 3730 s_rel = flange_b.s - flange_a.s; … … 3738 3745 origin={0,-110}))); 3739 3746 annotation ( 3747 3740 3748 Documentation(info="<html> 3741 3749 <p> … … 3761 3769 extent={{-100,-100},{100,100}}, 3762 3770 grid={1,1}), graphics)); 3763 3764 3771 equation 3765 3772 s_rel = flange_b.s - flange_a.s; … … 3796 3803 Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3797 3804 Line(points={{70,0},{90,0}}, color={0,0,0}), 3798 Line(points={{-80,-100},{-80,0}}, color={0,0,127})}), 3805 Line(points={{-80,-100},{-80,0}}, color={0,0,127})}) 3806 , 3799 3807 Diagram(coordinateSystem( 3800 3808 preserveAspectRatio=true, … … 3832 3840 Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3833 3841 Line(points={{70,0},{90,0}}, color={0,0,0}), 3834 Line(points={{-80,-100},{-80,0}}, color={0,0,127})}), 3842 Line(points={{-80,-100},{-80,0}}, color={0,0,127})}) 3843 , 3835 3844 Diagram(coordinateSystem( 3836 3845 preserveAspectRatio=true, … … 3860 3869 "(left) 1D translational flange (flange axis directed INTO cut plane, e. g. from left to right)" 3861 3870 3862 annotation(defaultComponentName = "flange_a", 3871 annotation(defaultComponentName = "flange_a" 3872 , 3863 3873 Documentation(info="<html> 3864 3874 This is a flange for 1D translational mechanical systems. In the cut plane of … … 3904 3914 SI.Position s "absolute position of flange"; 3905 3915 flow SI.Force f "cut force directed into flange"; 3906 annotation(defaultComponentName = "flange_b", 3916 annotation(defaultComponentName = "flange_b" 3917 , 3907 3918 Documentation(info="<html> 3908 3919 This is a flange for 1D translational mechanical systems. In the cut plane of … … 4060 4071 preserveAspectRatio=true, 4061 4072 extent={{-100,-100},{100,100}}, 4062 grid={2,2}), graphics)); 4073 grid={2,2}), graphics) 4074 ); 4063 4075 end PartialTwoFlanges; 4064 4076 … … 4097 4109 extent={{21,-95},{61,-96}}, 4098 4110 lineColor={95,95,95}, 4099 textString="(if not useSupport)")}), 4111 textString="(if not useSupport)")}) 4112 , 4100 4113 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{ 4101 4114 100,100}}), graphics={ … … 4174 4187 extent={{24,-97},{64,-98}}, 4175 4188 lineColor={95,95,95}, 4176 textString="(if not useSupport)")}), 4189 textString="(if not useSupport)")}) 4190 , 4177 4191 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{ 4178 4192 100,100}}), graphics={ … … 4239 4253 preserveAspectRatio=true, 4240 4254 extent={{-100,-100},{100,100}}, 4241 grid={2,2}), graphics)); 4255 grid={2,2}), graphics) 4256 ); 4242 4257 equation 4243 4258 flange_a.s = s - L/2; … … 4261 4276 "force between flanges (positive in direction of flange axis R)"; 4262 4277 annotation ( 4278 4263 4279 Documentation(info="<html> 4264 4280 <p> … … 4279 4295 fillPattern=FillPattern.Solid), Line(points={{-60,-90},{20,-90}}, 4280 4296 color={0,0,0})})); 4281 4282 4297 equation 4283 4298 s_rel = flange_b.s - flange_a.s; … … 4310 4325 rotation=0))); 4311 4326 annotation ( 4327 4312 4328 Documentation(info="<html> 4313 4329 <p> … … 4345 4361 extent={{-100,-100},{100,100}}, 4346 4362 grid={2,2}), graphics)); 4347 4348 4363 equation 4349 4364 s_rel = flange_b.s - flange_a.s; … … 4364 4379 rotation=0))); 4365 4380 annotation ( 4381 4366 4382 Documentation(info="<html> 4367 4383 <p> … … 4411 4427 points={{-30,-100},{30,-100}}, 4412 4428 color={0,0,0})})); 4413 4414 4429 protected 4415 4430 InternalSupport internalSupport(f=-flange.f) … … 4592 4607 rotation=0))); 4593 4608 annotation ( 4609 4594 4610 Documentation(info="<html> 4595 4611 <p> … … 4620 4636 extent={{-100,-100},{100,100}}, 4621 4637 grid={1,1}), graphics)); 4622 4623 4638 equation 4624 4639 0 = flange.f; … … 4639 4654 rotation=0))); 4640 4655 annotation ( 4656 4641 4657 Documentation(info="<html> 4642 4658 <p> … … 4668 4684 extent={{-100,-100},{100,100}}, 4669 4685 grid={1,1}), graphics)); 4670 4671 4686 equation 4672 4687 0 = flange_a.f + flange_b.f; … … 4715 4730 constant SI.Acceleration unitAcceleration = 1 annotation(HideResult=true); 4716 4731 constant SI.Force unitForce = 1 annotation(HideResult=true); 4717 Real sa0 = (f0_max + (f0_max - f0))/unitForce4718 "Value of sa when start of forward sliding at w=0";4719 4732 equation 4720 4733 /* Friction characteristic … … 4723 4736 if for each configuration special code shall be generated) 4724 4737 */ 4725 startForward = pre(mode) == Stuck and sa > f0_max/unitForce or 4738 startForward = pre(mode) == Stuck and 4739 (pre(startForward) or sa > f0_max/unitForce and sa > f0/unitForce) or 4726 4740 pre(mode) == Backward and v_relfric > v_small or initial() and v_relfric > 0; 4727 startBackward = pre(mode) == Stuck and sa < -f0_max/unitForce or 4741 startBackward = pre(mode) == Stuck and 4742 (pre(startBackward) or sa < -f0_max/unitForce and sa < -f0/unitForce) or 4728 4743 pre(mode) == Forward and v_relfric < -v_small or initial() and v_relfric < 0; 4729 4744 locked = not free and … … 4731 4746 a_relfric/unitAcceleration = if locked then 0 else 4732 4747 if free then sa else 4733 if startForward then sa - sa0else4734 if startBackward then sa + sa0else4735 if pre(mode) == Forward then sa - sa0else4736 sa + sa0;4748 if startForward then sa - f0/u
