inverse function of ODE solution I'm trying to determine the inverse of an ODE solution. If this is possible.
$$\alpha(t)=\alpha_0(I(t)/I_0)^p$$
, where $I(t)$ is to be determined (although $lim_{t\to\infty}I(t)=I_{max}$ is fixed)
Next:
$$\frac{dn}{dt}=T(\alpha(t)(1-n)-\beta n)$$
And
$$B(t) = G\alpha(t)(1-n(t))$$
Now, (I think) I've solved $n$ and $B$ to be
$$n(t)=\frac{\alpha(t)}{\alpha(t)+\beta}+Ce^{-T(\alpha(t)+\beta)t}$$
$$B(t) = G\alpha(t)(\frac{\beta}{\alpha(t)+\beta}-Ce^{-T(\alpha(t)+\beta)t})$$
For $\lim_{t\to\infty}$:
$$n_\infty=\frac{\alpha_\infty}{\alpha_\infty+\beta}$$
$$B_\infty=G\frac{\alpha_\infty\beta}{\alpha_\infty+\beta}$$
Let's evaluate this with for instance $I(t)=0.0158I_0$, $\alpha_0=0.1$, $p=0.5$, $T=60$, $\beta=0.007$, $G=37$, $n_0=0$ and evaluate over $0\leq t<24$.

I want to determine $I(t)$ to realize $B(t)=B_\infty$. Effectively ramping-up $I(t)$ to keep $B(t)$ constant.
I expect $I(t)$ to look somewhat like:
$$I(t) = p+q(1-e^{-T(\alpha(t)+\beta)t})$$
, where $p+q=0.0158I_0$. But since $\alpha(t)$ is a function of $I(t)$, I run into problems there.
So now I'm trying to invert $B(t)$ and $n(t)$. But especially the inverse of $n(t)$ is giving me headaches.
Is my approach wrong? Should I instead use control theory?
 A: The differential equation on $n$ is a first-order linear ODE
$$
\frac{\text{d}n}{\text{d}t} + P(t)\, n(t) = Q(t) \, ,
$$
where $P(t) = T \left(\beta + \alpha(t)\right)$ and $Q(t) = T \alpha(t)$ with $\alpha(t) = \alpha_0 (I(t)/I_0)^p$. This equation can be solved using the integrating factor method, and one solution is
$$
n(t) = \exp\left(-\!\int_{0}^t P(\tau)\,\text{d}\tau\right)\left[n(0) + \int_{0}^t Q(s) \exp\left(\int_{0}^s P(\tau)\,\text{d}\tau\right)\,\text{d}s \right] .
$$
If $A$ is an antiderivative of $\alpha$, this expression rewrites as
$$
n(t) = \exp\left(-T(\beta t + A(t))\right)\left[C + T\!\int_{0}^t \alpha(s) \exp\left(T(\beta s + A(s))\right)\,\text{d}s \right] ,
$$
where $C = n(0) \exp\left(T A(0)\right)$. Let us examine the asymptotic behavior of $B(t) = G \alpha(t)\left( 1 - n(t)\right)$ when $t\to \infty$. If $\alpha(t) \to \alpha_\infty > 0$ when $t\to\infty$, then $A(t)$ goes to infinity when $t\to\infty$. The asymptotic behavior of $B(t)$ is deduced from the asymptotic behavior of $\alpha(t) n(t)$, more precisely from the asymptotic behavior of the term
$$
\alpha(t) \exp\left(-T(\beta t + A(t))\right)\! \int_{0}^t \alpha(s) \exp\left(T(\beta s + A(s))\right)\,\text{d}s \, ,
$$
which is an indeterminate form of the type "$0\times \infty$". In the case where $\alpha(t)=\alpha_\infty>0$ is constant ($p=0$ or $I(t) = I_\max$), the previous expression has a finite limit $\frac{{\alpha_\infty}^2}{\alpha_\infty+\beta}$ as $t\to\infty$, and one recovers
$$
\lim_{t\to\infty} B(t) = G \frac{\alpha_\infty\,\beta}{\alpha_\infty+\beta}\, .
$$
In the general case, further analysis is required.
