# Calculate distance with variable acceleration [closed]

I haven't studied math in many years, so this might be trivial but I would appreciate any help nonetheless. I want to calculate the distance it takes for a vehicle to reach a specific speed. I have found this equation(Sorry for the Swedish): It gives the acceleration at a specific speed based on air resistance, friction, incline and the power of the vehicle, etc.

How do I convert this to a function of speed and distance? I want the end result to look like this (x=distance, y=velocity, each line representing a different incline %): I'm guessing I need to integrate, but I can't remember exactly how. Any help would be appreciated.

you have to solve those two differential equation numerically for example with MATLAB program.

$${\frac {d}{dt}}v \left( t \right) ={\frac {p}{v \left( t \right) }}-b \left( v \left( t \right) \right) ^{2}+c \\{\frac {d}{dt}}x \left( t \right) =v \left( t \right)$$

simulation results

initial conditions $$~v(0)=10/3.6~$$[m/s] $$~x(0)=0~$$[m]

$$~p=30~,c=100~$$ You could swap $$\frac{dv}{dt}$$ to $$\frac{dv}{ds}\times \frac{ds}{dt} = v\frac{dv}{ds}$$

Then you'd get an equation of the form

$$v\frac{dv}{ds} = \frac{a}{v}-bv^2-c$$

$$s = \int {\frac{v}{\frac{a}{v}-bv^2-c}}dv$$

probably best solved with a graphical calculator such as Desmos. You would then have a graph of $$s$$ against $$v$$ with $$v$$ on the $$x$$ axis. Then do a reflection in the line $$y=x$$ to get the inverse function, a plot of $$v$$ against $$s$$.

Like this, for an example, with $$a=5$$, $$b=0.1$$ and $$c=0.2$$ https://www.desmos.com/calculator/7n88v2vafp