In this homework
1. Derive the equations for the inverted pendulum.
2. Solve the equations by runge kutta. At t=0, the cart must be at the origin and the pendulum must bend 9 degrees, the speeds of the cart and pendulum must be zero.
3. The forcing must be entered through the keyboard. R key pushes the cart to the right, L key pushes the cart to the left.
4. Decide all the parameters (masses, force of the push etc) yourself.
5. Use pygame to animate your result. WRITE THE RK4 CODE YOURSELF. DO NOT USE LIBRARY.
6. Try to keep the inverted pendulum upright by using l AND r KEYS.