1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Parallel axis theorem, cube! (Confirm)

  1. Jun 20, 2011 #1
    Parallel axis theorem, cube! (Confirm)

    // Idisp = Icenter + mass[ (RdotR)*I - RcrossR ]

    So to test it out, I create a long box at the origin, and then a smaller
    box, half its width, so I can offset it along the x axis, and times it by
    2, so it should equal the inertia tensor of the long box.

    Is this correct?... why would it be wrong?

    Thanx,

    Jon

    // ref: http://en.wikipedia.org/wiki/Parallel_axis_theorem

    // Understanding???
    float mass = 1.0f;
    Matrix inertiabBox = BoxMatrix(mass/*mass*/, 3/*width*/, 10/*height*/, 50/*depth*/);
    Matrix inertiaLongBox = BoxMatrix(mass/*mass*/, 6/*width*/, 10/*height*/, 50/*depth*/);

    Vector3 R = new Vector3(3.0f,0,0); // Offset it by R
    Matrix mA = inertiabBox + mass*( Vector3.Dot(R,R)*Matrix.Identity - OuterProduct(R,R) );

    Matrix inertiaSameAsLongBox = 2 * mA; ???? but why?


    /* REF */
    Matrix BoxMatrix(float mass, float w, float h, float d)
    {
    float ss = (1/12.0f) * mass;
    Matrix bb = Matrix( ss*(h*h+d*d), 0, 0, 0,
    0, ss*(w*w+d*d), 0, 0,
    0, 0, ss*(w*w+h*h), 0,
    0, 0, 0, 1 );
    return bb;
    }

    Matrix OuterProduct( Vector3 a, Vector3 b)
    {
    return Matrix( a.X*b.X, a.X*b.Y, a.X*b.Z, 0.0f,
    a.Y*b.X, a.Y*b.Y, a.Y*b.Z, 0.0f,
    a.Z*b.X, a.Z*b.Y, a.Z*b.Z, 0.0f,
    0, 0, 0, 1.0f );
    }
     
  2. jcsd
  3. Jun 20, 2011 #2
    Problem sorted, my mistake, in my calculations I was making the assumption that mass was the same for both the smaller and larger box...should have been setting the density the same and recalculating the mass.

    float mass0 = 0.5f;
    float mass1 = 1.0f;
    Matrix inertiabBox = BoxMatrix(mass0 /*mass*/, 3/*width*/, 10/*height*/, 50/*depth*/);
    Matrix inertiaLongBox = BoxMatrix(mass1 /*mass*/, 6/*width*/, 10/*height*/, 50/*depth*/);

    Vector3 R = new Vector3(1.5f,0,0); // Offset it by R
    Matrix mA = inertiabBox + mass0*( Vector3.Dot(R,R)*Matrix.Identity - OuterProduct(R,R) );

    Matrix inertiaSameAsLongBox = 2 * mA;

    Thanx

    Jon
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Parallel axis theorem, cube! (Confirm)
Loading...