Rolling ball on 3D surface

6 visualizaciones (últimos 30 días)
Angelo Charry
Angelo Charry el 7 de Feb. de 2019
Editada: James Tursa el 7 de Feb. de 2019
Hi,
For a school project I need to study the dynamic of a ball. I already finished the flight and bouncing dynamic but now I need to make it roll on any 3D surface using ode45.
I came with this idea :
function F = Roulement(t,Y)
P = Parametres() ;
g = P.gravite ;
n = normale(Y(1),Y(2),'terrain')
ez=[0,0,1]';
F = [Y(4);Y(5);Y(6);g*(n*ez)*n(1);g*(n*ez)*n(2);g*(n*ez)*n(3)-g];
Where normale return the normal vector for the point (Y(1),Y(2)) of the function terrain (the 3D surface), Roulement is the function that I will next give to ode45.
Of course it can't work because Y(1) and Y(2) are not scalars. So what should I do ?
Thanks
  1 comentario
James Tursa
James Tursa el 7 de Feb. de 2019
Editada: James Tursa el 7 de Feb. de 2019
This really looks like a sliding point mass simulation, not a rolling ball simiulation. Why aren't Y(1) and Y(2) scalars? Do you have a 6-element state vector (3 position and 3 velocity)? Can you tell us more about how you have set this problem up?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by