1
$\begingroup$

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

enter image description here

$\endgroup$
  • 2
    $\begingroup$ 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. $\endgroup$ – Jens Feb 15 '16 at 20:51
7
$\begingroup$
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"}
]

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.