Assuming you can calculate accelerations, you'll need to do some form of numerical integration to calculate velocities and positions in small steps of time.
For each time step, you calculate
new_velocity = old_velocity + time_step x average_acceleration
One way to do this is to use trapezoidal method
average_accleration = 1/2 (acceleration0 + acceleration1)
where acceleration0 is the acceleration at the start of a time step and acceleration1 is the acceleration at the end of a time step. This requires you be able to calculate acceleration1 directly or to be able to predict it via an iterative method (see below)
You can then calculate position once you calculate the new velocity, using the same method:
new_position = old_position + time_step x 1/2 x (old_velocity + new_velocity)
An iterative corrector method will improve the results. In the algorithm shown below, a
n, v
n, and p
n, are successive "guesses" that should converge quickly. F(...) calculates the acceleration based on p
n(t), and Δt is the elapsed time per step. You may want to do 6 to 8 interations instead of the 4 shown in this example. The first step is essentially Euler (since a
1(t) is set = F(p
0(t)) (= a(t-1)), the remaining steps are trapezoidal. Even though each step of this algorithm will converge to a specific set of values, the algorithm is based on trapezoidal rule, a linear approximation, so you need to use small time steps (Δt).
v
0(t) = v(t-1)
p
0(t) = p(t-1)
a
1(t) = F(p
0(t)) (= a(t-1))
v
1(t) = v(t-1) + 1/2 (a(t-1) + a
1(t)) Δt
p
1(t) = p(t-1) + 1/2 (v(t-1) + v
1(t)) Δt
a
2 = F(p
1(t))
v
2(t) = v(t-1) + 1/2 (a(t-1) + a
2(t)) Δt
p
2(t) = p(t-1) + 1/2 (v(t-1) + v
2(t)) Δt
a
3 = F(p
2(t))
v
3(t) = v(t-1) + 1/2 (a(t-1) + a
3(t)) Δt
p
3(t) = p(t-1) + 1/2 (v(t-1) + v
3(t)) Δt
a
4 = F(p
3(t))
v
4(t) = v(t-1) + 1/2 (a(t-1) + a
4(t)) Δt
p
4(t) = p(t-1) + 1/2 (v(t-1) + v
4(t)) Δt
...
v(t) = v
n(t)
p(t) = p
n(t)
a(t) = F(p
n(t))
time += Δt
t += 1
This is a predictor-corrector type algorithm:
http://en.wikipedia.org/wiki/Predictor-corrector_method#Euler_trapezoidal_example