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

Click For Summary
The discussion revolves around simulating the trajectory of an asteroid passing a gas giant, focusing on applying friction and gravity to a 3D velocity vector. Participants clarify that gravitational acceleration can be modeled using the inverse square law, with the force acting on the asteroid being independent of its mass. The coefficient of friction is debated, with suggestions that it should act as a resistive force proportional to velocity, rather than opposing gravity directly. The conversation also touches on the complexities of the asteroid's trajectory when transitioning between the atmosphere and space, emphasizing the need for a general formula to account for varying initial conditions. Overall, the physics concepts are crucial for implementing the simulation effectively.
  • #31
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
  • #32
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:

a = \frac{\Delta v}{\Delta t}

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

f = \Delta v = v_{n+1} - v_n

so that the new speed of the asteroid will be

v_{n+1} = v_n + f
 
  • #33
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.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 21 ·
Replies
21
Views
5K
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 7 ·
Replies
7
Views
5K
Replies
13
Views
3K
Replies
3
Views
1K
Replies
7
Views
2K