Changeset 519

Show
Ignore:
Timestamp:
07/29/2007 08:57:36 PM (18 months ago)
Author:
otter
Message:

Bug in MultiBody.Parts.FixedRotation corrected:
The torque balance was wrong in the following case:
- frame_b is in the spanning tree closer to the root

(usually this is frame_a).

- vector r from frame_a to frame_b is not zero

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Mechanics/MultiBody/parts.mo

    r416 r519  
    428428      " Additional parameter depending on shapeType (see docu of Visualizers.Advanced.Shape)." 
    429429      annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 
     430    parameter Boolean checkTotalPower=false  
     431      "= true, if total power flowing into this component shall be determined (must be zero)" 
     432      annotation (Dialog(tab="Advanced")); 
     433     
    430434    input Types.Color color=Modelica.Mechanics.MultiBody.Types.Defaults.RodColor  
    431435      " Color of shape"  
     
    439443        Frames.axesRotations(sequence, Cv.from_deg(angles), zeros(3))  
    440444      "Fixed rotation object from frame_a to frame_b"; 
     445  /* 
     446  SI.Power totalPower  
     447    "Total power flowing into this element, if checkTotalPower=true (otherwise dummy)"; 
     448*/ 
    441449  protected  
    442450    outer Modelica.Mechanics.MultiBody.World world; 
     
    573581      frame_b.R = Frames.absoluteRotation(frame_a.R, R_rel); 
    574582      zeros(3) = frame_a.f + Frames.resolve1(R_rel, frame_b.f); 
    575       zeros(3) = frame_a.t + Frames.resolve1(R_rel, frame_b.t) - cross(r, 
    576         frame_a.f); 
     583      zeros(3) = frame_a.t + Frames.resolve1(R_rel, frame_b.t) - cross(r, frame_a.f); 
    577584    else 
    578585      frame_a.R = Frames.absoluteRotation(frame_b.R, R_rel_inv); 
    579586      zeros(3) = frame_b.f + Frames.resolve1(R_rel_inv, frame_a.f); 
    580       zeros(3) = frame_b.t + Frames.resolve1(R_rel_inv, frame_a.t) + cross(r, 
    581         frame_b.f); 
     587      zeros(3) = frame_b.t + Frames.resolve1(R_rel_inv, frame_a.t) + cross(Frames.resolve1(R_rel_inv,r), frame_b.f); 
    582588    end if; 
     589     
     590  /* 
     591  if checkTotalPower then 
     592    totalPower = frame_a.f*Frames.resolve2(frame_a.R, der(frame_a.r_0)) + 
     593                 frame_b.f*Frames.resolve2(frame_b.R, der(frame_b.r_0)) + 
     594                 frame_a.t*Frames.angularVelocity2(frame_a.R) + 
     595                 frame_b.t*Frames.angularVelocity2(frame_b.R); 
     596  else 
     597    totalPower = 0; 
     598  end if; 
     599*/ 
    583600  end FixedRotation; 
    584601