How to Apply Friction and Gravity to a 3D Velocity Vector?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
32 replies · 10K views
fmucker said:
I am pretty sure I have everything figured out except the coef of friction. I have no idea what equation to use for it or how to apply it.

I gave you what I think you need for that. Take the acceleration from friction to be in the opposite direction of the velocity with magnitude proportional to the velocity. As I look at the initial conditions again, I can't see 100 being a reasonable number for the proportionality constant, but you can easily adjust that value in your program. Resolve both accelerations (gravity and friction) into vertical and tangential components.

I suggest you add the two accelerations to your diagram.
 
Physics news on Phys.org
The effect of friction on the asteroid is to reduce the magnitude (size) of the velocity of the asteroid. It does not change the direction of the velocity of the asteroid. For example if the velocity of the asteroid is 1000 distance units per time unit while it is going in some direction inside of the gg then the friction will reduce it to 900 in a time interval of one unit. This follows from the definition of average acceleration:

[tex]a = \frac{\Delta v}{\Delta t}[/tex]

if we take the acceleration due to friction f (it will be a -100 due to the fact that it is decelerating the asteroid) and investigate the change in speed during a time interval of one unit this formula comes to

[tex]f = \Delta v = v_{n+1} - v_n[/tex]

so that the new speed of the asteroid will be

[tex]v_{n+1} = v_n + f[/tex]
 
My instructor finally repsonded to my message. He makes it sound so much simpler than it is.

These are the equations we need:

position(t+0.001) approximately = position(t) + velocity(t)*0.001

+ is defined here as adding the coordinates (x,y,z) separately.
The y coordinate of the sum is gotten by adding the two y coordinates of the
items being added together.

velocity(t+0.001) approximately = velocity(t) + acceleration(t)*0.001

gravitational acceleration = a / (d*d)
a is given as 1.0
d is the Cartesian distance between the asteroid and the planet
direction of gravitational acceleration is from the asteroid to the planet

frictional acceleration = speed * coefficient
speed comes from the velocity vector, sqrt(vel.x^2+vel.y^2+vel.z^2)
coefficient is given as 100.0
frictional acceleration is 0 if asteroid is not inside planet atmosphere
direction of frictional acceleration is opposite of the direction the asteroid
is moving (opposite to velocity vector)

Thanks for everyone's help, but I guess my teacher wants it to be super simple and I have it figured out now.