In this post we'll go through a very useful technique for solving linear differential equations: the differential operator method. Though the name is a bit of a mouthful (if you've seen a better one please let me know!), the underlying principle is about using intuition and techniques from polynomials to solve linear differential equations. I'll be applying this to equations that arise in RC circuits, but won't assume any knowledge of electronics.
Most examples on the internet use the differential operator method to find exact solutions. However, in physics we are almost always interested in approximations. Exact solutions do not exist for a general differential equation. Moreover, a simple approximation can help us understand the behaviour of a circuit better than a complicated exact expression.
In this post we will look at two different circuits, with equations:
In the above is the input voltage, are the output voltages that we measure, and the resistance and capacitance of the circuit. Using the operator method we will be able to derive the approximate solutions:
By making sufficiently small in the first circuit, and large in the second, we can consider only the first term on the right hand sides. These circuits can be used as integrators or differentiators — no computer required! As we discuss at the end, circuits like this can be much faster (and definitely smaller & cheaper) than a computer, so are very useful for applications such as feedback control.
Our coverage of the operator method will be brief, and focused on solving the two equations above. More details on the method can be found in [C18]. I also won't go into the details of electrical circuits, and what a resistor and capacitor are. I tried to write the post so that you can just follow the maths regardless. If you can't, please let me know what I've missed or what doesn't make sense! For a detailed introduction to RC circuits you can check out [HH15,§1.12-15]
The differential operator method #
Let's begin by introducing the operator , which is just an abbreviation of the derivative with respect to :
We then have
Higher order derivatives are represented by powers of :
where in the last line is any variable.
We can also add, subtract, and multiply just as if it were a variable:
Here comes the fun part. Suppose you want to solve the differential equation:
where is a constant, is known, and is the function you want to find. Writing the derivative as an operator, we can just solve for :
We are dividing by the derivative! In fact, we will go one step further, and use the Taylor series
Setting , we obtain the solution as an infinite sum:
If is a small number (i.e. ), then is much smaller (), and will be so small as to be negligible. This gives us an approximate solution:
If is not small you have a couple of options.
- You might be able to explicitly compute the sum if is 'nice' (see the appendix for an example).
- By thinking about the problem a bit more you can often get a solution without having to compute the sum, see [C18].
A natural question to ask is how we should interpret ? Since
then must 'cancel out' the derivative . This is the integral:
There are a couple of points we should discuss before we move on. Firstly, I mentioned that the derivative operator method is useful for equations that are linear in . That is:
- There are no derivatives of multiplied together, such as or .
- You don't have or a derivative multiplied by time: .
The solution method relies on pulling out all the derivatives, so that you can write the equation as multiplied by a polynomial of . Try and convince yourself that this isn't possible if the equation isn't linear.
Secondly, we have played fast and loose with mathematical rigour. If you thought treating the derivative as a fraction was bad, what about Taylor expanding ? It is right to be concerned about these things, since asking such questions makes you more aware of the limits of the techniques you are using. I won't dive deep into the rigor here, but do justify our expansions somewhat in the appendix. For more details see [C18].
RC differentiator #
Let's consider the electric circuit formed by connecting a time-dependent voltage source to a capacitor and resistor in series:
In the appendix we show that the voltage across the resistor has differential equation
where and are the resistance and capacitance respectively (if you are unfamiliar with electronics feel free to skip the derivation). Suppose the resistor and capacitor have been chosen so that the the product is 'small' — see the appendix for a discussion on exactly what 'small' means. In that case we will abbreviate
and re-write the differential equation in operator notation:
We can solve this using the Taylor series as before:
This sum will go on forever. However since is small, we can get a good approximation from just the first couple of terms. The biggest contribution will be
Thus voltage across the resistor will approximately equal the derivative of the input voltage. The second term in the sum gives us a correction , which will be negligible if is small enough.
RC integrator #
The same circuit can also be used to construct an integrator. All of the methods are the same as the last part, so I encourage you to try and work through this on your own. This time we measure the voltage drop across the capacitor:
In the appendix we show that this has equation
This time we will suppose that is large, so let's set
Re-writing in terms of differential operators, we derive
We want to apply the Taylor expansion [eqTaylorExpansion], which requires the denominator of the fraction to be for small . We thus re-write this as
The largest term will then be
so this circuit computes the integral. The next largest term will be the double integral:
That looks very fancy! But it was quite straightforward to derive using the operator method.
I hope this post has convinced you of the power of the differential operator method. Using just a bit of algebra and a Taylor expansion, we solved some quite complicated-looking differential equations. Moreover these weren't artificial textbook problems, they describe the behaviour of real circuits. We've only just scratched the surface here, and I recommend searching the internet or checking out [C18] for more details.
The circuits we analysed are examples of analog computers. Analog computation is a fascinating subject, and I recommend checking out this Veritasium video to see what we were capable of before the modern digital age. Did you know Lord Kelvin devised a machine that could do the Fourier transform, and so accurately predict the tides, in 1872? It's descendants were still being used up until the 1960s!
Even today, analog circuits are very useful. For simple applications they will always be much smaller and cheaper than a computer. Moreover, computers are digital, working with lists of ones and zeros. In a laboratory however most signals are analog, for example a sensor which produces a voltage proportional to the height of a levitated particle. If we want to differentiate this signal to find the velocity, we would first have to convert the continuous voltage (2.17V) to a binary sequence (1010111). Then if we want to apply feedback to the particle proportional to its velocity, we would have to convert the digital list of ones and zeros back to a voltage to send to our apparatus. The conversion process takes tens of microseconds, which is too slow for many applications. Thus for realtime feedback control, an electronic circuit which takes a time-varying voltage and returns the derivative of that voltage can be much more useful than a computer.
Have any comments or questions? Let me know! Follow @ruvi_l on twitter for more posts like this, or join the discussion on Reddit:
You can also feel free to send me an email.
Solving a differential equation #
Suppose we wish to solve the differential equation
We showed above that this can be written as
Only three terms in the sum will be nonzero, since is zero when is greater than or equal to three. These terms are:
Adding them together then gives the solution
Differentiator circuit equation #
Suppose we start at the ground on the left, and follow the circuit until we reach the ground on the right. The voltage starts at zero, is increased by the battery to , then falls by across the capacitor and across the resistor. Since the overall change in voltage over this path is zero — we begin and end at ground voltage — we have
A capacitor consists of two metal plates facing each other. When a voltage is applied, charges and build up on the plates in proportion
where is a constant called the capaciatance of the capacitor. Differentiating both sides of this with respect to time, and noting that current is the deriative of charge, gives
The current flowing through the capacitor must be the same as the current flowing through the resistor (since there is nowhere else for current to go). Ohm's law then gives
This is a differential equation for the unknown across the resistor, in terms of the applied signal .
Integrator circuit equation #
As before we start at the ground on the left, and move through the circuit to the ground on the right:
Across the capacitor we have
Substituting in Ohm's law then gives a differential equation for the voltage across the capacitor:
Note that here we have written the equation in terms of . This is because the circuit behaves as an integrator when is large, so will be our small .
The meaning of a big or small RC #
The product has units of time, so its value will change depending on if we measure time in seconds, years, or nanoseconds. Choosing different units can't change the behaviour of our circuit! Therefore whenever you talk about the size of a quantity with units, what you really mean is that it is big or small compared to another quantity with the same units. So what is that other quantity?
Let's look at the differentiator first. We derived our approximation by Taylor expanding , so what we really want is to be small. Note that the derivative has units of inverse time, so the product is unitless. What we are saying then, is that , multiplied by the derivative of , must be small. Noticeable changes in the input signal must take longer than a time to occur. If is changing very quickly, we will need a much lower resistance and capacitance for the circuit to work.
Now let's consider the integrator. In this case the Taylor expansion requires to be small, so is large. In other words, our input signal must be changing relatively quickly, when compared to the time . If our input signal changes very slowly, we will need to use a higher resistor or stronger capacitor to integrate the signal.
[C18] Chen, W. (2018). Differential Operator Method of Finding A Particular Solution to An Ordinary Nonhomogeneous Linear Differential Equation with Constant Coefficients arXiv:1802.09343.
[HH15] Horowitz, P. & Hill, W. (2015). The Art of Electronics (3rd edition). Cambridge: Cambridge University Press.