Express drag force/acceleration/velocity as function of time

  • #1
Massimo
9
5
TL;DR Summary
How can I express the drag force, acceleration, and velocity of an object moving through a fluid as a function of time?
Let's say an object with a mass of 400,000 kg, a drag coefficient of C, and a reference area of A m^2 moves horizontally with a thrust of X N through a fluid with a density of Z kg/m^3. The object is initially stationary. I'm trying to figure out how I can express the drag force, acceleration, and velocity of this object as a function of time (in seconds).

I'm not quite sure where to begin with this, but surely it's possible? I tried approaching this by plugging in constants in place of the variable to make this as easy as possible; 0.35 for C, 16 for A, 30,000 for X, and 1024 for Z, and trying to calculate the acceleration at 10 seconds. Even then, I can't seem to figure it out, as acceleration is net force/mass, but in order to get net force, I need the drag force which requires velocity, which in turn requires acceleration... Does anyone have any ideas?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
What preliminary research on the web have you done about drag force? If the answer is "none", here is a good place to start and get oriented. It seems to me that for what you want to do, you will have to write a differnetial equation, solve it and then put in the initial conditions and numbers. Plugging in numbers from the start will not get you very far.

Your object is quite massive. Note that its shape also matters as far as the drag force is concerned.
 
  • Like
Likes Massimo
  • #3
kuruman said:
What preliminary research on the web have you done about drag force? If the answer is "none", here is a good place to start and get oriented. It seems to me that for what you want to do, you will have to write a differnetial equation, solve it and then put in the initial conditions and numbers. Plugging in numbers from the start will not get you very far.

Your object is quite massive. Note that its shape also matters as far as the drag force is concerned.
I've done a fair bit of research on drag force and drag coefficient the past month, although prior to that I had no knowledge/experience at all in hydrodynamics, and I still know relatively little; I'm still researching online and learning a lot, although much of the math is beyond me as a precalc student.

As for the size of my object, it's a submarine model of mine, albeit a relatively small one with a length of 40.5 meters. I used its CAD model to get the reference area for the drag force/drag coefficient equations and derived the drag coefficient itself from several CFD simulations at a frontal orientation, although reference area will obviously change with orientation, and drag coefficient will vary with that and the Reynolds number. My long term goal is to make a submarine simulator with the most realistic physics possible, and this is one of many very small steps.

I guess I should start looking into differential equations, as I'm unfamiliar with them; is there any place in particular you recommend I should start?
 
  • #4
Massimo said:
I guess I should start looking into differential equations, as I'm unfamiliar with them; is there any place in particular you recommend I should start?
If you are a precalc student, looking into differential equations will be a frustrating experience. It will be like looking at a story written in a language you don't know. It would be unrealistic to expect that you can learn how to solve differential equations on your own if you have not studied calculus.

Let me ask you this. Is it just a formula of the velocity as a a function of time that you need for your simulation? If so, this is a problem that has been solved many times over and can be found on the web. Do some research for the formula when the drag force is written as $$F_D=\frac{1}{2}\rho~ C_D~v^2$$ and report back with what you found. I can you give you the formula right now, but I think you need to see for yourself and understand the complexity of your undertaking first.
 
  • Like
Likes hutchphd, Vanadium 50, russ_watters and 1 other person
  • #5
There is an analytical solution to the question, but if you are in pre-calc you won't see it until post calculus courses. What you are going to want to do is a numerical integration of the differential equation you wish to solve. Or research and find the analytical solution as @kuruman suggest. I was thinking since you are looking for a simulation, the simple formula of a numerical integration may even be easier to write in a programming language.
 
  • Like
Likes Massimo
  • #6
erobz said:
There is an analytical solution to the question, but if you are in pre-calc you won't see it until post calculus courses. What you are going to want to do is a numerical integration of the differential equation you wish to solve. Or research and find the analytical solution as @kuruman suggest. I was thinking since you are looking for a simulation, the simple formula of a numerical integration may even be easier to write in a programming language.
I was actually been looking into the Runge-Kutta method just now, and I managed to get a very math-savvy AI to write a python script to plot these values for me according to the RK 4th order method; it's a good start, but I'll continue to look into it.
 
  • Like
Likes PeroK
  • #7
kuruman said:
If you are a precalc student, looking into differential equations will be a frustrating experience. It will be like looking at a story written in a language you don't know. It would be unrealistic to expect that you can learn how to solve differential equations on your own if you have not studied calculus.

