# Ball rotating in a Turntable

I made a turntable to make some experiments and make some studies about Coriolis and Euler forces acting in different frames of reference.

    Manipulate[Module[{max,
eqs = {(t vx0 + x0) Cos[t/2] + t (vy0 + x0/2) Sin[t/2],
t (vy0 + x0/2) Cos[t/2] - (t vx0 + x0) Sin[t/2]}},
max = (If[NumberQ[#1], #1, 40] &)[
Quiet@FindRoot[Evaluate[Plus @@ (eqs^2) == 1], {t, 155, 0, 5000},
MaxIterations -> 50][[1, 2]]];
If[max == 0, max = .01];
ParametricPlot[Evaluate[eqs], {t, 0, max},
Prolog -> {GrayLevel[.8], Disk[{0, 0}, 1], PointSize[.02],
GrayLevel[.0], Point[{0, 0}]}, PlotRange -> {{-1, 1}, {-1, 1}},
Axes -> False, PlotPoints -> 1000]], {{x0, .5,
"initial position x"}, 0, 1,
Appearance -> "Labeled"}, {{vx0, -.0004,
"initial velocity in x"}, -0.1, .1,
Appearance -> "Labeled"}, {{vy0, .23,
"initial velocity in y"}, -.24, .24, Appearance -> "Labeled"},
SynchronousUpdating -> False]


What i want to do is to make this simulation 3D. As the picture below shows

• I think the question is too open-ended because it's not made clear how realistic the 3D scene should be. E.g., to simulate the correct rolling motion of a sphere would be more challenging than to use a dot... the desired level of detail should be clarified first. I assume you don't want to account for the moment of inertia of the sphere, but I'm not sure.
– Jens
Commented Feb 15, 2016 at 20:51

Manipulate[

Module[{
eqs = {(t vx0 + x0) Cos[t/2] + t (vy0 + x0/2) Sin[t/2],
t (vy0 + x0/2) Cos[t/2] - (t vx0 + x0) Sin[t/2]}},
max = (If[NumberQ[#1], #1, 40] &)[
Quiet@FindRoot[Evaluate[Plus @@ (eqs^2) == 1], {t, 155, 0, 5000},
MaxIterations -> 50][[1, 2]]];
If[max == 0, max = .01];

Show[ParametricPlot3D[Append[eqs, 0.05], {t, 0, max}, PlotPoints -> 1000],
Graphics3D[{Cylinder[{{0, 0, 0}, {0, 0, 0.01}}, 1],
Sphere[Append[eqs /. t -> tt, 0.05], 0.04]}], PlotRange -> All,
Axes -> False, Boxed -> False]
],
{tt, 0, max, Appearance -> "Open"},
{{x0, .5, "initial position x"}, 0, 1, Appearance -> "Labeled"},
{{vx0, -.0004, "initial velocity in x"}, -0.1, .1, Appearance -> "Labeled"},
{{vy0, .23, "initial velocity in y"}, -.24, .24, Appearance -> "Labeled"}
]


• When running you code i get the followuing error: An unrecognized option name ("PlotPoints") was encountered while reading a Graphics. (under v.10.0) Commented Feb 15, 2016 at 20:18
• Done. In this case it works fine. Commented Feb 15, 2016 at 20:22
• Yeah, i had the same problem with PlotPoints. After deleting it runs!! Tks! Commented Feb 15, 2016 at 20:23
• Is it possible to change the "point" for a Ball? or Sphere? Commented Feb 15, 2016 at 20:44
• @dcvilela Sure, see the edit. Commented Feb 15, 2016 at 20:52