1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Formula that models a runner's speed considering acceleration (for a computer simulation)

  1. May 29, 2015 #1
    Hello! I have been trying to make a simulation and it doesn't quite work right, don't exactly know why. I have two questions!

    1. Acceleration
    I have been trying

    I need a formula that uses.
    frames till full speed (f) (if framerate is 60fps and this value is 60 then player is at full speed after 1 second this is probably in essence really drag )
    Full speed (s) (stores the maximum speed in distance per second)
    Frames (t) (stores how many frames the player has been trying to run for)

    If their are more variables that are needed feel free to use them.

    And comes out with
    Actually speed (as) (which is the speed the player should move considering acceleration this value will get added to player position each frame)

    I suppose I am really trying to model acceleration which is like

    a = (velocity change)/(time) however doing that doesn't seem to get the right effect.

    My goal is that when the player moves it is not full speed from the start, instead it accelerates up to full speed. This is so if you want to for example jump across a long distance you need to get a running start.

    2. Velocity lost in a jump
    So when a human jumps about how much x, y, and z is lost (I realize it is impossible to find an exact number... I just need an estimate for a simulation). Basically when the player jumps I am going to divide x y and z velocity by a number, but I don't know which one.

    I suppose in both of these situations I am really asking for cartoon physics so I might be necessary to exaggerate some values.
  2. jcsd
  3. May 29, 2015 #2


    User Avatar
    Homework Helper

    Speed is Acceleration*Time if acceleration is constant. However, your acceleration might not be constant. If you want to use this, then your acceleration should be
    A= (s)/(f) for 0<(t)<(f), A = 0 when (t) >=(f)
    (as) = A*(t) for 0<(t)<(f), (as) =(s) when (t) >=(f).
    If the person is accelerating from a medium speed (ps), then I would reset the relative time to (t) = (ps)/A.

    For the second part, one simple way would be to transfer the speed directly into the jump.
    if you start with [x,y,0] and jump angle is b, then the speeds after the jump would be [xcosb,ycosb, sqrt(x^2+y^2)sinb], with the z component needing to lose speed due to gravity.
  4. May 30, 2015 #3
    To simulate system behaviour by forces law and initial conditions only, just take a look.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook