Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Newtonian Equations of Motion (Looks easy!)

  1. Apr 11, 2010 #1
    1. The problem statement, all variables and given/known data

    Hi Guys,

    I am hopeful someone here may be able to help with this but if people think this should be on a different forum please let me know and I'll move it.

    I am writing a computer game and I am currently working on the computer controlled player. The player is a spaceship which can turn to face any direction and accelerate at a constant acceleration in the direction it is facing. The velocity vector can be totally different to the direction of acceleration. I want the player to accelerate towards a target (known x and y) and then turn around and start accelerating away from it so that it comes to a stop at the target. I want to know what angle to point the ship in. This would be straight towards the target if the ship was standing still but when the ship has an initial velocity this it is not so simple.

    I know:

    The acceleration (a)
    The initial velocity in x (Vx)
    The initial velocity in y (Vy)
    The distance to the target in x (Dx)
    The distance to the target in y (Dy)

    I need to know:

    The desired acceleration in x (Ax)
    The desired acceleration in y (Ay)

    such that when the acceleration in x is reversed at time t1x (not known) and reversed in y at time t1y (also not known) the spaceship will come to rest at the target.

    2. Relevant equations

    The magnitude of the total acceleration is a constant so:
    Ax^2 + Ay^2 = a^2

    I found these equations of motion useful but I have not solved this problem!

    3. The attempt at a solution

    Right, I started by thinking about the 1 dimensional problem:

    1.) At time t1 (the moment when the acceleration is reversed) the velocity is at a maximum (Vm).

    2.) We know that s1 + s2 = D where s1 is the distance travelled between the start time (t0) and t1 (when the direction is reversed), s2 is the distance travelled between t1 and the time when the player comes to rest (t). I also use t2 which equals t - t1

    3.) Using the equations of motion v=u+at and s=ut+(1/2)at^2 combined with (1) and (2) you know the following system of equations hold:

    (eq1.) Vm = V + (A * t1)
    (eq2.) Vm = A * t2
    (eq3.) s1 = (V * t1) + (0.5 * A * t1^2)
    (eq4.) s2 = (0.5 * A * t2^2)
    (eq5.) D = s1 + s2

    where V is the initial velocity, A is the acceleration and D is the distance to the target.

    From this it can be shown that (I am reasonably sure about this bit):
    (A*(t1^2)) + (2*V*t1) + ((V^2)/(2*A) - D = 0

    using the quadratic equation you can then find t1 for a given A. Whoop! :-)

    Then it is possible to find t (the total time) by using:
    (eq1 = eq2):: V + (A * t1) = A * t2
    t1 + t2 = t
    so: t = (V/A)+2t1

    All good so far. Hope you are all still following :-).

    The problem is we don't know A in the two dimensional problem. What we do know is:
    Ax^2 + Ay^2 = a^2
    tx = ty

    can anyone tell me what Ax or Ay should equal in order that these two equations satisfy?

    I am not above using an iteration but I can't find one which reliably converges. The iteration I used was:

    (new Ax) / (new Ay) = ((old Ax) / (old Ay)) * (tx / ty)
    combined with (new Ax)^2 + (new Ay)^2 = a^2

    but this doesn't work.

    Any other suggests on how to tackle this problem would also be appreciated. I have a physics degree but it was a long time ago and I have forgotten most of it! However I'm sure I can still manage most calculus.

    Thank you brainiacs!

    P.S. I hope this is within the remit of this forum. If it is not any suggestions of where I might post it would be enormously appreciated.
    P.P.S. I use the programming notation: ^ == to the power of, * = = times, / == divid
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?