CMM-22 / a3

0 stars 0 forks source link

integration: if the force depends on the velocity #4

Open samibouziri opened 2 years ago

samibouziri commented 2 years ago

Hello,

for the exercice 2 to test the integration function we have to generate a force that keeps the boids at a fixed distance of the center. Thus this force will have to depend not only on the position of the boid but also on the velocity. the issue is that in the assignment the force only depends on the position. while the only solution for the Explicit Euler and Symplectic Euler cases is to add v_n as an argument of the force, the Explicit midpoint case is more tricky as we can either add v_n or v_n+1/2 as the argument of the force. So do you have a hint on how to add the velocity as the argument of the force ?

Thanks

ydual commented 2 years ago

For the circular motion, I don't think you need a velocity-dependent force. If you want a velocity-dependent force somewhere later in the exercise, v_n is fine to use.

liyuesolo commented 2 years ago

Yes, you don't need a velocity-dependent force to maintain circular motion.

samibouziri commented 2 years ago

well to maintain a circular motion you need a centrifugal force which depend on the velocity. we can assume that the norm of the velocity is constant but that won't be the case if we integrate numerically.

liyuesolo commented 2 years ago

Maybe let's think of a similar problem and see if it makes sense to you. Do you need a velocity-dependent force to implement Hooke's spring which also aims to preserve the distance between two end points?

Sibsoon commented 2 years ago

If I would implement a hooke's spring I would expect to know the spring constant and the deformation value with it's sign. This implied that we make up a number for k and use the knowledge of the original distance. Or did I misunderstand something?

liyuesolo commented 2 years ago

that's right. You would need a penalty coefficient k, and the original distance is known from your initialization.

Memphis99 commented 2 years ago

But is it ok if we use velocities to get the centripetal forces and it works fine? Or we can't use them?

liyuesolo commented 2 years ago

For this exercise please use a position dependent force