Modeling a rolling cube I want to model a behavior of a rolling cube.
So far I managed to calculate the cube position for a given rotation angle. I need to rotate it around the center of gravity, thus I needed to calculate the horizontal and vertical displacement as a function of the current rotation angle.

When I apply a given rotation I get proper linear movement. Video.
To be honest I was suprised how complicated are equations for these values.
Now I figured it would be nice to give the rotation animation a realistic feeling. By that I mean that the first 45 degrees would be slow at first and accelerating over time, and the second 45 degrees of the rotation would be a free fall.
From what I remember I need to:


*

*Figure out what forces interact with the object.
I know there must be gravity, external(moving) force and the friction.

*Find out what is the net force rotating the object.

*Calculate angular acceleration.

*Derive the equation for the angle as a function of time.


First of all, is this procedure correct?
Second of all, can you help me get started with the forces part. I don't really know where to begin, how to apply friction(I assume the rotation happens without any slide).


*

*Do I hook the gravity force in the center of gravity(I suppose yes)?

*Do I hook the moving force in the top-left corner or in the center of gravity? If in the corner, how do I take the torque into account?

*How to I divide these forces into components to calculate net forces in each direction?


I was playing with a carton of juice for half an hour, but I cannot figure out how these forces distribute.
I appreciate all the help.
 A: Let's assume that at the angle $\alpha=0$, the cube bounces off the floor with no dissipation of energy. Recall that as you say, the rotation happens without any slide. The energy of the cube (kinetic plus potential) is thus conserved and no external force is needed to maintain its motion.
For this kind of problems, it is convenient to use the Lagrangian formalism of mechanics of constrained systems. Indeed, the problem can be reduced to the motion of the center of mass that is forced to move only along quart-circles; we only need not to forget to consider also the rotational kinetic energy.
Let us introduce the angle $\beta$ which is more natural to the system:
$$\beta := \alpha + \frac{\pi}{4}$$
As the motion is going to be "periodical", we will consider only $\beta \in \big(\frac{\pi}{4}, \frac{3}{4}\pi\big)$, which correspond to the configurations between "lying on the side" and "lying on the adjacent side". This system is actually a physical pendulum, although inverted (with the center of mass above the pivot).
To find the equation of motion, express the vertical and horizontal coordinates of the center of mass in terms of $\beta$ and the side of the cube, $l$:
$$x = -\frac{l}{\sqrt{2}}\,\cos\beta, \quad y = \frac{l}{\sqrt{2}}\,\sin\beta$$
Compute their time derivatives to obtain the square of the velocity:
$$\dot{x} = \tfrac{l}{\sqrt{2}}\,\dot{\beta}\sin\beta$$
$$\dot{y} = \tfrac{l}{\sqrt{2}}\,\dot{\beta}\cos\beta$$
$$v^2 = \dot{x}^2 + \dot{y}^2 = \frac{l^2}{2}\,\dot{\beta}^2$$
Knowing the moment of inertia of the cube
$$I = \frac{ml^2}{6}\,,$$
express the kinetic and potential energy
$$T = \frac{1}{2}\left(mv^2 + I\dot{\beta}^2\right) = \frac{ml^2}{3}\,\dot{\beta}^2$$
$$V = mgy = \frac{mgl}{\sqrt{2}}\,\sin\beta$$
to get the Lagrangian $L = T - V$.
The Lagrange equation for our degree of freedom $\beta$ reads:
$$\frac{\mathrm{d}}{\mathrm{d}t} \frac{\mathrm{d}L}{\mathrm{d}\dot{\beta}} - \frac{\mathrm{d}L}{\mathrm{d}\beta} = 0$$
Specifically,
$$\frac{\mathrm{d}}{\mathrm{d}t} \left(\frac{2ml^2}{3}\,\dot{\beta}\right) + \frac{mgl}{\sqrt{2}}\,\cos\beta = 0$$
or, in other words
$$\ddot{\beta} = -\frac{3}{2\sqrt{2}}\frac{g}{l}\,\cos{\beta}$$
This is essentially the equation of the mathematical pendulum. It can be integrated to reduce the order by one:
$$\dot{\beta}^2 + \frac{3}{\sqrt{2}}\frac{g}{l}\,\sin\beta + C = 0$$
and solved either explicitly using special functions, or numerically.
Edit: In order for the cube to get over the edge and actually roll instead of rocking, one needs to choose sufficiently high initial velocity, encoded in C.
A: This is a complex problem, so rather than try an suggest an all encompassing solution, let's just look at the forces in play:

In red is the force vector we'll make to act as the driving force $F$, in black gravity, in green the Normal force and in purple the friction force (none are to scale).
Firstly, with no other forces acting in the $y$-direction (vertical), the Normal force is always the floor's reactive force (needed to prevent the cibe from sinking into the floor) to gravity:
$$F_N=mg$$
Friction will now resist movement in the $x$-dirrection (horizontal) and it's usually modelled as:
$$F_F=\mu F_N=\mu mg,$$
where $\mu$ is a friction coeficient. 
In order to prevent sliding:
$$F_F>F\implies \mu>\frac{F}{mg}$$
$F$ and $mg$ now exert opposing torques about the pivot point $P$, with net torque:
$$\big(\tau_{net}\big)_{\alpha=\pi/2}=Fa-mg\frac{a}{2}$$
If $\tau_{net}>0$ then clockwise angular acceleration will occur.
This allows us also to further define $\mu$, as the limit case is:
$$F=\mu mg \:\text{and }F=\frac{mg}{2}$$
So the minimum value is:
$$\mu>0.5$$
The angular acceleration is more easily treated as a conservation of energy problem, as the work done by $\tau_{net}$ is equal the change in (rotational) kinetic energy $\Delta K$:
$$W=\int_{\pi/2}^0\tau_{net}(\alpha)d\alpha=\Delta K$$
From trigonometry:
$$\tau_{net}(\alpha)=F\sqrt{2}a\sin\big(\alpha +\frac{\pi}{4}\big)-mg\frac{\sqrt{2}}{2}a\sin\Big(\alpha-\frac{\pi}{4}\Big)$$
On integrating we have:
$$W=\sqrt{2}aF=\frac12 I\omega^2$$
(The $mg$ term drops out because there's no change in potential energy $U$ over $\pi/2\to 0$)
So  at the end of the 'tumble':
$$\omega=\sqrt{\frac{2\sqrt{2}aF}{I}}$$
But as the cube now has kinetic energy and the tangential velocity vector is pointing straight down, the cube has to rebound. Neither friction nor the force $F$ can prevent that.
A: Something like this:

*

*Accumulate the rotation of the center of mass.

*Compute tip or slip. If it slips, then it won't accumulate rotation but will slide instead.

*After the rotation, convert it all back into translation for the next tip or slip computation (where it will reconvert back into possible rotation again) (that gets the sliding ruler problem.)

But this is only approximate thinking, however, its nice and you could apply it to any shape in general.
