Changeset 676

Show
Ignore:
Timestamp:
10/11/2007 04:05:49 PM (15 months ago)
Author:
otter
Message:

Backward compatible improvements to MultiBody library
(structurallyIncomplete annotation removed, several bugs
fixed with wrong defineRoot or missing defineBranch statements,
AssemblyJoints slightly restructured in order that structurallyIncomplete
could be removed, fixed unit bugs reported by Sven Erik)

Location:
Modelica/trunk/Modelica/Mechanics/MultiBody
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Mechanics/MultiBody/Examples/Loops/Utilities.mo

    r550 r676  
    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=1; 
    229     parameter Real k=1; 
     226    parameter SI.Diameter d "Diameter of cylinder"; 
     227    parameter SIunits.Volume k0=0.01; 
     228    parameter SIunits.Volume k1=1; 
     229    parameter SIunits.HeatCapacity k=1; 
    230230    constant Real pi=Modelica.Constants.pi; 
    231231    constant Real PI=Modelica.Constants.pi; 
     
    270270            fillPattern=1)), 
    271271        Text(extent=[-100, 120; 100, 60], string="%name"))); 
    272      
     272  protected  
     273    constant SI.Mass unitMass=1; 
     274    Modelica.SIunits.Pressure p; 
    273275  equation  
    274276    y = -s_rel/L; 
     
    276278    v_rel = der(s_rel); 
    277279     
    278     press = if v_rel < 0 then (if x < 0.987 then 177.4132*x^4 - 287.2189*x^3 + 
     280    press = p/1e5; 
     281    p = (if v_rel < 0 then (if x < 0.987 then 177.4132*x^4 - 287.2189*x^3 + 
    279282      151.8252*x^2 - 24.9973*x + 2.4 else 2836360*x^4 - 10569296*x^3 + 14761814 
    280283      *x^2 - 9158505*x + 2129670) else (if x > 0.93 then -3929704*x^4 + 
    281284      14748765*x^3 - 20747000*x^2 + 12964477*x - 3036495 else 145.930*x^4 - 
    282       131.707*x^3 + 17.3438*x^2 + 17.9272*x + 2.4); 
     285      131.707*x^3 + 17.3438*x^2 + 17.9272*x + 2.4))*1e5; 
    283286     
    284287    f = -1.0E5*press*pi*d^2/4; 
    285288     
    286289    V = k0 + k1*(1 - x); 
    287     dens = 1/V; 
    288     press*V = k*T; 
     290    dens = unitMass/V; 
     291    (p/1e5)*V = k*T; 
    289292  end GasForce; 
    290293   
     
    618621    import SI = Modelica.SIunits; 
    619622    parameter Boolean animation=true "= true, if animation shall be enabled"; 
    620     replaceable model Cylinder = Cylinder_analytic_CAD extends CylinderBase  
    621       "Cylinder type"; 
    622     /* 
    623 annotation (choices(choice(redeclare model Cylinder =  
     623    replaceable model Cylinder = Cylinder_analytic_CAD extends CylinderBase "Cylinder type" 
     624         annotation (choices(choice(redeclare model Cylinder =  
    624625            Modelica.Mechanics.MultiBody.Examples.Loops.Utilities.Cylinder_analytic_CAD  
    625626          "Analytic loop handling + CAD animation"), choice(redeclare model  
    626627          Cylinder = Modelica.Mechanics.MultiBody.Examples.Loops.Utilities.Cylinder_analytic  
    627628          "Analytic loop handling + standard animation"))); 
    628 */ 
    629629     
    630630    Cylinder cylinder1( 
  • Modelica/trunk/Modelica/Mechanics/MultiBody/Forces.mo

    r616 r676  
    15601560    SI.Position r_rel_0[3]  
    15611561      "Position vector from frame_a to frame_b resolved in world frame"; 
    1562     Real e_rel_0[3](each unit="1")  
     1562    Real e_rel_0[3]  
    15631563      "Unit vector in direction from frame_a to frame_b, resolved in world frame"; 
    15641564    annotation ( 
     
    22572257      "Reflection of ambient light (= 0: light is completely absorbed)"  
    22582258      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
    2259     input Real massDiameter=max(0, (width - 2*coilWidth)*0.9)  
     2259    input SIunits.Diameter massDiameter=max(0, (width - 2*coilWidth)*0.9)  
    22602260      " Diameter of mass point sphere" annotation (Dialog(tab="Animation", group= 
    22612261            "if animation = true and showMass = true", enable=animation and showMass)); 
     
    23512351      " Length of cylinder at frame_a side"  
    23522352      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
    2353     input SI.Distance diameter_a=world.defaultForceWidth  
     2353    input SIunits.Diameter diameter_a=world.defaultForceWidth  
    23542354      " Diameter of cylinder at frame_a side"  
    23552355      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
    2356     input Real diameter_b=0.6*diameter_a  
     2356    input SIunits.Diameter diameter_b=0.6*diameter_a  
    23572357      " Diameter of cylinder at frame_b side"  
    23582358      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
  • Modelica/trunk/Modelica/Mechanics/MultiBody/Interfaces.mo

    r555 r676  
    769769        Line(points=[-70, 0; -101, 0], style(color=0)), 
    770770        Line(points=[70, 0; 100, 0], style(color=0)), 
    771         Line(points=[0, -100; 0, -70]), 
     771        Line(points=[0, -100; 0, -70], style(color=74, rgbcolor={0,0,127})), 
    772772        Text(extent=[-132, 76; 129, 124], string="%name"), 
    773773        Text( 
     
    782782        Line(points=[-70, 0; -100, 0], style(color=0)), 
    783783        Line(points=[70, 0; 100, 0], style(color=0)), 
    784         Line(points=[0, -100; 0, -70]))); 
     784        Line(points=[0, -100; 0, -70], style(color=74, rgbcolor={0,0,127})))); 
    785785  equation  
    786786     
     
    827827        Line(points=[-70, 0; -101, 0], style(color=0)), 
    828828        Line(points=[70, 0; 100, 0], style(color=0)), 
    829         Line(points=[-80, -100; -80, 0]), 
     829        Line(points=[-80, -100; -80, 0], style(color=74, rgbcolor={0,0,127})), 
    830830        Text(extent=[-132, 76; 129, 124], string="%name"), 
    831831        Text( 
     
    848848        Line(points=[-70, 0; -100, 0], style(color=0)), 
    849849        Line(points=[70, 0; 100, 0], style(color=0)), 
    850         Line(points=[-80, -100; -80, 0]), 
     850        Line(points=[-80, -100; -80, 0], style(color=74, rgbcolor={0,0,127})), 
    851851        Line(points=[80,0; 80,-100], style( 
    852852            color=10, 
  • Modelica/trunk/Modelica/Mechanics/MultiBody/Joints.mo

    r611 r676  
    8585     
    8686    annotation ( 
    87       preferedView="info", 
    8887      Icon(Text( 
    8988          extent=[-142, 62; 147, 101], 
     
    132131      annotation (extent=[-30,50; -50,70]); 
    133132    annotation ( 
    134       preferedView="info", 
    135133      Diagram( 
    136134        Text(extent=[42, 81; 57, 66], string="f"), 
     
    205203    extends Internal.Revolute; 
    206204    annotation ( 
    207       preferedView="info", 
    208205      Icon(Text( 
    209206          extent=[-146, 70; 143, 109], 
     
    288285      annotation (extent=[-70,90; -50,110]); 
    289286    annotation ( 
    290       preferedView="info", 
    291287      Coordsys( 
    292288        extent=[-100, -100; 100, 100], 
     
    481477      a_start=wd_start) annotation (extent=[10, -25; 65, 25]); 
    482478    annotation ( 
    483       preferedView="info", 
    484479      Coordsys( 
    485480        extent=[-100, -100; 100, 100], 
     
    647642      annotation (extent=[10, 20; 60, 70], rotation=90); 
    648643    annotation ( 
    649       preferedView="info", 
    650644      Coordsys( 
    651645        extent=[-100, -100; 100, 100], 
     
    840834      a_start=wd_start) annotation (extent=[41, -20; 81, 20]); 
    841835    annotation ( 
    842       preferedView="info", 
    843836      Coordsys( 
    844837        extent=[-100, -100; 100, 100], 
     
    953946        rgbcolor={95,95,95}, 
    954947        thickness=2)); 
    955     connect(prismatic_x.frame_b, prismatic_y.frame_a) annotation (points=[-29,0; 
    956           -1.22461e-015,0; -1.22461e-015,30], style( 
     948    connect(prismatic_x.frame_b, prismatic_y.frame_a) annotation (points=[-29,0;  
     949          -1.22465e-015,0; -1.22465e-015,30], style( 
    957950        color=10, 
    958951        rgbcolor={95,95,95}, 
    959952        thickness=2)); 
    960953    connect(prismatic_y.frame_b, revolute.frame_a) annotation (points=[ 
    961           1.22461e-015,70; 0,80; 30,80; 30,0; 41,0], style( 
     954          1.22465e-015,70; 0,80; 30,80; 30,0; 41,0], style( 
    962955        color=10, 
    963956        rgbcolor={95,95,95}, 
     
    10251018         D2R); 
    10261019    annotation ( 
    1027       preferedView="info", 
    10281020      Coordsys( 
    10291021        extent=[-100, -100; 100, 100], 
     
    13561348    SI.Acceleration a_rel_a[3] "= der(v_rel_a)"; 
    13571349    annotation ( 
    1358       preferedView="info", 
    13591350      Coordsys( 
    13601351        extent=[-100, -100; 100, 100], 
     
    16871678      "= false, if no constraint shall be defined, due to analytically solving a kinematic loop" 
    16881679      annotation (Dialog(tab="Advanced")); 
     1680    Real constraintResidue = rRod_0*rRod_0 - rodLength*rodLength  
     1681      "Constraint equation of joint in residue form: Either length constraint (= default) or equation to compute rod force (for analytic solution of loops in combination with Internal.RevoluteWithLengthConstraint/PrismaticWithLengthConstraint)" 
     1682      annotation (Dialog(tab="Advanced", enable=not kinematicConstraint)); 
    16891683    parameter Boolean checkTotalPower=false  
    16901684      "= true, if total power flowing into this component shall be determined (must be zero)" 
     
    17121706     
    17131707    annotation ( 
    1714       preferedView="info", 
    17151708      Coordsys( 
    17161709        extent=[-100, -100; 100, 100], 
     
    19091902    eRod_a = rRod_a/rodLength; 
    19101903     
    1911     /* Constraint equation is removed, when taken into account somewhere else, 
    1912      e.g., when analytically solving a kinematic loop 
    1913   */ 
    1914     if kinematicConstraint then 
    1915       0 = rRod_0*rRod_0 - rodLength*rodLength; 
    1916     end if; 
     1904    // Constraint equation  
     1905    constraintResidue = 0; 
    19171906     
    19181907    // Cut-torques at frame_a and frame_b 
     
    20362025      "= false, if no constraint shall be defined, due to analytically solving a kinematic loop" 
    20372026      annotation (Dialog(tab="Advanced")); 
     2027    Real constraintResidue = rRod_0*rRod_0 - rodLength*rodLength  
     2028      "Constraint equation of joint in residue form: Either length constraint (= default) or equation to compute rod force (for analytic solution of loops in combination with Internal.RevoluteWithLengthConstraint/PrismaticWithLengthConstraint)" 
     2029      annotation (Dialog(tab="Advanced", enable=not kinematicConstraint)); 
    20382030    parameter Boolean checkTotalPower=false  
    20392031      "= true, if total power flowing into this component shall be determined (must be zero)" 
     
    20612053      "Position vector from origin of frame_a to origin of frame_b resolved in frame_a"; 
    20622054    annotation ( 
    2063       preferedView="info", 
    20642055      Coordsys( 
    20652056        extent=[-100, -100; 100, 100], 
     
    24142405     
    24152406    // Constraint equation 
    2416     if kinematicConstraint then 
    2417       0 = rRod_0*rRod_0 - rodLength*rodLength; 
    2418     end if; 
     2407    constraintResidue = 0; 
    24192408     
    24202409    /* Determine relative Rotation R_rel_ia from frame_a to frame_ia 
     
    26292618      annotation (points=[10, 40; 50, 40; 50, 10], style(color=0)); 
    26302619    connect(actuatedRevolute_a.frame_a,fixedTranslation2. frame_b) annotation ( 
    2631         points=[-40,0; -35,0; -35,1.22461e-015; -30,1.22461e-015], style( 
     2620        points=[-40,0; -35,0; -35,1.22465e-015; -30,1.22465e-015], style( 
    26322621        color=10, 
    26332622        rgbcolor={95,95,95}, 
    26342623        thickness=2)); 
    26352624    connect(fixedTranslation2.frame_a, bearing) annotation (points=[-10, 
    2636           -1.22461e-015; -4,-1.22461e-015; -4,0; 0,0; 0,-100], style( 
     2625          -1.22465e-015; -4,-1.22465e-015; -4,0; 0,0; 0,-100], style( 
    26372626        color=10, 
    26382627        rgbcolor={95,95,95}, 
     
    28512840        "Total power flowing into this element, if checkTotalPower=true (otherwise dummy)"; 
    28522841      annotation ( 
    2853         preferedView="info", 
    28542842        Coordsys( 
    28552843          extent=[-100, -100; 100, 100], 
     
    29352923</p> 
    29362924</html> "), 
    2937         Icon(coordinateSystem(extent=[-200,-200; 200,200]), 
     2925        Icon( 
    29382926          Text( 
    29392927            extent=[-140,-50; 140,-75], 
     
    34733461          Dialog(tab="Animation", group="if animation = true and showUniversalAxes", 
    34743462                enable=animation and showUniversalAxes)); 
    3475        
    34763463      parameter Boolean checkTotalPower=false  
    34773464        "= true, if total power flowing into this component shall be determined (must be zero)" 
     
    34873474      SI.Position aux  
    34883475        "Denominator used to compute force in rod connecting universal and spherical joint"; 
     3476      SI.Force f_rod  
     3477        "Constraint force in direction of the rod (positive, if rod is pressed)"; 
     3478       
    34893479      annotation ( 
    3490         preferedView="info", 
    34913480        Coordsys( 
    34923481          extent=[-100, -100; 100, 100], 
     
    36153604</pre> 
    36163605</html> "), 
    3617         Icon(coordinateSystem(extent=[-200,-200; 200,200]), 
     3606        Icon( 
    36183607          Text( 
    36193608            extent=[-140,-41; 140,-66], 
     
    37273716        cylinderLength=revoluteLength, 
    37283717        cylinderColor=revoluteColor, 
    3729         specularCoefficient=specularCoefficient, 
    3730         axisTorqueBalance=false) annotation (extent=[75, -20; 35, 20]); 
     3718        specularCoefficient=specularCoefficient) annotation (extent=[75, -20; 35, 20]); 
    37313719      Modelica.Mechanics.MultiBody.Joints.UniversalSpherical rod1( 
    37323720        animation=animation, 
     
    37433731        cylinderColor=cylinderColor, 
    37443732        specularCoefficient=specularCoefficient, 
    3745         kinematicConstraint=false) annotation (extent=[-92, -20; -52, 20]); 
     3733        kinematicConstraint=false, 
     3734        constraintResidue=rod1.f_rod - f_rod)  
     3735                                   annotation (extent=[-92, -20; -52, 20]); 
    37463736      Modelica.Mechanics.MultiBody.Parts.FixedTranslation rod2( 
    37473737        animation=animation, 
     
    37513741        specularCoefficient=specularCoefficient, 
    37523742        r=rRod2_ib) annotation (extent=[15, -20; -25, 20]); 
    3753       Modelica.Mechanics.MultiBody.Sensors.RelativeSensor relativeSensor(animation=false)  
     3743      Modelica.Mechanics.MultiBody.Sensors.RelativeSensorNew relativeSensor( 
     3744                                                                         animation=false)  
    37543745        annotation (extent=[60, -70; 40, -90]); 
    37553746      Modelica.Blocks.Sources.Constant position_b[3](k=rRod2_ib)  
    37563747        annotation (extent=[-20, -50; 0, -30]); 
    37573748    equation  
    3758       defineRoot(frame_ib.R); 
     3749     // defineRoot(frame_ib.R); 
    37593750       
    37603751      /* Compute the unknown force in the rod of the rod1 joint 
     
    37753766              + rod1.f_rod*e*cross(rRod2_ib, Frames.resolve2(rod1.R_rel, rod1.eRod_a)) 
    37763767     Solving this equation for f_rod results in 
    3777        rod1.f_rod = (-tau - e*(frame_ib.t + frame_im.t + cross(rRod2_ib, frame_im.f) 
    3778                    + cross(rRod2_ib, -rod1.f_b_a1))) 
    3779                    / (cross(e,rRod2_ib)*Frames.resolve2(rod1.R_rel, rod1.eRod_a))) 
     3768       f_rod = (-tau - e*(frame_ib.t + frame_im.t + cross(rRod2_ib, frame_im.f) 
     3769               + cross(rRod2_ib, -rod1.f_b_a1))) 
     3770               / (cross(e,rRod2_ib)*Frames.resolve2(rod1.R_rel, rod1.eRod_a))) 
    37803771     Additionally, a guard against division by zero is introduced 
     3772  
     3773     f_rod is passed to component JointsUSR.rod1 via variable "constraintResidue" in the Advanced menu 
    37813774  */ 
    37823775      aux = cross(revolute.e, rRod2_ib)*Frames.resolveRelative(rod1.eRod_a, 
    37833776        rod1.frame_a.R, rod1.frame_b.R); 
    3784       rod1.f_rod = (-revolute.tau - revolute.e*(frame_ib.t + frame_im.t + cross( 
     3777      f_rod = (-revolute.tau - revolute.e*(frame_ib.t + frame_im.t + cross( 
    37853778        rRod2_ib, frame_im.f) - cross(rRod2_ib, Frames.resolveRelative(rod1. 
    37863779        f_b_a1, rod1.frame_a.R, rod1.frame_b.R))))/noEvent(if abs(aux) < 1.e-10 then  
     
    38563849          fillColor=8, 
    38573850          rgbfillColor={192,192,192})); 
    3858       connect(relativeSensor.y, revolute.position_a)       annotation (points=[ 
    3859             50, -69; 50, -40; 90, -40; 90, -12; 79, -12], style( 
    3860           color=3, 
    3861           gradient=3, 
    3862           fillColor=8)); 
    38633851      connect(position_b.y, revolute.position_b)       annotation (points=[1, -40; 
    38643852             20, -40; 20, -12; 31, -12], style( 
    3865           color=3, 
     3853          color=74, 
     3854          rgbcolor={0,0,127}, 
    38663855          gradient=3, 
    3867           fillColor=8)); 
     3856          fillColor=8, 
     3857          rgbfillColor={192,192,192})); 
    38683858      connect(rod2.frame_b, frame_im) annotation (points=[-25,0; -40,0; -40,80; 0, 
    38693859            80; 0,100], style( 
     
    38803870      connect(revolute.bearing, bearing)  
    38813871        annotation (points=[67,20; 67,40; 100,40],    style(color=0)); 
     3872      connect(relativeSensor.r_rel, revolute.position_a) annotation (points=[58,-69;  
     3873            58,-50; 90,-50; 90,-12; 79,-12],      style( 
     3874          color=74, 
     3875          rgbcolor={0,0,127}, 
     3876          smooth=0)); 
    38823877    end JointUSR; 
    38833878     
     
    39793974      final parameter SI.Distance rod1Length=rod1.rodLength  
    39803975        "Length of rod 1 (= distance between universal and spherical joint"; 
     3976      SI.Force f_rod  
     3977        "Constraint force in direction of the rod (positive, if rod is pressed)"; 
    39813978      SI.Power totalPower  
    39823979        "Total power flowing into this element, if checkTotalPower=true (otherwise dummy)"; 
    39833980      annotation ( 
    3984         preferedView="info", 
    39853981        Coordsys( 
    39863982          extent=[-100, -100; 100, 100], 
     
    41164112</pre> 
    41174113</html> "), 
    4118         Icon(coordinateSystem(extent=[-200,-200; 200,200]), 
     4114        Icon( 
    41194115          Rectangle(extent=[50, 20; 80, -20], style(color=0, fillColor=8)), 
    41204116          Rectangle(extent=[80, 30; 100, -30], style(color=0, fillColor=8)), 
     
    42374233        boxHeight=boxHeight, 
    42384234        boxColor=boxColor, 
    4239         specularCoefficient=specularCoefficient, 
    4240         axisForceBalance=false) annotation (extent=[76, -20; 36, 20]); 
     4235        specularCoefficient=specularCoefficient)  
     4236                                annotation (extent=[76, -20; 36, 20]); 
    42414237      Modelica.Mechanics.MultiBody.Joints.UniversalSpherical rod1( 
    42424238        animation=animation, 
     
    42534249        cylinderDiameter=cylinderDiameter, 
    42544250        cylinderColor=cylinderColor, 
    4255         kinematicConstraint=false) annotation (extent=[-92, -20; -52, 20]); 
     4251        kinematicConstraint=false, 
     4252        constraintResidue=rod1.f_rod - f_rod)  
     4253                                   annotation (extent=[-92, -20; -52, 20]); 
    42564254      Modelica.Mechanics.MultiBody.Parts.FixedTranslation rod2( 
    42574255        animation=animation, 
     
    42614259        specularCoefficient=specularCoefficient, 
    42624260        color=rod2Color) annotation (extent=[0, 20; -40, -20]); 
    4263       Modelica.Mechanics.MultiBody.Sensors.RelativeSensor relativeSensor(animation=false)  
     4261      Sensors.RelativeSensorNew relativeSensor(                          animation=false)  
    42644262        annotation (extent=[50, -70; 30, -90]); 
    42654263      Modelica.Blocks.Sources.Constant position_b[3](k=rRod2_ib)  
     
    42894287     Additionally, a guard against division by zero is introduced 
    42904288  */ 
    4291       defineRoot(frame_ib.R); 
    42924289      aux = prismatic.e*Frames.resolveRelative(rod1.eRod_a, rod1.frame_a.R, 
    42934290        rod1.frame_b.R); 
    4294       rod1.f_rod = (-prismatic.f - prismatic.e*(frame_ib.f + frame_im.f - 
     4291      f_rod = (-prismatic.f - prismatic.e*(frame_ib.f + frame_im.f - 
    42954292        Frames.resolveRelative(rod1.f_b_a1, rod1.frame_a.R, rod1.frame_b.R)))/ 
    42964293        noEvent(if abs(aux) < 1.e-10 then 1.e-10 else aux); 
     
    43754372      connect(position_b.y, prismatic.position_b)       annotation (points=[1, 
    43764373            -50; 10, -50; 10, -12; 32, -12], style( 
    4377           color=3, 
    4378           fillColor=8, 
    4379           fillPattern=1)); 
    4380       connect(relativeSensor.y, prismatic.position_a)       annotation (points= 
    4381             [40, -69; 40, -40; 90, -40; 90, -12; 80, -12], style( 
    4382           color=3, 
    4383           fillColor=8, 
     4374          color=74,  
     4375          rgbcolor={0,0,127},  
     4376          fillColor=8,  
     4377          rgbfillColor={192,192,192},  
    43844378          fillPattern=1)); 
    43854379      connect(prismatic.axis, axis) annotation (points=[40,14; 40,56; 90,56; 90,80; 
     
    43874381      connect(prismatic.bearing, bearing)  
    43884382        annotation (points=[64,14; 64,40; 100,40],    style(color=58)); 
     4383      connect(relativeSensor.r_rel, prismatic.position_a) annotation (points=[ 
     4384            48,-69; 48,-50; 90,-50; 90,-12; 80,-12], style( 
     4385          color=74,  
     4386          rgbcolor={0,0,127},  
     4387          smooth=0)); 
    43894388    end JointUSP; 
    43904389     
     
    44634462      SI.Position aux  
    44644463        "Denominator used to compute force in rod connecting universal and spherical joint"; 
     4464      SI.Force f_rod  
     4465        "Constraint force in direction of the rod (positive, if rod is pressed)"; 
    44654466      SI.Power totalPower  
    44664467        "Total power flowing into this element, if checkTotalPower=true (otherwise dummy)"; 
    44674468      annotation ( 
    4468         preferedView="info", 
    44694469        Coordsys( 
    44704470          extent=[-100, -100; 100, 100], 
     
    45174517</p> 
    45184518</html> "), 
    4519         Icon(coordinateSystem(extent=[-200,-200; 200,200]), 
     4519        Icon( 
    45204520          Text( 
    45214521            extent=[-141,-41; 139,-66], 
     
    46014601        cylinderLength=revoluteLength, 
    46024602        cylinderColor=revoluteColor, 
    4603         specularCoefficient=specularCoefficient, 
    4604         axisTorqueBalance=false) annotation (extent=[75, -20; 35, 20]); 
     4603        specularCoefficient=specularCoefficient)  
     4604                                annotation (extent=[75, -20; 35, 20]); 
    46054605      Modelica.Mechanics.MultiBody.Joints.SphericalSpherical rod1( 
    46064606        animation=animation, 
     
    46134613        specularCoefficient=specularCoefficient, 
    46144614        kinematicConstraint=false, 
    4615         sphereColor=sphereColor) annotation (extent=[-89, -20; -49, 20]); 
     4615        sphereColor=sphereColor, 
     4616        constraintResidue=rod1.f_rod - f_rod)  
     4617                                 annotation (extent=[-89, -20; -49, 20]); 
    46164618      Modelica.Mechanics.MultiBody.Parts.FixedTranslation rod2( 
    46174619        animation=animation, 
     
    46214623        specularCoefficient=specularCoefficient, 
    46224624        r=rRod2_ib) annotation (extent=[15, -20; -25, 20]); 
    4623       Modelica.Mechanics.MultiBody.Sensors.RelativeSensor relativeSensor(animation=false)  
     4625      Sensors.RelativeSensorNew relativeSensor(                          animation=false)  
    46244626        annotation (extent=[60, -70; 40, -90]); 
    46254627      Modelica.Blocks.Sources.Constant position_b[3](k=rRod2_ib)  
    46264628        annotation (extent=[-20, -50; 0, -30]); 
    46274629    equation  
    4628       defineRoot(frame_ib.R); 
    46294630      /* Compute the unknown force in the rod of the rod1 joint 
    46304631     by a torque balance at the revolute joint: 
     
    46524653      aux = cross(revolute.e, rRod2_ib)*Frames.resolveRelative(rod1.eRod_a, 
    46534654        rod1.frame_a.R, rod1.frame_b.R); 
    4654       rod1.f_rod = (-revolute.tau - revolute.e*(frame_ib.t + frame_im.t + cross( 
     4655      f_rod = (-revolute.tau - revolute.e*(frame_ib.t + frame_im.t + cross( 
    46554656        rRod2_ib, frame_im.f) - cross(rRod2_ib, Frames.resolveRelative(rod1. 
    46564657        f_b_a1, rod1.frame_a.R, rod1.frame_b.R))))/noEvent(if abs(aux) < 1.e-10 then  
     
    47254726          fillColor=8, 
    47264727          rgbfillColor={192,192,192})); 
    4727       connect(relativeSensor.y, revolute.position_a)       annotation (points=[ 
    4728             50, -69; 50, -40; 90, -40; 90, -12; 79, -12], style( 
    4729           color=3, 
    4730           gradient=3, 
    4731           fillColor=8)); 
    47324728      connect(position_b.y, revol