# How do I update position using velocity, acceleration and friction with variable time?

Without friction it is simple, because velocity changes linearly over time, so I can multiply average velocity with $timeDelta$. $$velocity_{next} = velocity + acceleration * timeDelta$$ $$position_{next} = position + \frac{velocity + velocity_{next}}{ 2} * timeDelta$$

Few formulas about my understanding of friction. If I'm wrong please tell me it :)

$$acceleration = 0$$ $$velocity_{next} = velocity * friction^{timeDelta}$$ $$velocity_0 = 8, \quad friction=0.5$$ $$velocity_1 = 4$$ $$velocity_2 = 2$$ $$velocity_3 = 1$$ $$velocity_4 = 0.5$$

Now I want to put velocity, acceleration and friction together, but it's hard for me, because velocity change by friction is exponential over time.

-
This seems legit. Why is it hard for you to have velocity changing exponentially over time? – Tunococ Nov 28 '12 at 5:08

Generally two types of frictional forces that are encountered. In one the acceleration due to frictional force is proportional to the Normal force of the object on which the force is acting. So the frictional force $F=\mu\cdot N$ where $N$ is the noraml force.For example in the case of a moving car it is $\mu\cdot Mg$ where $M$ is the mass of the car. So if there is an external force $F_e$ already acting on the car provided by the engine then the net force on the car is $F_e-\mu\cdot Mg$ and hence the net acceleration is $\frac{F_e}{M}-\mu\cdot g$ . So $velocity_n=velocity_o+(\frac{F_e}{M}-\mu\cdot g)\cdot timedelta$
But there are also cases when the resisting acceleration or drag is proportional to the velocity and hence $$\frac{dv}{dt}=-kv$$ $$\Rightarrow \frac{dv}{v}=-kdt$$ $$\Rightarrow v=v_0e^{-kt}$$$$\Rightarrow v_{next}=v_{now}\cdot e^{-ktimedelta}$$ This all will eventually lead to the following also $$\frac{ds}{dt}=v_0e^{-kt}$$ $$\Rightarrow s=\frac{v_0}{k}(1-e^{-kt})$$ Consolidating all above you get $$v_{next}=v_{now}.e^{\frac{acceleration_{now}}{v_{now}}\cdot timedelta}$$