How to computationally simulate a ball rolling down a curved track? How can I accurately computationally simulate a bowling ball rolling down a bobsleigh track? (Initially ignore air friction and ice/concrete friction.)
I'm familiar with basic Newtonian mechanics, and have written code to simulate basic rigid body interactions before, however I have a hard time understanding how to apply these laws to accurately simulate centripetal/"centrifugal" force, and without an accurate calculation of this force, it would be impossible to find the height the ball would rise to while rolling around a curve.
I also wonder if an accurate measurement of radius of curvature is required to accurately calculate centripetal force. On a bobsleigh track, there is a major axis and a minor axis of curvature, and both these curvatures are changing constantly.
Or is it possible to not know the exact curvature, but simply move the bowling ball forward one timestep, and figure out how far "into the track" the ball would have moved on its current trajectory while passing around a corner, then correct the motion by moving it back out to the surface of the track, and using the required correction distance as an estimate of the curvature of the track and the centripetal force that had to be applied to keep the ball on the surface of the track?
 A: This will be a somewhat incomplete answer because there are a lot of unknowns you have to decide for yourself, and regardless there are a lot of ways to answer this question. Some methods will be easier than others, and your final choice largely depends on a combination of what properties you care about simulating and what methods you're comfortable using.
One general method would be to use Hamiltonian mechanics, as it is much easier (in my opinion) to capture constraining forces in that formalism using Lagrange multipliers. You could:

*

*Write down the Lagrangian of the ball, along with the constaint equations that define the surface the ball is rolling on.


*Pass to the Hamiltonian formalism using a Legendre transform, and write down the Hamiltonian equations of motion for the ball.


*After the last step, you will have a set of first order coupled differential equations which you can solve using your method of choice, such as a Runge-Kutta 4th order method.
This is a very rough outline, but there's no single way to answer this question, and, like I said, a lot will depend on your current knowledge and comfort with different techniques. I might suggest as well starting small and simulating the same problem in a lower dimension - perhaps try to simulate a ball rolling on a half pipe first to get the general idea.
