First Order ODE with Constant Forcing Functions
Contents
Introduction
This page will look at solving first-order constant-coefficient ordinary differential equations with constant forcing functions. The main context for these equations is in switched RL or RC circuits with constant sources.
Differential Equation Simplification
There are many systems that will have some measurable quantity $$y(t)$$ related to an external forcing function $$f(t)$$ through the equation:
$$\begin{align*} a_1\,\frac{dy(t)}{dt}+a_0\,y(t)&=b_0\,f(t) \end{align*}$$
where $$a_i$$ and $$b_i$$ are constants. For now, let us assume that the forcing function is some constant $$f$$ such that the equation becomes:
$$\begin{align*} a_1\,\frac{dy(t)}{dt}+a_0\,y(t)&=b_0\,f \end{align*}$$
Now, for purposes that will become clear later, let us divide all three terms by $$a_0$$ (assuming that it is non-zero) to get:
$$\begin{align*} \frac{a_1}{a_0}\,\frac{dy(t)}{dt}+\,y(t)&=\frac{b_0\,f}{a_0} \end{align*}$$
From this equation, you can see that there are actually only two constants that matter, $$\frac{a_1}{a_0}$$ and $$\frac{b_0\,f}{a_0}$$. We will give them names and then we can re-write the equation with those new names:
$$\begin{align*} \mbox{Time Constant}&~\tau & \tau&=\frac{a_1}{a_0}\\ \mbox{Final Value}&~y_f & y_f&=\frac{b_0\,f}{a_0}\\ \mbox{New Equation}&~ &\tau\,\frac{dy(t)}{dt}+\,y(t)&=y_f \end{align*}$$
Particular Solution
The particular solution to a differential equation will resemble the forcing function. For instance, the particular solution to an nth order polynomial is an nth order polynomial and the particular solution to a sinusoid at a particular frequency is a sinusoid at that same frequency (potentially with a different amplitude and phase angle). The particular solution to a differential equation with a constant forcing function, then, will be a constant. We can solve for that constant by replacing $$x(t)$$ with a constant $$c_p$$ in the differential equation:
$$\begin{align*} \tau\,\frac{dy(t)}{dt}+\,y(t)&=y_f\\ \tau\,\frac{d(c_p)}{dt}+\,(c_p)&=y_f\\ \tau\cdot\,0+c_p&=y_f\\ c_p&=y_f \end{align*}$$
From this, we can see that $$c_p$$ is equal to $$y_f$$, the normalized version of the forcing function. We will momentarily see that this is also the final value of $$y(t)$$ which is why it is called $$y_f$$.
Homogeneous Solution
The homogeneous solution to a differential equation describes how the system can transition from some set of initial conditions to following the forced solution. In many cases, the system will not be able to immediately track the forcing function but needs some time to get there. As an example, if someone is sitting on a swing and you push them with a constant force, they cannot immediately move to the exact angle that will balance your force out with the force of gravity -- they have to move there. In a similar way, if you apply a constant voltage to an RC circuit where the capacitor was initially uncharged, it will take some time for the capacitor voltage to reach the source voltage.
The typical form of the homogeneous solution is $$y_h(t)=Ke^{st}$$ where $$K$$ is some constant and $$s$$ is an exponent. Note: the use of $$s$$ as the exponent in this case is forecasting the use of Laplace Transforms at some point in the future. Other symbols commonly used for the exponent are $$p$$, $$r$$, and $$\lambda$$; they would each take on the same values in this case, but would forecast other techniques in your future (for example, Lyapunov functions of linear algebra and eigenstuff).
Note that the homogeneous solution is a solution that works for the system if the forcing function were zero! That is to say, the particular solution above has already taken care of the right side of the equation; the homogeneous solution takes care of going from some set of initial conditions to tracking the forcing function. Given that:
$$\begin{align*} \tau\,\frac{dy_h(t)}{dt}+y_h(t)&=0\\ \tau\,(s\,K\,e^{st})+K\,e^{st}&=0\\ K\,e^{st}\,(s\tau+1)&=0 \end{align*}$$
For that last equation to hold, either $$K=0$$ (possible, but trivial), $$e^{st}=0$$ (not possible for all $$t$$), or $$s=-\frac{1}{\tau}$$. The latter is the only useful one, so we can write that:
Note: for a first-order system, the values of $$s$$ will be real; for second order equations and above, $$s$$ might include complex numbers and also may have repeated values, both of which complicate things. For real-valued first-order systems, $$s$$ will be a real number, which simplifies things.