I am trying to calculate the limits (range) of the center of gravity of two masses (boxes) when there is a force that hit the masses.
Above is the free body diagram of the two masses, and the equation; however, how would I convert this to Matlab compatible equation or code?
I will appreciate all the answers
No products are associated with this question.
Let the lower box have width a and height b, and for the upper box width c and height d. Let e be the amount the upper box is offset from the right edge of the lower box. Assuming the lower left corner of the lower box is the coordinate origin and assuming uniform densities, the centers would be:
c1 = [a/2;b/2]; % c.g. before rotation by phi c2 = [e+c/2;b+d/2]; R = [cos(phi),-sin(phi);sin(phi),cos(phi)]; % rotation matrix c1 = R*c1; % c.g. after rotation by phi c2 = R*c2;
You still haven't said where there is any "range" involved.
The centers of gravity don't depend on the moment of inertia. The effect of the impulse force on the boxes does.
The moment of inertia computation will also have to involve a, b, c, d, and e. I'll leave that one to you.