Let me ask you this. Is it just a formula of the velocity as a a function of time that you need for your simulation? If so, this is a problem that has been solved many times over and can be found on the web. Do some research for the formula when the drag force is written as $$F_D=\frac{1}{2}\rho~ C_D~v^2$$ and report back with what you found. I can you give you the formula right now, but I think you need to see for yourself and understand the complexity of your undertaking first.
I'm aware of the formula for drag force, but what I'm looking for is a formula that can calculate drag force, acceleration, and velocity at any given time while taking into account the effects of the other variables and a changing drag coefficient, fluid density, etc..
 
  • #8
Massimo said:
but what I'm looking for is a formula that can calculate drag force, acceleration, and velocity at any given time while taking into account the effects of the other variables and a changing drag coefficient, fluid density, etc..
Yes, you've said this. However, as @kuruman said
kuruman said:
It seems to me that for what you want to do, you will have to write a differnetial equation
and
kuruman said:
If you are a precalc student, looking into differential equations will be a frustrating experience. It will be like looking at a story written in a language you don't know.

You are looking for an algebra equation that does this. It does not exist. You may find one that works in special cases or approximations, but what you are asking for doesn't exist.

Clarifying your question might conceivably help, but repeating it, not so much.
 
  • #9
Vanadium 50 said:
Yes, you've said this. However, as @kuruman said

and


You are looking for an algebra equation that does this. It does not exist. You may find one that works in special cases or approximations, but what you are asking for doesn't exist.

Clarifying your question might conceivably help, but repeating it, not so much.
I wasn't aware that "formula" necessarily meant an algebra equation, I thought it encompassed differential equations too which is my mistake; to clarify, I am indeed looking for a differential equation, and a solution/method for this particular differential equation. Based on my little research, I believe it would be an ordinary differential equation (only one independent variable: time) and an initial value problem (there is an initial condition), thus requiring either a Runge-Kutta or Euler method to solve, but please correct me if I'm wrong. If I happen to be correct, which should I use?
 
  • Like
Likes PeroK
  • #10
Massimo said:
I'm aware of the formula for drag force, but what I'm looking for is a formula that can calculate drag force, acceleration, and velocity at any given time while taking into account the effects of the other variables and a changing drag coefficient, fluid density, etc..
In how many dimensions do you plan on applying the governing equation? The Runge-Kutta is just a numerical solution technique to solve a non-specific DE. You need to develop the ODE you plan on solving.
 
  • #11
Massimo said:
I am indeed looking for a differential equation,
You're going to get something horrific like (but not exactly) this:

{\displaystyle \left({\frac {\partial }{\partial t}}+\mathbf {u} \cdot \nabla -\nu \,\nabla ^{2}\right)\mathbf {u} =-{\frac {1}{\rho }}\nabla p+\mathbf {f} .}

How exactly does this help you if you are a pre-calculus?
 
  • Like
Likes berkeman
  • #12
erobz said:
There is an analytical solution to the question, but if you are in pre-calc you won't see it until post calculus courses. What you are going to want to do is a numerical integration of the differential equation you wish to solve. Or research and find the analytical solution as @kuruman suggest. I was thinking since you are looking for a simulation, the simple formula of a numerical integration may even be easier to write in a programming language.
Ok, with some help I actually came up with a python script to run a RK 4th order method for the drag force, acceleration, velocity, and distance traveled over time for good measure. It also plots the four variables accordingly (requiring matplolib). The results definitely seem sensible at the very least, but maybe a 6th order method would be more accurate?

Python:
import math
import matplotlib.pyplot as plt

# Object properties
mass = 393000  # kg
drag_coeff = 0.35
ref_area = 16.2088  # m^2
thrust = 30000  # N

# Fluid properties
fluid_density = 1024  # kg/m^3

# Initial conditions
t0 = 0  # Initial time (s)
v0 = 0  # Initial velocity (m/s)
x0 = 0  # Initial position (m)

# Time step
dt = 0.01  # Time step (s)

# Simulation time
t_max = 250  # Maximum simulation time (s)

def drag_force(v):
    return 0.5 * fluid_density * drag_coeff * ref_area * v ** 2

def acceleration(v):
    return (thrust - drag_force(v)) / mass

