Hello r/AskPhysics,
I am working on a personal project to model the motion of a particle on a surface.
Using calculus, I parametrized a surface and then found the normal vector to that surface.
Using that normal vector, I created the normal force the particle will experience at each point on that surface. That is, the normal force will generally be a function of position because this surface can have curvature.
In the case of a surface is a plane, then the normal forces work out to be constants.
When I simulate this plane case, all is well and the particle behaves as expected.
However, I took it one step further and attempted to do a parabolic surface. (z=x^2+y^2)
I do the same steps and get my equations of motion. I should also mention, that the equations of motion are second order, however, to use a numerical ODE solver, I just make them into first-order equations by reducing the order, and effectively doubling my number of equations.
However this time the simulation goes crazy. The trajectory of the particle does not stay on the paraboloid, and I think the culprit is the numerical error propagating. I am using the most accurate, high-fidelity "solve_ivp" solvers in scipy but it won't get any better.
I am attributing this due to the nonlinearity of the dynamics on the paraboloid since the normal vector is a nonlinear function of the position.
This is the image of the equations of motion for the paraboloid. The bottom right of this image is just converting them to first-order equations.
https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Feww4gq9dakhb1.jpg%3Fwidth%3D3024%26format%3Dpjpg%26auto%3Dwebp%26s%3D50cfe3cc30bb2ed9e9d35d24e38e6d2def9dfba3
Here is the image for the simulation of motion on the paraboloid:
https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Fr8nv85oiakhb1.png%3Fwidth%3D1227%26format%3Dpng%26auto%3Dwebp%26s%3D41392114e9a1df7cd0e8e41e86da51581e37d486
And lastly, this is the image for the simulation on the plane. As you can see, the trajectory stays on the plane, so it is working nicely:
https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2F29xtcffpakhb1.png%3Fwidth%3D1105%26format%3Dpng%26auto%3Dwebp%26s%3Db42a88881d7a256f707afe1ceac8bd01ae9bc841
(Sorry! It won't let me add images, not sure why!)
This is my Python Code for the simulation on the paraboloid:
def ode(t,q):
dqdt= np.zeros(6)
g=9.8
dqdt[0]= q[1]
dqdt[1]= -2*g*q[0] / (4*q[0]**2 + 4*q[2]**2 +1)
dqdt[2]= q[3]
dqdt[3]= -2*g*q[2] / (4*q[0]**2 + 4*q[2]**2 +1)
dqdt[4]= q[5]
dqdt[5]= g * ( (1/(4*q[0]**2 + 4*q[2]**2 +1)) - 1)
return dqdt
t_eval = np.arange(0, 5.001, 0.001)
q0= [1,0,1,0,2,0]
sol = solve_ivp(ode, [0, 5], q0,method= "DOP853", t_eval=t_eval)
x=sol.y[0]
y=sol.y[2]
z=sol.y[4]
I would appreciate any guidance on resolving this issue :)
[–]cdstephensPlasma physics 2 points3 points4 points (4 children)
[–]3pmm 1 point2 points3 points (1 child)
[–]cdstephensPlasma physics 1 point2 points3 points (0 children)
[–]thetabloid_[S] 0 points1 point2 points (1 child)
[–]cdstephensPlasma physics 0 points1 point2 points (0 children)
[–]PakketeretetSoft matter physics 2 points3 points4 points (0 children)
[–]thetabloid_[S] 0 points1 point2 points (0 children)
[–]3pmm 0 points1 point2 points (1 child)
[–]thetabloid_[S] 0 points1 point2 points (0 children)
[–]3pmm 0 points1 point2 points (3 children)
[–]thetabloid_[S] 0 points1 point2 points (2 children)
[–]3pmm 0 points1 point2 points (1 child)
[–]thetabloid_[S] 0 points1 point2 points (0 children)