Filter löschen
Filter löschen

Rolling ball on 3D surface

2 Ansichten (letzte 30 Tage)
Angelo Charry
Angelo Charry am 7 Feb. 2019
Bearbeitet: James Tursa am 7 Feb. 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 Kommentar
James Tursa
James Tursa am 7 Feb. 2019
Bearbeitet: James Tursa am 7 Feb. 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?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by