Modeling particles moving through a chamber Consider the following phenomenon.
Particles each traveling with speed $v_i$ metres per second enter a chamber at a rate of $r$ particles per second.
Upon entering the chamber, each particle begins to reduce its speed from $v_i$ to $v_f$.  Each particle then exits the chamber.
If I look at an individual particle entering the chamber at time $0$, it is travelling $Ce^{-At}$ metres per second after $t$ seconds.  The constants $C$ and $A$ are the same for every particle.
I let this process run for some time.  Is there an expression $n(v,t)$ describing the number of particles in the chamber which are travelling at speed $v_i \leq v \leq v_f$ at time $t > 0$?
 A: Consider the statement

If I look at an individual particle entering the chamber at time $0$, it is travelling $Ce^{−At}$ metres per second after $t$ seconds. The constants $C$ and $A$ are the same for every particle.

If $t=0$, the speed would be $C\cdot e^{−A*0}=C\cdot e^0=C$. Therefore, $v_i=C$ (Thanks @Semiclassical for pointing this out before). So the speed of a particle which entered the chamber at time $0$ after $t$ seconds is
$v_i\cdot e^{−At}$
Let $t_c$ be the time required for a particle to traverse the chamber. We obtain
$v_f=v_ie^{-A\cdot t_c}$
$\rightarrow\frac{v_f}{v_i}=e^{-A\cdot t_c}$
$\rightarrow\ln\frac{v_f}{v_i}=-A\cdot t_c$
$\Rightarrow-\frac{\ln\frac{v_f}{v_i}}A=t_c$
At this point, let me make a few assumptions (let me know if any is wrong):


*

*The question is "How many particles are in the chamber at a given time?"

*The first particle enters at $t=0$

*A particle which is exactly at the entrance of the chamber is considered inside the chamber (thus at $t=0$ there is $1$ particle in the chamber)

*A particle is no longer considered inside the chamber as soon as its speed reaches $v_f$


Consider that the rate of particle entrance is $r\cdot s^{-1}$. In other words, a particle enters every $\frac1{r\cdot s^{-1}}=\frac1r\text{ }s$. Therefore, the number of particles which have entered the chamber before or at time $t$ is
$\lfloor\frac tr\rfloor+1$
Also consider that, starting at $t=t_c=-\frac{\ln\frac{v_f}{v_i}}A$ (i.e. when the first particle exits), particles start exiting the chamber every $\frac1r\text{ }s$. Therefore, the number of particles which have exited the chamber before or at time $t\ge-\frac{\ln\frac{v_f}{v_i}}A$ is
$\lfloor\frac{t-(-\frac{\ln\frac{v_f}{v_i}}A)}r\rfloor+1$
$=\lfloor\frac{t+\frac{\ln\frac{v_f}{v_i}}A}r\rfloor+1$
Therefore, at a given time $t\ge-\frac{\ln\frac{v_f}{v_i}}A$, the number of particles which have entered the chamber and still is in the chamber is
$\lfloor\frac tr\rfloor+1-(\lfloor\frac{t+\frac{\ln\frac{v_f}{v_i}}A}r\rfloor+1)$
$=\lfloor\frac tr\rfloor+1-\lfloor\frac{t+\frac{\ln\frac{v_f}{v_i}}A}r\rfloor-1$
$=\lfloor\frac tr\rfloor-\lfloor\frac{t+\frac{\ln\frac{v_f}{v_i}}A}r\rfloor$
Therefore, considering the case that $t\lt-\frac{\ln\frac{v_f}{v_i}}A$, the formula of the number of particles in the chamber at any given point is
$n(t)=\begin{cases}\lfloor\frac tr\rfloor+1\text{, if }t\lt-\frac{\ln\frac{v_f}{v_i}}A\\\lfloor\frac tr\rfloor-\lfloor\frac{t+\frac{\ln\frac{v_f}{v_i}}A}r\rfloor\text{, if }t\ge-\frac{\ln\frac{v_f}{v_i}}A\end{cases}$
