# How to calculate average velocity in a time interval when it is exponentially changing?

For velocity that is changing linearly (like with constant acceleration) it quit easy, (end velocity - start velocity) / 2.0. But what if it is changing by exponential equation, for example v(t,d) = (2^d) * t (t is time in seconds, d is distance traveled)? This sounds like mission impossible. As d depends on v and the way around. Real life example is magnet and a small metallic object. As closer the metallic object gets to the magnet, as more attracting force and there for more acceleration and velocity.

• The formula for $v(t,d)$ is dimensionally inconsistent and potentially ambiguous (if $t$ is in the exponent, it should be written 2^(d*t). Even better if you use mathjax for formulae. Aug 6 at 7:46
• @GiorgioP I agree with you about the use of bracket to remove any ambiguity by if it was $e^d$ you could interpret it as $e^{1\cdot d}$ where the constant $1$ has the dimensions of reciprocal length. Aug 6 at 7:56
• @Farcher It would be possible, but it is a bad practice. Here the situation is even less clear because usually, velocity is not a function of the traveled distance. Aug 6 at 8:17
• I fixed the formula. Aug 6 at 8:19
• Still, I do not understand the formula. Why velocity should be a function of the traveled distance? Would it imply another dependence on time through $d(t)$? Aug 6 at 9:12

The direct part of the question (how to calculate average velocity in a time interval when it is exponentially changing) can be answered simply. However, the way the question was formulated requires a few preliminary words about the time dependence of velocity.

As an effect of the specific motion of a body, we can consider its velocity as a function of time. Due to the requirement of being a solution of the (second order) differential equations of motion, the velocity at time $$t$$ will also depend on the initial position and velocity. But, for a given set of external forces, no other quantity may influence the velocity. It is true that also position varies with time and then the traveled distance. However, in general, there is no functional dependence of the velocity on position or distances. Only in particular conditions it would be possible to invert the relation between distances and time to re-express the time dependence of velocity in terms of distances.

Having established that what we have in general is the velocity as a function of time ( $${\bf v}(t)$$ ), the question is how to calculate the average of a continuous function of time over a finite interval of time (say from $$t_0$$ to $$t_1$$ )? In general, the velocity $${\bf v}(t)$$ is a vector, and one should evaluate the average of the velocity components along three independent directions ($$v_x, v_y, v_z$$, for instance). If we are interested in the speed, i.e., to the modulus of the velocity, the same average should be applied to the scalar function $$v(t)=\sqrt{v_x^2(t)+v_y^2(t)+v_z^2(t)}.$$ In all the cases, we have to evaluate the average of one or more scalar functions of time $$f(t)$$ over an interval between $$t_0$$ and $$t_1$$.

What is the simplest average among $$N$$ different values? The arithmetic average: $$\frac1N \sum values$$ If we sample our continuous function $$f$$ over $$N$$ equally-spaced times from $$t_0$$ to $$t_1$$ we get an approximation of the average by using only a finite set of points in the time interval. $$\langle f \rangle \simeq \frac1N \sum f(t_i).$$ By relying on the definition of integral, it is possible to show that if $$f$$ is not a pathological function, the previous approximate formula converges to the value $$\langle f \rangle = \frac{1}{(t_1-t_0)}\int_{t_0}^{t_1} f(t)dt.$$ Such a formula provides the average value of $$f$$ over a generic interval and can be used for any dependence of $$f$$ on $$t$$.

Notice that if the interval $$\left[ t_0, t_1\right]$$ is so tiny that in that interval, the variation of $$f$$ can be well approximated by a linear behavior, the two-point approximation $$\langle f \rangle \simeq \frac{f(t_1)+f(t_0)}{2}$$ may provide an excellent estimate of the average. Notice the plus sign combining the function values at the two times. In the case of velocity, a minus sign would provide the average acceleration, not the average velocity.

I would use one of the general ways to calculate the average of any function $$f(t)$$:

$$=\frac{1}{\Delta T}\int_0^{\Delta T}f(t)dt$$

For any time period $$\Delta T$$.

• Eh. Unfortunately, in years, I lost all my knowledge about calculus. Aug 6 at 15:29
• Youtube helps :) Aug 6 at 16:34

Like in your related question, How to calculate traveled distance with non constant acceleration in time? , one should go back to the definitions: $$x(t)\equiv\int v(t)\ dt$$ and $$v(t)\equiv\int a(t)\ dt$$ and @agaminon 's formula $$=\frac{1}{\Delta T}\int_0^{\Delta T}f(t)dt$$

Then you should clearly formulate what you are given.
(Presumably, you don't have $$x(t)$$. If you did, then you have $$=\frac{x(\Delta T)-x(0)}{\Delta T}$$ as a function $$\Delta T$$. END.)

• When given the velocity $$v(t)$$,
determine the positions from $$x(t)$$ from $$\int v(t)\ dt$$ and the average velocity from $$=\frac{1}{\Delta T}\int_0^{\Delta T}v(t)dt,$$ which is a function of $$\Delta T$$. END.

• When given the acceleration $$a(t)$$,
find $$v(t)$$ from $$\int a(t)\ dt$$. Then continue with the previous case. END.

• When given $$a(t,x)$$ [say from using Newton's Laws], you have to solve a differential equation (via the definitions of velocity and acceleration in derivative form)... analytically, if it's nice; numerically, if it's not : $$\frac{d^2}{dt^2}x(t)=a(t,x)...\mbox{solve for x(t), then take the derivative to get v(t), then use the first case.}$$ or $$\frac{d}{dt}v(t)=a(t,x)...\mbox{solve for v(t), then use the first case}.$$ An example is the simple harmonic oscillator.

• When given $$v(t,x)$$ you have to solve a differential equation (via the definition of velocity in derivative form)... analytically, if it's nice; numerically, if it's not : $$\frac{d}{dt}x(t)=v(t,x)...\mbox{solve for x(t), then take the derivative to get v(t), then use the first case.}$$ or $$\frac{d}{dt}v(t)=a(t,x)...\mbox{solve for v(t), then use the first case}.$$

Unless the system is nice, you probably have to solve the problem numerically since there is likely no closed-form solution. Thus, you need to use a method like the Euler Method or fancier methods like Runge-Kutta.

Possibly useful:
See the Python code in "Thinking Iteratively" (a talk by Ruth Chabay and Bruce Sherwood, at timestamp 15m00s) https://www.youtube.com/watch?v=e-shsRZQsi4&t=900s
In a timestep $$dt$$,

• Update force $$\vec F$$
• Update momentum $$\vec p\ += \vec F\ dt$$
• Update position $$\vec x \ += \frac{1}{m}\vec p$$.
You can get velocity from the momentum and thus compute the current "average-velocity since the reference time".

Related to magnets:

https://iopscience.iop.org/article/10.1088/0143-0807/28/3/003
"Magnetic field of a dipole and the dipole–dipole interaction" by Yaakov Kraftmakher: 2007 Eur. J. Phys. 28 409

https://doi.org/10.1119/1.4979653
https://hal.archives-ouvertes.fr/hal-02408779/
"Magnetic cannon: The physics of the Gauss rifle" by Chemin et al, Am. J. Phys. 85, 495 (2017);