Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Calculating Force from Velocity and Mass + some common misconceptions

Discussion in 'Physics' started by Martin Dachev, May 25, 2015.

Thread Status:
Not open for further replies.
  1. Martin Dachev

    Martin Dachev

    Mar 22, 2015
    Original question

    "Does anyone know how to calculate the velocity of an object of a given, constant mass after using AddForce? There is no resistance on the rigidbody, and the use gravity box is unchecked (doesn't use gravity from the physics engine).

    Ive tried looking for actual physics formulas, but they seem to all need acceleration or the length of time that the force is applied. The way I understand it, AddForce is an instant, one-time force, and doesn't have a length of time associated with it. If AddForce is actually applied over a length of time, that information will be just as helpful as a formula. Thanks"

    My answer with explanation of some common misconceptions..

    you have some problems because of some misconceptions about Force, Acceleration and Velocity.

    Let's start with Force. What is a force? It's a push or pull. Simple as that :). If ONLY one force is applied ONCE (only one time, for a really small moment) to an object with
    NO FORCES acting on it, this object gets pushed or pulled. The force, when applied, gives it velocity. Now, it has velocity, and no forces are acting on it - because
    we applied ONLY ONE FORCE ONLY ONCE (for a tiny moment). At the moment we applied the force, the object gained some velocity, it had acceleration in that moment - from 0 to v (where "v" is the current velocity).
    Now it does not have any acceleration.

    When there are no forces acting on an object, there is no acceleration or deacceleration - and the object won't change it's velocity.
    There is nothing stopping it from moving, and there is nothing accelerating it. It will move with it's velocity forever.
    It will ONLY stop when we apply a counteracting force on it (in the opposite direction of the moving object).

    But what will happen if we apply a force continuously to it? Well, it will have acceleration. Why?
    OK, we apply force for the first time to the object that is NOT MOVING (doesn't have velocity) and NO FORCES are acting on it. It is pushed by the force, so it get's some
    velocity. But now we apply the force again (we are applying it continuously). The object has some velocity, and when we apply the same force again, it gets pushed again, so it gains more velocity.
    When we continue to apply the same force it gains more and more velocity - it has acceleration.

    That's why the formula is
    F = m*a,
    where "F" is force, "m" is mass and "a" is acceleration.

    The WRONG formula is
    F = m*v,
    where "v" is velocity, because it can have velocity when no forces are currently applied to it.

    If we have NO ACCELERATION, we aren't applying any force, and it doesn't matter if it HAS or HAS NOT velocity.

    In your case, you want to calculate what force is needed to accelerate a stopped object to a given velocity. So,

    F = m*a
    a = dv/dt, where "dv" is deltaVelocity.
    dv = (v - v0), where "v0" is the velocity in the beginning (in our case v0 = 0, because the object is not moving), "v" is the end velocity (in our case the desired velocity).


    a = (v-v0) / dt, where "dt" is the time it took the velocity to change from v0 to v (in fact, dt = t - t0, t = end time, t0 = starting time. For example, if the change
    happened in the timeframe between 2 seconds and 3 seconds, dt will be t - t0 = 3 - 2 = 1 second).

    In our case, t0 = 0s, because it's from the start => so our formula now is
    a = (v - v0) / (t-t0)
    a = (v - 0) / (t - 0)
    a = v/t (this is ONLY BECAUSE v0 = 0 and t0 = 0)
    F = m*(v/t)

    Now, as Brian Stone said,
    The AddForce() function assumes that the force is applied over the fixed timestep duration set by the Unity engine.
    By default, the fixed timestep is set to 0.02 seconds, but you can change it to almost anything you want in the Time Manager settings
    which is accessed in the Edit->Project Settings->Time menu. You can also get or set the fixed timestep in code via Time.fixedDeltaTime.
    Well, then "t" from the formula is the fixed timestep duration set by the Unity engine in our case,
    t = Time.fixedDeltaTime.

    So, finally

    F = m * (v/t), where "m" is the mass of the object, "v" is the desired velocity and t = Time.fixedDeltaTime.

    I hope this helped you reader, I hope I explained it as simple as it can be.
  2. draphaels


    Feb 20, 2014
    Thaks for the explanation!!
  3. swarknoffamelia


    Aug 25, 2018
    can anyone help me a hose H has a hole of cross sectional area 50 cm square and ejects water horizontally at a speed of 0.3 m per second .if the water is incident on a vertical wall w and its horizontal velocity becomes zero ,what force is exerted on the wall
  4. BoogieD


    Jun 8, 2016
    I think if you work out the volume of the water that hits the wall within a single frame you can determine the relevant mass of the water. The force exerted upon the wall will be the same as the force of that volume of water.
  5. MacKenzieHnC


    Oct 3, 2017
    Excellent! You definitely helped this reader!
  6. JulianJPoole


    Dec 17, 2014
    "In your case, you want to calculate what force is needed to accelerate a stopped object to a given velocity."

    Well, no that's not what he is asking clearly:

    "Does anyone know how to calculate the velocity of an object of a given, constant mass after using AddForce"

    so really the equation he is after is:

    V = F * t / m

    F = force in Newtons
    t = Time.fixedDeltaTime
    m = mass in kg

    And V is the velocity (m/s)..... which is what he wanted.
  7. Vincent_Zou


    Sep 23, 2019
    This answer is truly awesome, even though is 2022 now, it still helping people like me don't know how to calculate the force in the specific frame. Thank you soooo much!
  8. MelvMay


    Unity Technologies

    May 24, 2013
    Yes and 7 years later, this thread is necroed again. Please consider using the like button to appreciate posts rather than necroing them which, by the way, is against the forum rules.

Thread Status:
Not open for further replies.