Changeset 1139
- Timestamp:
- 06/26/08 08:11:32 (4 months ago)
- Location:
- branches/maintenance/3.0/Modelica
- Files:
-
- 2 modified
-
Mechanics/Translational.mo (modified) (81 diffs)
-
package.mo (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/maintenance/3.0/Modelica/Mechanics/Translational.mo
r1129 r1139 5 5 import SI = Modelica.SIunits; 6 6 annotation ( 7 version="1.1.1", versionDate="2007-11-22" 8 , 7 version="1.1.1", versionDate="2007-11-22", 9 8 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 10 9 100}}), graphics={ … … 159 158 160 159 annotation ( 161 162 160 Documentation(info="<html> 163 161 <p> … … 169 167 </HTML> 170 168 ")); 169 171 170 model SignConvention "Examples for the used sign conventions." 172 171 extends Modelica.Icons.Example; … … 277 276 extends Modelica.Icons.Example; 278 277 annotation ( 279 280 278 Documentation(info="<html> 281 279 <p> … … 399 397 extends Modelica.Icons.Example; 400 398 annotation ( 401 402 399 Documentation(info="<html> 403 400 <p> … … 437 434 color={0,0,255})}), 438 435 experiment(StopTime=1)); 436 439 437 Translational.Components.Fixed fixed 440 438 annotation (Placement(transformation(extent={{ … … 629 627 extends Modelica.Icons.Example; 630 628 annotation ( 631 632 629 Documentation(info="<html> 633 630 <p> … … 658 655 grid={2,2}), graphics), 659 656 experiment(StopTime=1)); 657 660 658 Translational.Components.Mass mass1( 661 659 L=1, … … 730 728 extends Modelica.Icons.Example; 731 729 annotation ( 732 733 730 Documentation(info="<html> 734 731 <p> … … 758 755 grid={2,2}), graphics), 759 756 experiment(StopTime=1)); 757 760 758 Translational.Sensors.ForceSensor forceSensor annotation (Placement( 761 759 transformation(extent={{-20,40},{0,60}}, rotation=0))); … … 815 813 grid={2,2}), graphics={ 816 814 Text( 817 extent={{-56,-88},{62,-100}},818 textString="simulate 5 s",819 lineColor={0,0,255}),820 Text(821 815 extent={{-100,80},{-80,60}}, 822 816 textString="1)", … … 825 819 extent={{-100,20},{-80,0}}, 826 820 textString="2)", 827 lineColor={0,0,255})}) 828 , 821 lineColor={0,0,255}), 822 Text( 823 extent={{-100,-40},{-80,-60}}, 824 lineColor={0,0,255}, 825 textString="3)")}), 829 826 Documentation(info="<html> 830 827 <ol> 831 <li> Simulate and then plot Stop1.f as a function of Stop1.v828 <li> Simulate and then plot stop1.f as a function of stop1.v 832 829 This gives the Stribeck curve.</li> 833 <li> This model gives an example for a hard stop. However there 830 <li> The same model is also available by modeling the system with a Mass and 831 a SupportFriction model. The SupportFriction model defines the friction characteristic 832 with a table. The table is constructed with function 833 Examples.Utilities.GenerateStribeckFrictionTable(..) to generate the 834 same friction characteristic as with stop1. 835 The simulation results of stop1 and of model mass are therefore identical.</li> 836 <li> Model stop2 gives an example for a hard stop. However there 834 837 can arise some problems with the used modeling approach (use of 835 Reinit, convergence problems). In this case use the ElastoGap838 <b>reinit</b>(..), convergence problems). In this case use the ElastoGap 836 839 to model a stop (see example Preload).</li> 837 840 </ol> … … 848 851 F_Coulomb=5, 849 852 F_Stribeck=10, 850 fexp=2) annotation (Placement(transformation(extent= 851 {{60,60},{80,80}},rotation=0)));853 fexp=2) annotation (Placement(transformation(extent={{20,60}, 854 {40,80}}, rotation=0))); 852 855 Translational.Sources.Force force 853 annotation (Placement(transformation(extent={{ 20,60},854 { 40,80}},rotation=0)));856 annotation (Placement(transformation(extent={{-20,60}, 857 {0,80}}, rotation=0))); 855 858 Modelica.Blocks.Sources.Sine sineForce(amplitude=25, freqHz=0.25) 856 859 annotation (Placement( 857 transformation(extent={{-20,60},{0,80}}, rotation=0))); 860 transformation(extent={{-60,60},{-40,80}}, 861 rotation=0))); 858 862 Modelica.Mechanics.Translational.Components.MassWithStopAndFriction stop2 859 863 ( … … 864 868 F_Stribeck=5, 865 869 s(start=0, fixed=true), 866 v(start=-5, fixed=true),867 870 m=1, 868 871 F_prop=1, 869 fexp=2) annotation (Placement(transformation(extent={{60,0},{80,20}}, 872 fexp=2, 873 v(start=-5, fixed=true)) 874 annotation (Placement(transformation(extent={{42,-60},{62, 875 -40}}, 870 876 rotation=0))); 871 877 Translational.Components.Spring spring(s_rel0=1, c=500) 872 878 annotation (Placement( 873 transformation(extent={{20,0},{40,20}}, rotation=0))); 879 transformation(extent={{2,-60},{22,-40}}, 880 rotation=0))); 874 881 Translational.Components.Fixed fixed2(s0=-1.75) 875 882 annotation (Placement(transformation( 876 extent={{-22,0},{-2,20}}, rotation=0))); 877 equation 878 connect(spring.flange_b, stop2.flange_a) annotation (Line(points={{40,10}, 879 {60,10}}, color={0,191,0})); 883 extent={{-40,-60},{-20,-40}}, 884 rotation=0))); 885 Translational.Sources.Force force2 886 annotation (Placement(transformation(extent={{-22,0}, 887 {-2,20}}, rotation=0))); 888 Components.Mass mass( 889 m=1, 890 L=1, 891 s(fixed=true), 892 v(fixed=true)) 893 annotation (Placement(transformation(extent={{10,0},{30,20}}))); 894 Components.SupportFriction supportFriction(f_pos= 895 Examples.Utilities.GenerateStribeckFrictionTable( 896 F_prop=1, 897 F_Coulomb=5, 898 F_Stribeck=10, 899 fexp=2, 900 v_max=12, 901 nTable=50)) 902 annotation (Placement(transformation(extent={{40,0},{60,20}}))); 903 equation 904 connect(spring.flange_b, stop2.flange_a) annotation (Line(points={{22,-50}, 905 {42,-50}},color={0,191,0})); 880 906 connect(sineForce.y, force.f) 881 annotation (Line(points={{1,70},{18,70}}, color={0,0,127})); 907 annotation (Line(points={{-39,70},{-22,70}}, 908 color={0,0,127})); 882 909 connect(spring.flange_a, fixed2.flange) annotation (Line( 883 points={{2 0,10},{-12,10}},910 points={{2,-50},{-30,-50}}, 884 911 color={0,127,0}, 885 912 smooth=Smooth.None)); 886 913 connect(force.flange, stop1.flange_a) annotation (Line( 887 points={{40,70},{60,70}}, 888 color={0,127,0}, 914 points={{0,70},{20,70}}, 915 color={0,127,0}, 916 smooth=Smooth.None)); 917 connect(force2.flange, mass.flange_a) annotation (Line( 918 points={{-2,10},{10,10}}, 919 color={0,127,0}, 920 smooth=Smooth.None)); 921 connect(mass.flange_b, supportFriction.flange_a) annotation (Line( 922 points={{30,10},{40,10}}, 923 color={0,127,0}, 924 smooth=Smooth.None)); 925 connect(sineForce.y, force2.f) annotation (Line( 926 points={{-39,70},{-30,70},{-30,10},{-24,10}}, 927 color={0,0,127}, 889 928 smooth=Smooth.None)); 890 929 end Friction; … … 895 934 896 935 annotation ( 897 898 936 Diagram(coordinateSystem( 899 937 preserveAspectRatio=true, … … 902 940 Text( 903 941 extent={{-98,-68},{102,-94}}, 904 textString="positive force => spool moves in positive direction ", 942 textString="positive force => spool moves in positive direction ", 943 905 944 lineColor={0,0,255}), 906 945 Text( … … 1176 1215 smooth=Smooth.None)); 1177 1216 end ElastoGap; 1217 1218 model Brake "Demonstrate braking of a translational moving mass" 1219 extends Modelica.Icons.Example; 1220 1221 annotation (Diagram(coordinateSystem( 1222 preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics), 1223 experiment(StopTime=2), 1224 Documentation(info="<html> 1225 <p> 1226 This model consists of a mass with an initial velocity of 1 m/s. 1227 After 0.1 s, a brake is activated and it is shown that the mass decelerates until 1228 it arrives at rest and remains at rest. Two versions of this system are present, 1229 one where the brake is implicitly grounded and one where it is explicitly grounded. 1230 </p> 1231 1232 </html>")); 1233 Modelica.Mechanics.Translational.Components.Brake brake(fn_max=1, useSupport= 1234 false) 1235 annotation (Placement(transformation(extent={{6,40},{26,20}}))); 1236 Modelica.Mechanics.Translational.Components.Mass mass1(m=1, 1237 s(fixed=true), 1238 v(start=1, fixed=true)) 1239 annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); 1240 Modelica.Blocks.Sources.Step step(startTime=0.1, height=2) 1241 annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 1242 rotation=0, 1243 origin={-24,-10}))); 1244 Modelica.Mechanics.Translational.Components.Brake brake1( 1245 fn_max=1, useSupport= 1246 true) 1247 annotation (Placement(transformation(extent={{6,-60},{26,-40}}))); 1248 Modelica.Mechanics.Translational.Components.Mass mass2(m=1, 1249 s(fixed=true), 1250 v(start=1, fixed=true)) 1251 annotation (Placement(transformation(extent={{-34,-60},{-14,-40}}))); 1252 Modelica.Mechanics.Translational.Components.Fixed fixed 1253 annotation (Placement(transformation(extent={{6,-80},{26,-60}}))); 1254 equation 1255 connect(mass1.flange_b, brake.flange_a) 1256 annotation (Line( 1257 points={{-14,30},{6,30}}, 1258 color={0,127,0}, 1259 smooth=Smooth.None)); 1260 connect(step.y, brake.f_normalized) annotation (Line( 1261 points={{-13,-10},{16,-10},{16,19}}, 1262 color={0,0,127}, 1263 smooth=Smooth.None)); 1264 connect(mass2.flange_b, brake1.flange_a) 1265 annotation (Line( 1266 points={{-14,-50},{6,-50}}, 1267 color={0,127,0}, 1268 smooth=Smooth.None)); 1269 connect(step.y, brake1.f_normalized) annotation (Line( 1270 points={{-13,-10},{16,-10},{16,-39}}, 1271 color={0,0,127}, 1272 smooth=Smooth.None)); 1273 connect(fixed.flange, brake1.support) annotation (Line( 1274 points={{16,-70},{16,-60}}, 1275 color={0,127,0}, 1276 smooth=Smooth.None)); 1277 end Brake; 1278 1279 package Utilities "Utility classes used by the Example models" 1280 extends Modelica.Icons.Library; 1281 function GenerateStribeckFrictionTable 1282 "Generate stribeck friction table for example Friction for the SupportFriction" 1283 input Real F_prop(final unit="N.s/m", final min=0) 1284 "Velocity dependent friction coefficient"; 1285 input Modelica.SIunits.Force F_Coulomb 1286 "Constant friction: Coulomb force"; 1287 input Modelica.SIunits.Force F_Stribeck "Stribeck effect"; 1288 input Real fexp(final unit="s/m", final min=0) "Exponential decay"; 1289 input Real v_max "Generate table from v=0 ... v_max"; 1290 input Integer nTable(min=2)=100 "Number of table points"; 1291 output Real table[nTable,2] "Friction table"; 1292 algorithm 1293 for i in 1:nTable loop 1294 table[i,1] :=v_max*(i - 1)/(nTable - 1); 1295 table[i,2] :=F_Coulomb + F_prop*table[i, 1] + 1296 F_Stribeck*exp(-fexp*table[i, 1]); 1297 end for; 1298 annotation (Documentation(info="<html> 1299 <p> 1300 Returns a table with the friction characteristic table[nTable,2] = [0, f1; ....; v_max, fn], where the first 1301 column is the velocity v in the range 0..v_max and the second column is the friction force 1302 according to the stribeck curve: 1303 </p> 1304 <pre> 1305 F_Coulomb + F_prop*v + F_Stribeck*exp(-fexp*v); 1306 </pre> 1307 1308 </html>")); 1309 end GenerateStribeckFrictionTable; 1310 end Utilities; 1178 1311 end Examples; 1179 1312 … … 1195 1328 1196 1329 annotation ( 1197 1198 1330 Icon(coordinateSystem( 1199 1331 preserveAspectRatio=true, … … 1228 1360 </HTML> 1229 1361 ")); 1362 1230 1363 Interfaces.Flange_b flange annotation (Placement(transformation( 1231 1364 origin={0,0}, … … 1246 1379 1247 1380 annotation ( 1248 1249 1381 Documentation(info="<html> 1250 1382 <p> … … 1328 1460 textString="Position s", 1329 1461 lineColor={0,0,255})})); 1462 1330 1463 equation 1331 1464 v = der(s); … … 1338 1471 1339 1472 annotation ( 1340 1341 1473 Documentation(info="<html> 1342 1474 <p> … … 1404 1536 textString="Length L", 1405 1537 lineColor={0,0,255})})); 1538 1406 1539 equation 1407 1540 0 = flange_a.f + flange_b.f; … … 1415 1548 1416 1549 annotation ( 1417 1418 1550 Documentation(info="<html> 1419 1551 <p> … … 1459 1591 Line(points={{-86,0},{-60,0},{-44,-30},{-16,30},{14,-30},{44,30},{ 1460 1592 60,0},{84,0}}, color={0,0,0})})); 1593 1461 1594 equation 1462 1595 f = c*(s_rel - s_rel0); … … 1468 1601 "damping constant"; 1469 1602 annotation ( 1470 1471 1603 Documentation(info="<html> 1472 1604 <p> … … 1525 1657 lineColor={128,128,128}, 1526 1658 textString="der(s_rel)")})); 1659 1527 1660 equation 1528 1661 f = d*v_rel; … … 1537 1670 parameter SI.Position s_rel0=0 "unstretched spring length"; 1538 1671 annotation ( 1539 1540 1672 Documentation(info="<html> 1541 1673 <p> … … 1610 1742 Line(points={{-90,0},{-80,0}}, color={0,0,0}), 1611 1743 Line(points={{90,0},{80,0}}, color={0,0,0})})); 1744 1612 1745 equation 1613 1746 f = c*(s_rel - s_rel0) + d*v_rel; … … 1623 1756 1624 1757 annotation ( 1625 1626 1758 Documentation(info="<html> 1627 1759 <p> … … 1789 1921 textString="%name", 1790 1922 lineColor={0,0,255})})); 1923 1791 1924 /* 1792 1925 Please note that initialization might fail due to the nonlinear spring characteristic … … 1991 2124 1992 2125 // Friction force 1993 flange_a.f + flange_b.f +f = 0;2126 flange_a.f + flange_b.f - f = 0; 1994 2127 1995 2128 // Friction force … … 2177 2310 2178 2311 // Friction force, normal force and friction force for v_rel=0 2179 flange_a.f + flange_b.f +f = 0;2312 flange_a.f + flange_b.f - f = 0; 2180 2313 fn = fn_max*f_normalized; 2181 2314 f0 = mue0*cgeo*fn; … … 2477 2610 <li><i>June 10, 2002 by P. Beater, StateSelect.always for variables s and v (instead of fixed=true). </i> </li> 2478 2611 </ul> 2479 </html>") 2480 , 2612 </html>"), 2481 2613 Icon(coordinateSystem( 2482 2614 preserveAspectRatio=true, … … 2771 2903 SI.Acceleration a_rel(start=0) "relative angular acceleration"; 2772 2904 annotation ( 2773 2774 2905 Documentation(info="<html> 2775 2906 <p> … … 2866 2997 color={0,0,0}, 2867 2998 pattern=LinePattern.Dash)})); 2999 2868 3000 equation 2869 3001 s_rel = flange_b.s - flange_a.s; … … 2911 3043 constant Real bf=0.6180 "s*s coefficient of Bessel filter"; 2912 3044 annotation ( 2913 2914 3045 Documentation(info="<HTML> 2915 3046 <p> … … 2982 3113 extent={{-100,-100},{100,100}}, 2983 3114 grid={2,2}), graphics)); 3115 2984 3116 initial equation 2985 3117 if not exact then … … 3015 3147 transformation(extent={{-140,-20},{-100,20}}, rotation=0))); 3016 3148 annotation ( 3017 3018 3149 Documentation(info="<HTML> 3019 3150 <p> … … 3086 3217 extent={{-100,-100},{100,100}}, 3087 3218 grid={2,2}), graphics)); 3219 3088 3220 protected 3089 3221 parameter Modelica.SIunits.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit … … 3119 3251 rotation=0))); 3120 3252 annotation ( 3121 3122 3253 Documentation(info="<html> 3123 3254 <p> … … 3166 3297 extent={{-100,-100},{100,100}}, 3167 3298 grid={2,2}), graphics)); 3299 3168 3300 equation 3169 3301 v = der(s); … … 3237 3369 extent={{150,60},{-150,100}}, 3238 3370 textString="%name", 3239 lineColor={0,0,255})}) 3240 ); 3371 lineColor={0,0,255})})); 3241 3372 protected 3242 3373 function position … … 3288 3419 extent={{-140,-20},{-100,20}}, rotation=0))); 3289 3420 annotation ( 3290 3291 3421 Documentation(info="<html> 3292 3422 <p> … … 3335 3465 extent={{-100,-100},{100,100}}, 3336 3466 grid={2,2}), graphics)); 3467 3337 3468 equation 3338 3469 flange.f = -f; … … 3349 3480 origin={0,40}))); 3350 3481 annotation ( 3351 3352 3482 Documentation(info="<html> 3353 3483 <p> … … 3388 3518 extent={{-100,-100},{100,100}}, 3389 3519 grid={2,2}), graphics)); 3520 3390 3521 equation 3391 3522 flange_a.f = f; … … 3521 3652 3522 3653 annotation ( 3523 3524 3654 Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 3525 3655 100}}), graphics={ … … 3557 3687 -10},{120,10}}))); 3558 3688 annotation ( 3559 3560 3689 Documentation(info="<html> 3561 3690 <p> … … 3569 3698 preserveAspectRatio=true, 3570 3699 extent={{-100,-100},{100,100}}, 3571 grid={1,1}), graphics={Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3700 grid={1,1}), graphics={Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3572 3701 Text( 3573 3702 extent={{80,-28},{114,-62}}, … … 3578 3707 extent={{-100,-100},{100,100}}, 3579 3708 grid={1,1}), graphics)); 3709 3580 3710 equation 3581 3711 s = flange.s; … … 3589 3719 rotation=0))); 3590 3720 annotation ( 3591 3592 3721 Documentation(info="<html> 3593 3722 <p> … … 3601 3730 preserveAspectRatio=true, 3602 3731 extent={{-100,-100},{100,100}}, 3603 grid={1,1}), graphics={Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3732 grid={1,1}), graphics={Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3604 3733 Text( 3605 3734 extent={{80,-28},{111,-61}}, … … 3610 3739 extent={{-100,-100},{100,100}}, 3611 3740 grid={1,1}), graphics)); 3741 3612 3742 equation 3613 3743 v = der(flange.s); … … 3622 3752 rotation=0))); 3623 3753 annotation ( 3624 3625 3754 Documentation(info="<html> 3626 3755 <p> … … 3635 3764 preserveAspectRatio=true, 3636 3765 extent={{-100,-100},{100,100}}, 3637 grid={1,1}), graphics={Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3766 grid={1,1}), graphics={Line(points={{-70,0},{-90,0}}, color={0,0,0}), 3638 3767 Text( 3639 3768 extent={{80,-28},{115,-60}},
