Effacer les filtres
Effacer les filtres

Rolling ball on 3D surface

2 vues (au cours des 30 derniers jours)
Angelo Charry
Angelo Charry le 7 Fév 2019
Modifié(e) : James Tursa le 7 Fév 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 commentaire
James Tursa
James Tursa le 7 Fév 2019
Modifié(e) : James Tursa le 7 Fév 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?

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by