Rolling ball on 3D surface

2 次查看(过去 30 天)
Angelo Charry
Angelo Charry 2019-2-7
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 个评论
James Tursa
James Tursa 2019-2-7
编辑:James Tursa 2019-2-7
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?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by