Entrada destacada

Distancia media de dos puntos en un cuadrado unitario

martes, 25 de enero de 2022

Pelota Rebotando dentro de una Circunferencia

 Descargar como Notebook

Se deja caer una pelota dentro de una circunferencia y rebota con sus lados bajo la acción únicamente de la fuerza de gravedad .

g = 9.81;
tmax = 10;
rebote = ReflectionTransform[{-x[t], -y[t]}][{x'[t], y'[t]}];
solucion[x0_, y0_] := 
  NDSolveValue[{y''[t] == -g, x''[t] == 0, x'[0] == 0, y'[0] == 0, 
    x[0] == x0, y[0] == y0, 
    WhenEvent[
     x[t]^2 + y[t]^2 == 1, {x'[t], y'[t]} -> Evaluate[rebote]]}, {x, 
    y}, {t, 0, tmax}];
{xf1, yf1} = solucion[0.5, 0.7];(*Punto inicial*)
Manipulate[
 Show[ParametricPlot[{xf1[t], yf1[t]}, {t, 0, ttt}, PlotRange -> 1], 
  Graphics[{{Red, Circle[{0, 0}, 1]}, {PointSize[0.03], Orange, 
     Point[{xf1[ttt], yf1[ttt]}]}}], Ticks -> None, 
  Background -> Black], {ttt, 0.00001, tmax, 0.001, Trigger, 
  DefaultDuration -> 15}]




Para aprender más sobre Mathematica ingrese aquí sitio de aprendizaje de Wolfram o en mi website ustamathematica.wixsite.com/basicas


No hay comentarios.:

Publicar un comentario