# Simulating Physics - dt vs formula

I was just wondering, when simulating physics is it usually a good idea to get the time delta from the last frame and apply the relevant motion equations?

Something like:

void simulate(float dt)
{
vel += (force / m) * dt;
}


In this case wouldn't there be an accumulated error over time due to precision? For example when trying to simulate a circular motion?

Or would it be better to get the entire elapsed time from the beginning, and then apply the motion:

void simulate(float elapsedTime)
{
vel = vel0 + (force/m)*elapsedTime;
}


And since this doesn't depend on the previous simulate() steps, it's less likely to cause precision errors?

Thanks!

Using the second approach will not introduce accumulated precision errors, but won't allow you to change force or mass unless you calculate a new vel0 first and subtract a time offset from elapsedTime, in which case it quickly turns into your first approach.