Solving an Account Growth ODE with a Deposit Threshold
Summary
The document solves for an account value when interest accrues at a time-varying rate and continuous deposits stop once the balance reaches a specified threshold. It divides the problem into two intervals: before the threshold, the balance follows a linear differential equation with both interest and deposits; after the threshold, it grows under interest alone. An integrating factor gives the balance during the deposit phase, and continuity at the stopping time supplies the starting value for the later phase.
The worked derivation uses an initial balance, a constant deposit rate, and a rate that declines with time in the stated functional form. It expresses the threshold time implicitly through the balance equation rather than calculating a numerical stopping time. A second answer gives the constant-rate analogue and sketches the time-varying-rate extension. The main caveat is that the result depends on the stated continuous-deposit convention and rate function; it does not address discrete contributions, taxes, fees, or other account rules.
Key ideas
- Split the balance equation at the time when deposits stop.
- Use an integrating factor to solve the linear growth equation while deposits continue.
- After the threshold is reached, evolve the balance using the interest rate alone.
- Match the two phases by carrying the threshold balance continuously into the no-deposit phase.
- The expression depends on the specified deposit convention and time-varying interest rate.
Tags
Full text
# Derive an expression for the value of the asset as a function of time, V(t), t>=0
# Derive an expression for the value of the asset as a function of time, V(t), t>=0
An investor deposits USD 300 in a bank account at time 0, reinvests all interest payments and continuously invests USD 300 per annum, until the total value of the deposits reaches USD 3312. At that point the investor stops making additional deposits, but still lets the interest payments accumulate in the account.
The ODE for the value of the deposits, $V$, over time is then, $$\frac{dV}{dt}=r(t)V(t)+I(t),$$ where $I(t)=300$ until $V(t)$ reaches $V$=3312, at which point $I(t)$ instantaneously switched to $I(t)=0.$ Also, $r(t)=\frac{1}{20+\frac{t}{2}}$.
Derive an expression for the value of the asset as a function of time, $V(t)$, $t\geq 0.$
$\textbf{My Approach: }$
I tried the problem by using the formula, $$V(t)=e^{-P(T)}\Bigg{(}\int_{0}^{T}e^{P(t)}q(t)dt + c\Bigg{)}, \text{ } c\in \mathbb{R},$$ where $P(t)=\int_{0}^{t}r(t)dt$. I don't know how to progress any further. Any help will be greatly appreciated. Thanks in advance
## Answer by alexjo (score 0, accepted)
https://quant.stackexchange.com/a/24745
Let be $V_0=300$ the deposit at $t=0$, $V(T)=3312$ the value at $t=T$, and $r(t)=\frac{1}{20+t/2}=\frac{b}{a+t}$ the interest rate with $a=40$ and $b=2$. Denote $$I(t)=\rho\left(1-H(t-T)\right)$$ the rate of payment at any time in the range $[0,T]$ where $\rho=300$ and $H(t)$ is the Heaviside function or step function defined as $$H(t)=\begin{cases} 1 & t> 0\\ 0 & t\le 0 \end{cases}$$ so that $$I(t)=\begin{cases} 0 & t> T\\ \rho & 0\le t\le T \end{cases}$$ So you have to solve $$ \frac{\mathrm d V}{\mathrm d t}=r(t) V(t)+I(t)\tag 1 $$ that is a first order non-linear ODE. It's better to solve the equation (1) separately in the time intervals $t\le T$ and $t>T$ considering the following two linear ODE $$ \begin{align} \frac{\mathrm d V}{\mathrm d t}&=r(t) V(t)+\rho & 0\le t\le T\tag 2\\ \frac{\mathrm d V}{\mathrm d t}&=r(t) V(t) & t> T\tag 3 \end{align} $$ The general solution of $\dot x(t)+p(t)x(t)=q(t)$ is $$ x(t)=\frac{1}{u(t)}\left(\int u(t)q(t)\mathrm{d}t+C\right) \qquad \text{where } u(t)=\mathrm{e}^{\int p(t)\mathrm{d}t} $$ Then we have for equation (2) $$ V(t)=\mathrm{e}^{P(t)}\left(\int_0^t \rho \mathrm{e}^{-P(s)}\mathrm{d}s+C\right)\tag 4 $$ where $$P(t)=\int_0^t r(s)\mathrm{d}s=b\log\left(1+\frac{t}{a}\right)\tag 5$$ and $\mathrm{e}^{P(t)}=\left(1+\frac{t}{a}\right)^b$.
The condition $V(0)=V_0$ leads to $C=V_0\mathrm{e}^{-P(0)}=V_0$ because $P(0)=0$. Then the (4) becomes $$ \begin{align} V(t)&=V_0\mathrm{e}^{P(t)}+ \mathrm{e}^{P(t)}\int_0^t \rho \mathrm{e}^{-P(s)}\mathrm{d}s\\ &=V_0\left(1+\frac{t}{a}\right)^b+\rho\mathrm{e}^{P(t)}\int_0^t \left(1+\frac{s}{a}\right)^{-b}\mathrm{d}s\\ &=V_0\left(1+\frac{t}{a}\right)^b+\rho\left(1+\frac{t}{a}\right)^b\left[\frac{(a+t)^{1-b}a^b}{(1-b)}-\frac{a}{1-b}\right]\\ &=V_0\left(1+\frac{t}{a}\right)^b+\rho\left[\frac{a+t}{1-b}-\frac{(a+t)^{b}a^{1-b}}{1-b}\right]\\ &=V_0\left(1+\frac{t}{a}\right)^b+\frac{\rho a}{1-b}\left[\left(1+\frac{t}{a}\right)-\left(1+\frac{t}{a}\right)^b\right] \tag 6 \end{align} $$ The solution for (3) is $$ V(t)=V(T)\mathrm{e}^{P(t)-P(T)}\tag 7 $$ where from (6) $$V(T)=V_0\left(1+\frac{T}{a}\right)^b+\frac{\rho a}{1-b}\left[\left(1+\frac{T}{a}\right)-\left(1+\frac{T}{a}\right)^b\right]\tag 8$$ Finally the solution is
> $$ V(t)= \begin{cases} V_0\left(1+\frac{t}{a}\right)^b+\frac{\rho a}{1-b}\left[\left(1+\frac{t}{a}\right)-\left(1+\frac{t}{a}\right)^b\right] & 0\le t\le T\\ V(T)\mathrm{e}^{P(t)-P(T)} & t> T \end{cases}\tag 9 $$ or $$ V(t)= \begin{cases} V_0\mathrm{e}^{P(t)}+\frac{\rho a}{1-b}\left[\mathrm{e}^{P(t)/b}-\mathrm{e}^{P(t)}\right] & 0\le t\le T\\ V(T)\mathrm{e}^{P(t)-P(T)} & t> T \end{cases}\tag {10} $$
## Answer by Neeraj (score 2)
https://quant.stackexchange.com/a/24735
Let's suppose $P$ is total annual deposits made continuously, then the change in value of total deposits $dV_t$ is (assuming no condition on additional deposits) $$dV_t= V_t r dt + P dt $$ where we assumed $r$ is constant. Solving above differential equation, we have: $$V_T = V_0 e^{rT} + \frac{P}{r} (e^{rT} -1)$$
Assuming $t_1$ is the time period at which $V_T$ reach the limit $(K)$ (which is 3312 in the question), thereafter investor stop making deposits. So, the value of deposits at time $t_1$ is: $$V_{t_1} = V_0 e^{r t_1} + \frac{P}{r} (e^{rt_1} -1) = K$$ You can solve the above equation numerically to derive $t_1$. After $t_1$, there is no fresh deposits, so your account will grow normally and value of portfolio at $T \{T > t_1 \}$ is $$V_T = V_{t_1} e^{r(T-t_1)} = K e^{r(T-t_1)} \quad \quad \,T > t_1$$
So, your expression for the vale of deposits is:
\begin{equation} V_T = \begin{cases} V_0 e^{rT} + \frac{P}{r} (e^{rT} -1) \quad & T \leq t_1\\ Ke^{r(T-t_1)} \quad \quad \quad \quad \quad & T> t_1 \end{cases} \end{equation}
#### Edit: Assuming interest rate $r$ as a function of time.
In this case, the value of deposits at time $T$ is: $$V_T = V_0 e^{\int_{0}^{T}r(t)dt} + \int_{0}^{T} Pe^{\int_{0}^{t}r(s)ds}dt$$Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.