Extending 1D ball bouncing simulation to 2D

8 visualizaciones (últimos 30 días)
Rohit Kharat
Rohit Kharat el 30 de Ag. de 2021
Editada: Image Analyst el 1 de Sept. de 2021
The task is to extend the 1D ball bouncing simulation to two dimensions (x and y), and plot the ball motion for several bounces, including horizontal and vertical motion versus time and versus each other.For the horizontal motion we can assume that the ball slips when in contact with ground and that this slippage causes a proportional reduction in horizontal velocity. We can choose an initial condition so that the ball moves to the right and I have to show how the bouncing dies out over time with a coefficient of restitution of less than 1. You may choose your own values for coefficient of restitution and horizontal damping rate.
  7 comentarios
Walter Roberson
Walter Roberson el 31 de Ag. de 2021
To add to this: just like the ballode example, you need to call ode45() using event functions, and the event functions (contact with the floor detected) must signal for termination. The ode45() call will terminate, and you adjust the boundary conditions the way DGM indicates, and then you call ode45() again with the new boundary conditions.
Do not try to use if statements or whatever inside the code to detect bouncing and try to do everything in one run: the mathematics of the techniques used by the ode*() functions requires that you stop the run at each discontinuity.
Rohit Kharat
Rohit Kharat el 1 de Sept. de 2021
Thanks Walter. It makes sense now.

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 1 de Sept. de 2021
Editada: Image Analyst el 1 de Sept. de 2021
Can't you just replace your 1-D y with z, then make a new y for the second dimension? Then you'll have a Vx and Vy instead of only a Vx. Then after each bounce you need to decrease the Vx and Vy by the appropriate amount due to the slippage. (The attached demos are generic, with nothing specific to your slipping simultation.)

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by