Changeset 660

Show
Ignore:
Timestamp:
10/10/07 15:17:26 (14 months ago)
Author:
otter
Message:

Fixed minor unit errors reported by Sven Erik
(mostly related to s-parameterization of ideal electrical
switches and friction elements)

Location:
Modelica/branches/maintenance/2.2.2/Modelica
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • Modelica/branches/maintenance/2.2.2/Modelica/Blocks/Discrete.mo

    r550 r660  
    105105  protected  
    106106    Real ySample; 
    107     Real tSample; 
     107    Modelica.SIunits.Time tSample; 
    108108    Real c; 
    109109    annotation ( 
  • Modelica/branches/maintenance/2.2.2/Modelica/Blocks/Sources.mo

    r653 r660  
    211211</html>")); 
    212212      block Clock "Generate actual time signal "  
    213         parameter Real offset=0 "Offset of output signal"; 
    214         parameter SIunits.Time startTime=0  
     213        parameter Modelica.SIunits.Time offset=0 "Offset of output signal"; 
     214        parameter Modelica.SIunits.Time startTime=0  
    215215      "Output = offset for time < startTime"; 
    216216        extends Interfaces.SO; 
     
    598598      block Ramp "Generate ramp signal"  
    599599        parameter Real height=1 "Height of ramps"; 
    600         parameter Real duration(min=Modelica.Constants.small) = 2  
     600        parameter Modelica.SIunits.Time duration(min=Modelica.Constants.small) = 2  
    601601      "Durations of ramp"; 
    602602        parameter Real offset=0 "Offset of output signal"; 
    603         parameter SIunits.Time startTime=0  
     603        parameter Modelica.SIunits.Time startTime=0  
    604604      "Output = offset for time < startTime"; 
    605605        extends Interfaces.SO; 
  • Modelica/branches/maintenance/2.2.2/Modelica/Electrical/Analog/Ideal.mo

    r550 r660  
    4545          model IdealThyristor "Ideal thyristor"  
    4646            extends Modelica.Electrical.Analog.Interfaces.OnePort; 
     47            Modelica.Blocks.Interfaces.BooleanInput fire  
     48              annotation (extent=[50,90; 90,130],   rotation=-90); 
    4749            parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5  
    4850      "Closed thyristor resistance"; 
     
    5254      "Forward threshold voltage"; 
    5355            Boolean off(start=true) "Switching state"; 
    54   protected  
    55             Real s  
    56       "Auxiliary variable: if on then current, if opened then voltage"; 
    5756            annotation ( 
    5857              Documentation(info="<html> 
     
    175174                height=0.6)); 
    176175     
    177   public  
     176  protected  
     177            Real s  
     178      "Auxiliary variable: if on then current, if opened then voltage"; 
     179            constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     180            constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
     181     
     182          equation  
     183            off = s < 0 or pre(off) and not fire; 
     184            v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 
     185            i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 
     186          end IdealThyristor; 
     187   
     188          model IdealGTOThyristor "Ideal GTO thyristor"  
     189            extends Modelica.Electrical.Analog.Interfaces.OnePort; 
    178190            Modelica.Blocks.Interfaces.BooleanInput fire  
    179191              annotation (extent=[50,90; 90,130],   rotation=-90); 
    180           equation  
    181             off = s < 0 or pre(off) and not fire; 
    182             v = s*(if off then 1 else Ron) + Vknee; 
    183             i = s*(if off then Goff else 1) + Goff*Vknee; 
    184           end IdealThyristor; 
    185    
    186           model IdealGTOThyristor "Ideal GTO thyristor"  
    187             extends Modelica.Electrical.Analog.Interfaces.OnePort; 
    188192            parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5  
    189193      "Closed thyristor resistance"; 
     
    193197      "Forward threshold voltage"; 
    194198            Boolean off(start=true) "Switching state"; 
    195   protected  
    196             Real s  
    197       "Auxiliary variable: if on then current, if opened then voltage"; 
    198199            annotation ( 
    199200              Documentation(info="<html> 
     
    312313                width=0.6, 
    313314                height=0.6)); 
    314      
    315   public  
    316             Modelica.Blocks.Interfaces.BooleanInput fire  
    317               annotation (extent=[50,90; 90,130],   rotation=-90); 
     315  protected  
     316            Real s  
     317      "Auxiliary variable: if on then current, if opened then voltage"; 
     318            constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     319            constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    318320          equation  
    319321            off = s < 0 or not fire; 
    320             v = s*(if off then 1 else Ron) + Vknee; 
    321             i = s*(if off then Goff else 1) + Goff*Vknee; 
     322            v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 
     323            i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 
    322324          end IdealGTOThyristor; 
    323325   
     
    390392    Real s1; 
    391393    Real s2 "Auxiliary variables"; 
     394    constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     395    constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    392396  equation  
    393397    0 = p.i + n2.i + n1.i; 
    394398     
    395     p.v - n1.v = s1*(if (control) then 1 else Ron); 
    396     n1.i = -s1*(if (control) then Goff else 1); 
    397     p.v - n2.v = s2*(if (control) then Ron else 1); 
    398     n2.i = -s2*(if (control) then 1 else Goff); 
     399    p.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 
     400    n1.i = -(s1*unitVoltage)*(if (control) then Goff else 1); 
     401    p.v - n2.v = (s2*unitCurrent)*(if (control) then Ron else 1); 
     402    n2.i = -(s2*unitVoltage)*(if (control) then 1 else Goff); 
    399403  end IdealCommutingSwitch; 
    400404   
     
    476480      annotation (extent=[-20,60; 20,100],rotation=-90); 
    477481  protected  
    478     Real s1; 
    479     Real s2; 
    480     Real s3; 
    481     Real s4 "Auxiliary variables"; 
     482    Real s1(final unit="1"); 
     483    Real s2(final unit="1"); 
     484    Real s3(final unit="1"); 
     485    Real s4(final unit="1") "Auxiliary variables"; 
     486    constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     487    constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    482488  equation  
    483     p1.v - n1.v = s1*(if (control) then 1 else Ron); 
    484     p2.v - n2.v = s2*(if (control) then 1 else Ron); 
    485     p1.v - n2.v = s3*(if (control) then Ron else 1); 
    486     p2.v - n1.v = s4*(if (control) then Ron else 1); 
     489    p1.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 
     490    p2.v - n2.v = (s2*unitCurrent)*(if (control) then 1 else Ron); 
     491    p1.v - n2.v = (s3*unitCurrent)*(if (control) then Ron else 1); 
     492    p2.v - n1.v = (s4*unitCurrent)*(if (control) then Ron else 1); 
    487493     
    488     p1.i = if (control) then s1*Goff + s3 else s1 + s3*Goff; 
    489     p2.i = if (control) then s2*Goff + s4 else s2 + s4*Goff; 
    490     n1.i = if (control) then -s1*Goff - s4 else -s1 - s4*Goff; 
    491     n2.i = if (control) then -s2*Goff - s3 else -s2 - s3*Goff; 
     494    p1.i = if control then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 
     495    p2.i = if control then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 
     496    n1.i = if control then -s1*unitVoltage*Goff - s4*unitCurrent else -s1*unitCurrent - s4*unitVoltage*Goff; 
     497    n2.i = if control then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 
    492498  end IdealIntermediateSwitch; 
    493499   
     
    562568    Real s1; 
    563569    Real s2 "Auxiliary variables"; 
     570    constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     571    constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    564572  equation  
    565573    control.i = 0; 
    566574    0 = p.i + n2.i + n1.i; 
    567575     
    568     p.v - n1.v = s1*(if (control.v > level) then 1 else Ron); 
    569     n1.i = -s1*(if (control.v > level) then Goff else 1); 
    570     p.v - n2.v = s2*(if (control.v > level) then Ron else 1); 
    571     n2.i = -s2*(if (control.v > level) then 1 else Goff); 
     576    p.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 
     577    n1.i = -(s1*unitVoltage)*(if (control.v > level) then Goff else 1); 
     578    p.v - n2.v = (s2*unitCurrent)*(if (control.v > level) then Ron else 1); 
     579    n2.i = -(s2*unitVoltage)*(if (control.v > level) then 1 else Goff); 
    572580  end ControlledIdealCommutingSwitch; 
    573581   
     
    657665    Real s3; 
    658666    Real s4 "Auxiliary variables"; 
     667    constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     668    constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    659669  equation  
    660670    control.i = 0; 
    661671     
    662     p1.v - n1.v = s1*(if (control.v > level) then 1 else Ron); 
    663     p2.v - n2.v = s2*(if (control.v > level) then 1 else Ron); 
    664     p1.v - n2.v = s3*(if (control.v > level) then Ron else 1); 
    665     p2.v - n1.v = s4*(if (control.v > level) then Ron else 1); 
     672    p1.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 
     673    p2.v - n2.v = (s2*unitCurrent)*(if (control.v > level) then 1 else Ron); 
     674    p1.v - n2.v = (s3*unitCurrent)*(if (control.v > level) then Ron else 1); 
     675    p2.v - n1.v = (s4*unitCurrent)*(if (control.v > level) then Ron else 1); 
    666676     
    667     p1.i = if (control.v > level) then s1*Goff + s3 else s1 + s3*Goff; 
    668     p2.i = if (control.v > level) then s2*Goff + s4 else s2 + s4*Goff; 
    669     n1.i = if (control.v > level) then -s1*Goff - s4 else -s1 - s4*Goff; 
    670     n2.i = if (control.v > level) then -s2*Goff - s3 else -s2 - s3*Goff; 
     677    p1.i = if control.v > level then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 
     678    p2.i = if control.v > level then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 
     679    n1.i = if control.v > level then -s1*unitVoltage*Goff - s4*unitCurrent else -s1*unitCurrent - s4*unitVoltage*Goff; 
     680    n2.i = if control.v > level then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 
    671681  end ControlledIdealIntermediateSwitch; 
    672682   
     
    949959  protected  
    950960    Real s "Auxiliary variable"; 
     961    constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
    951962  equation  
    952963    in_p.i = 0; 
     
    958969    out.v = if (s < -1) then VMin.v else if (s > 1) then VMax.v else (VMax.v - 
    959970      VMin.v)*s/2 + (VMax.v + VMin.v)/2; 
     971     
    960972  end IdealOpAmpLimited; 
    961973   
     
    13161328      "true => switch open, false => p--n connected" annotation (extent=[-20,50; 
    13171329          20,90],      rotation=-90); 
    1318   protected  
    1319     Real s "Auxiliary variable"; 
    1320      
    13211330    annotation ( 
    13221331      Documentation(info="<HTML> 
     
    13721381        Line(points=[0, 51; 0, 26]), 
    13731382        Line(points=[40, 20; 40, 0]))); 
     1383  protected  
     1384   Real s "Auxiliary variable"; 
     1385   constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     1386   constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    13741387 equation  
    1375     v = s*(if control then 1 else Ron); 
    1376     i = s*(if control then Goff else 1); 
     1388    v = (s*unitCurrent)*(if control then 1 else Ron); 
     1389    i = (s*unitVoltage)*(if control then Goff else 1); 
    13771390 end IdealOpeningSwitch; 
    13781391   
     
    13871400      "true => p--n connected, false => switch open"   annotation (extent=[-20,50; 
    13881401            20,90],      rotation=-90); 
    1389   protected  
    1390       Real s "Auxiliary variable"; 
    1391      
    13921402      annotation ( 
    13931403        Documentation(info="<HTML> 
     
    14091419</P> 
    14101420</HTML> 
    1411 ", revisions="<html> 
     1421",     revisions= 
     1422             "<html> 
    14121423<ul> 
    14131424<li><i>  </i> 
     
    14411452          Text(extent=[-100, -40; 100, -79], string="%name"), 
    14421453          Line(points=[0, 51; 0, 26]))); 
     1454  protected  
     1455      Real s "Auxiliary variable"; 
     1456      constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     1457      constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    14431458    equation  
    1444       v = s*(if control then Ron else 1); 
    1445       i = s*(if control then 1 else Goff); 
     1459      v = (s*unitCurrent)*(if control then Ron else 1); 
     1460      i = (s*unitVoltage)*(if control then 1 else Goff); 
    14461461    end IdealClosingSwitch; 
    14471462   
    14481463  model ControlledIdealOpeningSwitch "Controlled ideal electrical opener"  
     1464    Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 
     1465    Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 
     1466    Interfaces.Pin control  
     1467      "Control pin: control.v > level switch open, otherwise p--n connected"  
     1468      annotation (extent=[-10, 90; 10, 110], rotation=90); 
     1469     
    14491470    parameter SI.Voltage level=0.5 "Switch level" annotation (extent=[-56.6667, 
    14501471            10; -10, 56.6667]); 
     
    14541475      "Opened switch conductance" annotation (extent=[-56.6667, -56.6667; -10, 
    14551476          -10]); 
    1456   protected  
    1457     Real s "Auxiliary variable"; 
    14581477    annotation ( 
    14591478      Documentation(info=" 
     
    15091528        Line(points=[0,96; 0,25]), 
    15101529        Line(points=[40, 20; 40, 0]))); 
    1511   public  
    1512     Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 
    1513     Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 
    1514     Interfaces.Pin control  
    1515       "Control pin: control.v > level switch open, otherwise p--n connected"  
    1516       annotation (extent=[-10, 90; 10, 110], rotation=90); 
     1530  protected  
     1531    Real s "Auxiliary variable"; 
     1532    constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     1533    constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    15171534  equation  
    15181535    control.i = 0; 
    15191536    0 = p.i + n.i; 
    1520     p.v - n.v = s*(if (control.v > level) then 1 else Ron); 
    1521     p.i = s*(if (control.v > level) then Goff else 1); 
     1537    p.v - n.v = (s*unitCurrent)*(if (control.v > level) then 1 else Ron); 
     1538    p.i = (s*unitVoltage)*(if (control.v > level) then Goff else 1); 
    15221539  end ControlledIdealOpeningSwitch; 
    15231540   
    15241541    model ControlledIdealClosingSwitch "Controlled ideal electrical closer"  
     1542      Modelica.Electrical.Analog.Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 
     1543      Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 
     1544      Modelica.Electrical.Analog.Interfaces.Pin control  
     1545      "Control pin: control.v > level switch closed, otherwise switch open"  
     1546        annotation (extent=[-10, 90; 10, 110], rotation=90); 
    15251547      parameter SI.Voltage level=0.5 "Switch level" annotation (extent=[-56.6667, 
    15261548              10; -10, 56.6667]); 
     
    15311553      "Opened switch conductance"   annotation (extent=[-56.6667, -56.6667; -10, 
    15321554            -10]); 
    1533   protected  
    1534       Real s "Auxiliary variable"; 
    15351555      annotation ( 
    15361556        Documentation(info=" 
     
    15531573</P> 
    15541574</HTML> 
    1555 ", revisions="<html> 
     1575",     revisions= 
     1576             "<html> 
    15561577<ul> 
    15571578<li><i>  </i> 
     
    15841605          Line(points=[40,0; 96,0]), 
    15851606          Line(points=[0,96; 0,25]))); 
    1586   public  
    1587       Modelica.Electrical.Analog.Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 
    1588       Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 
    1589       Modelica.Electrical.Analog.Interfaces.Pin control  
    1590       "Control pin: control.v > level switch closed, otherwise switch open"  
    1591         annotation (extent=[-10, 90; 10, 110], rotation=90); 
     1607  protected  
     1608      Real s "Auxiliary variable"; 
     1609      constant Real unitVoltage(unit="V") = 1           annotation(Hide=true); 
     1610      constant Real unitCurrent(unit="A") = 1            annotation(Hide=true); 
    15921611    equation  
    15931612      control.i = 0; 
    15941613      0 = p.i + n.i; 
    1595       p.v - n.v = s*(if (control.v > level) then Ron else 1); 
    1596       p.i = s*(if (control.v > level) then 1 else Goff); 
     1614      p.v - n.v = (s*unitCurrent)*(if (control.v > level) then Ron else 1); 
     1615      p.i = (s*unitVoltage)*(if (control.v > level) then 1 else Goff); 
    15971616    end ControlledIdealClosingSwitch; 
    15981617   
  • Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/MultiBody/Examples/Loops/Utilities.mo

    r645 r660  
    224224    extends Modelica.Mechanics.Translational.Interfaces.Compliant; 
    225225    parameter SI.Length L "Length of cylinder"; 
    226     parameter SI.Length d "diameter of cylinder"; 
    227     parameter Real k0=0.01; 
    228     parameter Real k1=0.01; 
    229     parameter Real k=7; 
     226    parameter SI.Length d "Diameter of cylinder"; 
     227    parameter SIunits.Volume k0=0.01; 
     228    parameter SIunits.Volume k1=0.01; 
     229    parameter SIunits.HeatCapacity k=7; 
    230230    constant Real pi=Modelica.Constants.pi; 
    231231    constant Real PI=Modelica.Constants.pi; 
     
    296296    extends Modelica.Mechanics.Translational.Interfaces.Compliant; 
    297297    parameter SI.Length L "Length of cylinder"; 
    298     parameter SI.Length d "diameter of cylinder"; 
    299     parameter Real k0=0.01; 
    300     parameter Real k1=0.01; 
    301     parameter Real k=7; 
     298    parameter SI.Diameter d "Diameter of cylinder"; 
     299    parameter SI.Volume k0=0.01; 
     300    parameter SI.Volume k1=0.01; 
     301    parameter SIunits.HeatCapacity k=7; 
    302302    constant Real pi=Modelica.Constants.pi; 
    303303    constant Real PI=Modelica.Constants.pi; 
  • Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/MultiBody/Forces.mo

    r572 r660  
    15651565    SI.Position r_rel_0[3]  
    15661566      "Position vector from frame_a to frame_b resolved in world frame"; 
    1567     SI.Position e_rel_0[3]  
     1567    Real e_rel_0[3]  
    15681568      "Unit vector in direction from frame_a to frame_b, resolved in world frame"; 
    15691569    annotation ( 
     
    22622262      "Reflection of ambient light (= 0: light is completely absorbed)"  
    22632263      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
    2264     input Real massDiameter=max(0, (width - 2*coilWidth)*0.9)  
     2264    input SIunits.Diameter massDiameter=max(0, (width - 2*coilWidth)*0.9)  
    22652265      " Diameter of mass point sphere" annotation (Dialog(tab="Animation", group= 
    22662266            "if animation = true and showMass = true", enable=animation and showMass)); 
     
    23562356      " Length of cylinder at frame_a side"  
    23572357      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
    2358     input SI.Distance diameter_a=world.defaultForceWidth  
     2358    input SIunits.Diameter diameter_a=world.defaultForceWidth  
    23592359      " Diameter of cylinder at frame_a side"  
    23602360      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
    2361     input Real diameter_b=0.6*diameter_a  
     2361    input SIunits.Diameter diameter_b=0.6*diameter_a  
    23622362      " Diameter of cylinder at frame_b side"  
    23632363      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
  • Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/MultiBody/Visualizers.mo

    r572 r660  
    13041304      T.Orientation R_rel=T.from_nxy(n_x, n_y); 
    13051305      T.Orientation R_lines=T.absoluteRotation(R.T, R_rel); 
    1306       Real r_abs[3]=r + T.resolve1(R.T, r_lines); 
     1306      Modelica.SIunits.Position r_abs[3]=r + T.resolve1(R.T, r_lines); 
    13071307      Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape cylinders[n]( 
    13081308        each shapeType="cylinder", 
  • Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/Rotational.mo

    r659 r660  
    32103210     
    32113211    // Friction torque 
    3212     tau = if locked then sa else (if startForward then  
     3212    tau = if locked then sa*unitTorque else (if startForward then  
    32133213      Modelica.Math.tempInterpol1(w, tau_pos, 2) else if startBackward then - 
    32143214      Modelica.Math.tempInterpol1(-w, tau_pos, 2) else if pre(mode) == Forward then  
     
    34113411     
    34123412    // friction torque 
    3413     tau = if locked then sa else if free then 0 else cgeo*fn*(if startForward then  
     3413    tau = if locked then sa*unitTorque else if free then 0 else cgeo*fn*(if startForward then  
    34143414            Modelica.Math.tempInterpol1(w_rel, mue_pos, 2) else if  
    34153415      startBackward then -Modelica.Math.tempInterpol1(-w_rel, mue_pos, 2) else  
     
    34483448    Real mue0 "Friction coefficient for w=0 and sliding"; 
    34493449    Boolean free "true, if frictional element is not active"; 
    3450     Real sa "path parameter of tau = f(a_rel) Friction characteristic"; 
     3450    Real sa(unit="1")  
     3451      "path parameter of tau = f(a_rel) Friction characteristic"; 
    34513452    constant Real eps0=1.0e-4 "Relative hysteresis epsilon"; 
    34523453    SI.Torque tau0_max_low "lowest value for tau0_max"; 
     
    36293630       special code shall be generated) 
    36303631    */ 
    3631     startForward = pre(stuck) and (sa > tau0_max or pre(startForward) and sa > 
    3632       tau0 or w_rel > w_small) or initial() and (w_rel > 0); 
     3632    startForward = pre(stuck) and (sa > tau0_max/unitTorque or pre(startForward) and sa > 
     3633      tau0/unitTorque or w_rel > w_small) or initial() and (w_rel > 0); 
    36333634    locked = pre(stuck) and not startForward; 
    36343635     
    36353636    // acceleration and friction torque 
    36363637    a_rel = unitAngularAcceleration* (if locked then 0 else sa - tau0/unitTorque); 
    3637     tau = if locked then sa else (if free then 0 else cgeo*fn* 
     3638    tau = if locked then sa*unitTorque else (if free then 0 else cgeo*fn* 
    36383639      Modelica.Math.tempInterpol1(w_rel, mue_pos, 2)); 
    36393640     
     
    38523853     
    38533854    // friction torque 
    3854     tau = if locked then sa else if free then 0 else cgeo*fn*(if startForward then  
     3855    tau = if locked then sa*unitTorque else if free then 0 else cgeo*fn*(if startForward then  
    38553856            Modelica.Math.tempInterpol1(w, mue_pos, 2) else if startBackward then  
    38563857            -Modelica.Math.tempInterpol1(-w, mue_pos, 2) else if pre(mode) == 
     
    41904191     
    41914192    // Determine rolling/stuck mode when w_rel = 0 
    4192     startForward = pre(mode) == Stuck and sa > tauLossMax or initial() and w_a 
     4193    startForward = pre(mode) == Stuck and sa > tauLossMax/unitTorque or initial() and w_a 
    41934194       > 0; 
    4194     startBackward = pre(mode) == Stuck and sa < tauLossMin or initial() and w_a 
     4195    startBackward = pre(mode) == Stuck and sa < tauLossMin/unitTorque or initial() and w_a 
    41954196       < 0; 
    41964197    locked = not (ideal or pre(mode) == Forward or startForward or pre(mode) 
     
    42014202       to simplify the following expression as mode == Stuck is assured in case 
    42024203       of startForward or startBackward */ 
    4203     tauLoss = if ideal then 0 else (if locked then sa else (if (startForward or  
     4204    tauLoss = if ideal then 0 else (if locked then sa*unitTorque else (if (startForward or  
    42044205          pre(mode) == Forward) then tauLossMax else tauLossMin)); 
    42054206     
  • Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/Translational.mo

    r659 r660  
    18781878     
    18791879    // Friction force 
    1880     f = if locked then sa else if free then 0 else  
     1880    f = if locked then sa*unitForce else if free then 0 else  
    18811881            (if startForward then F_prop*v + F_Coulomb + 
    18821882      F_Stribeck else if startBackward then F_prop*v - F_Coulomb - F_Stribeck else