def rk4_step(t, v, x):
    k1v = dt * acceleration(v)
    k1x = dt * v
    k2v = dt * acceleration(v + 0.5 * k1v)
    k2x = dt * (v + 0.5 * k1v)
    k3v = dt * acceleration(v + 0.5 * k2v)
    k3x = dt * (v + 0.5 * k2v)
    k4v = dt * acceleration(v + k3v)
    k4x = dt * (v + k3v)
    v_new = v + (k1v + 2 * k2v + 2 * k3v + k4v) / 6
    x_new = x + (k1x + 2 * k2x + 2 * k3x + k4x) / 6
    return v_new, x_new

# Simulation loop
t = t0
v = v0
x = x0
time = [t]
velocity = [v]
accel = [acceleration(v)]
drag = [drag_force(v)]
distance = [x]

while t < t_max:
    a = acceleration(v)
    d = drag_force(v)
    v, x = rk4_step(t, v, x)
    t += dt
    time.append(t)
    velocity.append(v)
    accel.append(a)
    drag.append(d)
    distance.append(x)

# Plotting
plt.figure(figsize=(12, 8))
plt.subplot(4, 1, 1)
plt.plot(time, velocity)
plt.title("Velocity vs Time")
plt.xlabel("Time (s)")
plt.ylabel("Velocity (m/s)")

plt.subplot(4, 1, 2)
plt.plot(time, accel)
plt.title("Acceleration vs Time")
plt.xlabel("Time (s)")
plt.ylabel("Acceleration (m/s^2)")

plt.subplot(4, 1, 3)
plt.plot(time, drag)
plt.title("Drag Force vs Time")
plt.xlabel("Time (s)")
plt.ylabel("Drag Force (N)")

plt.subplot(4, 1, 4)
plt.plot(time, distance)
plt.title("Distance Traveled vs Time")
plt.xlabel("Time (s)")
plt.ylabel("Distance (m)")

plt.tight_layout()
plt.show()
 
  • Like
Likes PeroK
  • #13
Massimo said:
Ok, with some help I actually came up with a python script to run a RK 4th order method for the drag force, acceleration, velocity, and distance traveled over time for good measure. It also plots the four variables accordingly (requiring matplolib). The results definitely seem sensible at the very least, but maybe a 6th order method would be more accurate?
Thats ok for 1 dimensional motion (motion in straight line with constant coefficients). You are going to enter another level of difficulty if you start moving in 2D (or 3D). I think it very quicky moves into the realm of "unsolved physics problems". But if you are just trying to fake someone out in a video game...maybe it will act believably...
 
Last edited:
  • Like
Likes Massimo
  • #14
erobz said:
Thats ok for 1 dimensional motion (motion in straight line with constant coefficients). You are going to enter another level of difficulty if you start moving in 2D (or 3D). I think it very quicky moves into the realm of "unsolved physics problems". But if you are just trying to fake someone out in a video game...maybe it will act believably...
Indeed, but I do want to work toward a 3D solution, albeit very slowly and carefully. I think this is a good start. I will look more into RK methods, and continue exploring differential equations :smile: Thanks for everyone's help!
 
  • Like
Likes PeroK
  • #15
Massimo said:
Indeed, but I do want to work toward a 3D solution, albeit very slowly and carefully. I think this is a good start. I will look more into RK methods, and continue exploring differential equations :smile: Thanks for everyone's help!
Note a possible complication for moving into 3D. The equation of motion you use is not valid in more than 1 D motion. The actual equation is (I believe more like):

$$ \vec{\mathbf{T}} +m\vec{\mathbf{g}} + \vec{\mathbf{F_b}} -\frac{1}{2}\rho C_D A_{\text{proj.}} v \vec{\mathbf{v}} = m \vec{\mathbf{\dot v}} $$

That entangles all the component specific equations of motion because ##v## is the magnitude of the velocity ##v = \sqrt{ v_x^2 + v_y^2 + v_z^2}##

Best of Luck.
 
  • Like
Likes Massimo

Similar threads

Replies
1
Views
605
  • Classical Physics
Replies
17
Views
2K
Replies
11
Views
943
Replies
7
Views
803
  • Classical Physics
2
Replies
41
Views
2K
  • Classical Physics
2
Replies
35
Views
2K
Replies
4
Views
377
  • Introductory Physics Homework Help
Replies
10
Views
312
Replies
13
Views
748
Replies
10
Views
1K
Back
Top