Show
Ignore:
Timestamp:
05/04/08 21:39:55 (4 months ago)
Author:
otter
Message:

Enhanced efficiency of friction models of Rotational and Translational library in some situations (only of peak > 1)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/maintenance/3.0/Modelica/Mechanics/Translational.mo

    r1083 r1119  
    55  import SI = Modelica.SIunits; 
    66  annotation ( 
    7   version="1.1.1", versionDate="2007-11-22" 
    8     , 
     7  version="1.1.1", versionDate="2007-11-22", 
    98    Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 
    109            100}}), graphics={ 
     
    159158 
    160159    annotation ( 
    161        
    162160      Documentation(info="<html> 
    163161<p> 
     
    169167</HTML> 
    170168")); 
     169 
    171170    model SignConvention "Examples for the used sign conventions." 
    172171      extends Modelica.Icons.Example; 
     
    277276      extends Modelica.Icons.Example; 
    278277      annotation ( 
    279          
    280278        Documentation(info="<html>  
    281279<p> 
     
    399397      extends Modelica.Icons.Example; 
    400398      annotation ( 
    401          
    402399        Documentation(info="<html> 
    403400<p> 
     
    437434              color={0,0,255})}), 
    438435        experiment(StopTime=1)); 
     436 
    439437      Translational.Components.Fixed fixed  
    440438                                 annotation (Placement(transformation(extent={{ 
     
    629627      extends Modelica.Icons.Example; 
    630628      annotation ( 
    631          
    632629        Documentation(info="<html> 
    633630<p> 
     
    658655            grid={2,2}), graphics), 
    659656        experiment(StopTime=1)); 
     657 
    660658      Translational.Components.Mass mass1( 
    661659        L=1, 
     
    730728      extends Modelica.Icons.Example; 
    731729      annotation ( 
    732          
    733730        Documentation(info="<html> 
    734731<p> 
     
    758755            grid={2,2}), graphics), 
    759756        experiment(StopTime=1)); 
     757 
    760758      Translational.Sensors.ForceSensor forceSensor  annotation (Placement( 
    761759            transformation(extent={{-20,40},{0,60}}, rotation=0))); 
     
    825823              extent={{-100,20},{-80,0}}, 
    826824              textString="2)", 
    827               lineColor={0,0,255})}) 
    828         , 
     825              lineColor={0,0,255})}), 
    829826        Documentation(info="<html> 
    830827<ol> 
     
    895892 
    896893      annotation ( 
    897          
    898894        Diagram(coordinateSystem( 
    899895            preserveAspectRatio=true, 
     
    11951191 
    11961192      annotation ( 
    1197          
    11981193        Icon(coordinateSystem( 
    11991194            preserveAspectRatio=true, 
     
    12281223</HTML> 
    12291224")); 
     1225 
    12301226      Interfaces.Flange_b flange   annotation (Placement(transformation( 
    12311227            origin={0,0}, 
     
    12461242 
    12471243      annotation ( 
    1248          
    12491244        Documentation(info="<html> 
    12501245<p> 
     
    13281323              textString="Position s", 
    13291324              lineColor={0,0,255})})); 
     1325 
    13301326    equation 
    13311327      v = der(s); 
     
    13381334 
    13391335      annotation ( 
    1340          
    13411336        Documentation(info="<html> 
    13421337<p> 
     
    14041399              textString="Length L", 
    14051400              lineColor={0,0,255})})); 
     1401 
    14061402    equation 
    14071403      0 = flange_a.f + flange_b.f; 
     
    14151411 
    14161412      annotation ( 
    1417          
    14181413        Documentation(info="<html> 
    14191414<p> 
     
    14591454            Line(points={{-86,0},{-60,0},{-44,-30},{-16,30},{14,-30},{44,30},{ 
    14601455                  60,0},{84,0}}, color={0,0,0})})); 
     1456 
    14611457    equation 
    14621458      f = c*(s_rel - s_rel0); 
     
    14681464        "damping constant"; 
    14691465      annotation ( 
    1470          
    14711466        Documentation(info="<html> 
    14721467<p> 
     
    15251520              lineColor={128,128,128}, 
    15261521              textString="der(s_rel)")})); 
     1522 
    15271523    equation 
    15281524      f = d*v_rel; 
     
    15371533      parameter SI.Position s_rel0=0 "unstretched spring length"; 
    15381534      annotation ( 
    1539          
    15401535        Documentation(info="<html> 
    15411536<p> 
     
    16101605            Line(points={{-90,0},{-80,0}}, color={0,0,0}), 
    16111606            Line(points={{90,0},{80,0}}, color={0,0,0})})); 
     1607 
    16121608    equation 
    16131609      f = c*(s_rel - s_rel0) + d*v_rel; 
     
    16231619 
    16241620      annotation ( 
    1625          
    16261621        Documentation(info="<html> 
    16271622<p> 
     
    17891784              textString="%name", 
    17901785              lineColor={0,0,255})})); 
     1786 
    17911787    /* 
    17921788Please note that initialization might fail due to the nonlinear spring characteristic 
     
    24772473<li><i>June 10, 2002 by P. Beater, StateSelect.always for variables s and v (instead of fixed=true). </i> </li> 
    24782474</ul> 
    2479 </html>") 
    2480         , 
     2475</html>"), 
    24812476        Icon(coordinateSystem( 
    24822477            preserveAspectRatio=true, 
     
    26822677      constant SI.Acceleration unitAcceleration = 1 annotation(HideResult=true); 
    26832678      constant SI.Force unitForce = 1 annotation(HideResult=true); 
     2679      Real sa0 = (f0_max + (f0_max - f0))/unitForce 
     2680          "Value of sa when start of forward sliding at w=0"; 
    26842681    equation 
    26852682    /* Friction characteristic 
     
    26882685   if for each configuration special code shall be generated) 
    26892686*/ 
    2690       startForward  = pre(mode) == Stuck and  
    2691         (pre(startForward)  or sa >  f0_max/unitForce and sa >  f0/unitForce and s < (smax - L/2)) or  
     2687      startForward  = pre(mode) == Stuck and sa >  f0_max/unitForce and s < (smax - L/2) or  
    26922688        pre(mode) == Backward and v_relfric >  v_small or initial() and v_relfric > 0; 
    2693       startBackward = pre(mode) == Stuck and  
    2694         (pre(startBackward) or sa < -f0_max/unitForce and sa < -f0/unitForce and s > (smin + L/2)) or  
     2689      startBackward = pre(mode) == Stuck and sa < -f0_max/unitForce and s > (smin + L/2) or  
    26952690        pre(mode) == Forward  and v_relfric < -v_small or initial() and v_relfric < 0; 
    26962691      locked = not free and  
     
    26982693      a_relfric/unitAcceleration = if locked then               0 else  
    26992694                                   if free then                 sa else  
    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; 
     2695                                   if startForward then         sa - sa0 else  
     2696                                   if startBackward then        sa + sa0 else  
     2697                                   if pre(mode) == Forward then sa - sa0 else  
     2698                                                                sa + sa0; 
    27042699    /* Friction torque has to be defined in a subclass. Example for a clutch: 
    27052700   f = if locked then sa else  
     
    27712766      SI.Acceleration a_rel(start=0) "relative angular acceleration"; 
    27722767      annotation ( 
    2773          
    27742768        Documentation(info="<html> 
    27752769<p> 
     
    28662860              color={0,0,0}, 
    28672861              pattern=LinePattern.Dash)})); 
     2862 
    28682863    equation 
    28692864      s_rel = flange_b.s - flange_a.s; 
     
    29112906      constant Real bf=0.6180 "s*s coefficient of Bessel filter"; 
    29122907      annotation ( 
    2913          
    29142908        Documentation(info="<HTML> 
    29152909<p> 
     
    29822976            extent={{-100,-100},{100,100}}, 
    29832977            grid={2,2}), graphics)); 
     2978 
    29842979    initial equation 
    29852980      if not exact then 
     
    30153010            transformation(extent={{-140,-20},{-100,20}}, rotation=0))); 
    30163011      annotation ( 
    3017          
    30183012        Documentation(info="<HTML> 
    30193013<p> 
     
    30863080            extent={{-100,-100},{100,100}}, 
    30873081            grid={2,2}), graphics)); 
     3082 
    30883083    protected 
    30893084      parameter Modelica.SIunits.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit 
     
    31193114              rotation=0))); 
    31203115      annotation ( 
    3121          
    31223116        Documentation(info="<html> 
    31233117<p> 
     
    31663160            extent={{-100,-100},{100,100}}, 
    31673161            grid={2,2}), graphics)); 
     3162 
    31683163    equation 
    31693164      v = der(s); 
     
    32373232              extent={{150,60},{-150,100}}, 
    32383233              textString="%name", 
    3239               lineColor={0,0,255})}) 
    3240         ); 
     3234              lineColor={0,0,255})})); 
    32413235    protected 
    32423236      function position 
     
    32883282              extent={{-140,-20},{-100,20}}, rotation=0))); 
    32893283      annotation ( 
    3290          
    32913284        Documentation(info="<html> 
    32923285<p> 
     
    33353328            extent={{-100,-100},{100,100}}, 
    33363329            grid={2,2}), graphics)); 
     3330 
    33373331    equation 
    33383332      flange.f = -f; 
     
    33493343            origin={0,40}))); 
    33503344      annotation ( 
    3351          
    33523345        Documentation(info="<html> 
    33533346<p> 
     
    33883381            extent={{-100,-100},{100,100}}, 
    33893382            grid={2,2}), graphics)); 
     3383 
    33903384    equation 
    33913385      flange_a.f =  f; 
     
    35213515 
    35223516    annotation ( 
    3523        
    35243517      Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, 
    35253518              100}}), graphics={ 
     
    35573550                -10},{120,10}}))); 
    35583551      annotation ( 
    3559          
    35603552        Documentation(info="<html> 
    35613553<p> 
     
    35783570            extent={{-100,-100},{100,100}}, 
    35793571            grid={1,1}), graphics)); 
     3572 
    35803573    equation 
    35813574      s = flange.s; 
     
    35893582              rotation=0))); 
    35903583      annotation ( 
    3591          
    35923584        Documentation(info="<html> 
    35933585<p> 
     
    36103602            extent={{-100,-100},{100,100}}, 
    36113603            grid={1,1}), graphics)); 
     3604 
    36123605    equation 
    36133606      v = der(flange.s); 
     
    36223615              rotation=0))); 
    36233616      annotation ( 
    3624          
    36253617        Documentation(info="<html> 
    36263618<p> 
     
    36443636            extent={{-100,-100},{100,100}}, 
    36453637            grid={1,1}), graphics)); 
     3638 
    36463639    equation 
    36473640      v = der(flange.s); 
     
    36573650            origin={0,-110}))); 
    36583651      annotation ( 
    3659          
    36603652        Documentation(info="<html> 
    36613653<p> 
     
    36813673            extent={{-100,-100},{100,100}}, 
    36823674            grid={1,1}), graphics)); 
     3675 
    36833676    equation 
    36843677      s_rel = flange_b.s - flange_a.s; 
     
    36963689            origin={0,-110}))); 
    36973690      annotation ( 
    3698          
    36993691        Documentation(info="<html> 
    37003692<p> 
     
    37273719            extent={{-100,-100},{100,100}}, 
    37283720            grid={1,1}), graphics)); 
     3721 
    37293722    equation 
    37303723      s_rel = flange_b.s - flange_a.s; 
     
    37453738            origin={0,-110}))); 
    37463739      annotation ( 
    3747          
    37483740        Documentation(info="<html> 
    37493741<p> 
     
    37693761            extent={{-100,-100},{100,100}}, 
    37703762            grid={1,1}), graphics)); 
     3763 
    37713764    equation 
    37723765      s_rel = flange_b.s - flange_a.s; 
     
    38033796            Line(points={{-70,0},{-90,0}}, color={0,0,0}), 
    38043797            Line(points={{70,0},{90,0}}, color={0,0,0}), 
    3805             Line(points={{-80,-100},{-80,0}}, color={0,0,127})}) 
    3806         , 
     3798            Line(points={{-80,-100},{-80,0}}, color={0,0,127})}), 
    38073799        Diagram(coordinateSystem( 
    38083800            preserveAspectRatio=true, 
     
    38403832            Line(points={{-70,0},{-90,0}}, color={0,0,0}), 
    38413833            Line(points={{70,0},{90,0}}, color={0,0,0}), 
    3842             Line(points={{-80,-100},{-80,0}}, color={0,0,127})}) 
    3843         , 
     3834            Line(points={{-80,-100},{-80,0}}, color={0,0,127})}), 
    38443835        Diagram(coordinateSystem( 
    38453836            preserveAspectRatio=true, 
     
    38693860      "(left) 1D translational flange (flange axis directed INTO cut plane, e. g. from left to right)" 
    38703861 
    3871       annotation(defaultComponentName = "flange_a" 
    3872         , 
     3862      annotation(defaultComponentName = "flange_a", 
    38733863        Documentation(info="<html> 
    38743864This is a flange for 1D translational mechanical systems. In the cut plane of 
     
    39143904      SI.Position s "absolute position of flange"; 
    39153905      flow SI.Force f "cut force directed into flange"; 
    3916       annotation(defaultComponentName = "flange_b" 
    3917         , 
     3906      annotation(defaultComponentName = "flange_b", 
    39183907        Documentation(info="<html> 
    39193908This is a flange for 1D translational mechanical systems. In the cut plane of 
     
    40714060            preserveAspectRatio=true, 
    40724061            extent={{-100,-100},{100,100}}, 
    4073             grid={2,2}), graphics) 
    4074         ); 
     4062            grid={2,2}), graphics)); 
    40754063    end PartialTwoFlanges; 
    40764064 
     
    41094097              extent={{21,-95},{61,-96}}, 
    41104098              lineColor={95,95,95}, 
    4111               textString="(if not useSupport)")}) 
    4112         , 
     4099              textString="(if not useSupport)")}), 
    41134100        Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{ 
    41144101                100,100}}), graphics={ 
     
    41874174              extent={{24,-97},{64,-98}}, 
    41884175              lineColor={95,95,95}, 
    4189               textString="(if not useSupport)")}) 
    4190         , 
     4176              textString="(if not useSupport)")}), 
    41914177        Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{ 
    41924178                100,100}}), graphics={ 
     
    42534239            preserveAspectRatio=true, 
    42544240            extent={{-100,-100},{100,100}}, 
    4255             grid={2,2}), graphics) 
    4256         ); 
     4241            grid={2,2}), graphics)); 
    42574242    equation 
    42584243      flange_a.s = s - L/2; 
     
    42764261        "force between flanges (positive in direction of flange axis R)"; 
    42774262      annotation ( 
    4278          
    42794263        Documentation(info="<html> 
    42804264<p> 
     
    42954279              fillPattern=FillPattern.Solid), Line(points={{-60,-90},{20,-90}}, 
    42964280                color={0,0,0})})); 
     4281 
    42974282    equation 
    42984283      s_rel = flange_b.s - flange_a.s; 
     
    43254310              rotation=0))); 
    43264311      annotation ( 
    4327          
    43284312        Documentation(info="<html> 
    43294313<p> 
     
    43614345            extent={{-100,-100},{100,100}}, 
    43624346            grid={2,2}), graphics)); 
     4347 
    43634348    equation 
    43644349      s_rel = flange_b.s - flange_a.s; 
     
    43794364              rotation=0))); 
    43804365      annotation ( 
    4381          
    43824366        Documentation(info="<html> 
    43834367<p> 
     
    44274411              points={{-30,-100},{30,-100}}, 
    44284412              color={0,0,0})})); 
     4413 
    44294414    protected 
    44304415      InternalSupport internalSupport(f=-flange.f) 
     
    46074592              rotation=0))); 
    46084593      annotation ( 
    4609          
    46104594        Documentation(info="<html> 
    46114595<p> 
     
    46364620            extent={{-100,-100},{100,100}}, 
    46374621            grid={1,1}), graphics)); 
     4622 
    46384623    equation 
    46394624      0 = flange.f; 
     
    46544639              rotation=0))); 
    46554640      annotation ( 
    4656          
    46574641        Documentation(info="<html> 
    46584642<p> 
     
    46844668            extent={{-100,-100},{100,100}}, 
    46854669            grid={1,1}), graphics)); 
     4670 
    46864671    equation 
    46874672      0 = flange_a.f + flange_b.f; 
     
    47304715      constant SI.Acceleration unitAcceleration = 1 annotation(HideResult=true); 
    47314716      constant SI.Force unitForce = 1 annotation(HideResult=true); 
     4717      Real sa0 = (f0_max + (f0_max - f0))/unitForce 
     4718        "Value of sa when start of forward sliding at w=0"; 
    47324719    equation 
    47334720    /* Friction characteristic 
     
    47364723   if for each configuration special code shall be generated) 
    47374724*/ 
    4738       startForward  = pre(mode) == Stuck and  
    4739         (pre(startForward)  or sa >  f0_max/unitForce and sa >  f0/unitForce) or  
     4725      startForward  = pre(mode) == Stuck and sa >  f0_max/unitForce or  
    47404726        pre(mode) == Backward and v_relfric >  v_small or initial() and v_relfric > 0; 
    4741       startBackward = pre(mode) == Stuck and  
    4742         (pre(startBackward) or sa < -f0_max/unitForce and sa < -f0/unitForce) or  
     4727      startBackward = pre(mode) == Stuck and sa < -f0_max/unitForce or  
    47434728        pre(mode) == Forward  and v_relfric < -v_small or initial() and v_relfric < 0; 
    47444729      locked = not free and  
     
    47464731      a_relfric/unitAcceleration = if locked then               0 else  
    47474732                                   if free then                 sa else  
    4748                                    if startForward then         sa - f0/unitForce else  
    4749                                    if startBackward then        sa + f0/unitForce else  
    4750                                    if pre(mode) == Forward then sa - f0/unitForce else  
    4751                                                                 sa + f0/unitForce; 
     4733