# Reasoning behind equations in analysis of electrical circuit

I am currently studying the mathematics textbook Nonlinear Dynamics and Chaos by Strogatz. As part of an example, I am provided with the following electrical circuit and accompanying explanation:

Example 2.2.2: Consider the electrical circuit shown in Figure 2.2.3. A resistor $$\ R \$$ and a capacitor $$\ C \$$ are in series with a battery of constant dc voltage $$\ V_0 \$$. Suppose that the switch is closed at $$\ t = 0 \$$, and that there is no charge on the capacitor initially. Let $$\ Q(t) \$$ denote the charge on the capacitor at time $$\ t \ge 0 \$$. Sketch the graph of $$\ Q(t) \$$.

Solution: This type of circuit problem is probably familiar to you. It is governed by linear equations and can be solved analytically, but we prefer to illustrate the geometric approach.

First we write the circuit equations. As we go around the circuit, the total voltage drop must equal zero; hence $$\ -V_0 + RI + Q/C = 0 \$$, where $$\ I \$$ is the current flowing through the resistor. This current causes charge to accumulate on the capacitor at a rate $$\ \dot{Q} = I \$$. Hence

$$-V_0 + RQ + Q/C = 0$$

or

$$\dot{Q} = f(Q) = \dfrac{V_0}{R} - \dfrac{Q}{RC}.$$

I have started studying electronics, but I'm still learning the basics, and haven't yet learned enough to understand the electronics reasoning for what the author has written. Specifically, I'm wondering about the following:

1. Kirchhoff's voltage law states that the directed sum of the voltages around a circuit equal zero, but what is the reason for the terms of the equation $$\ -V_0 + RI + Q/C = 0 \$$ being structured as they are? Specifically, why is the voltage given a negative sign, why is the resistance multiplied by the current, and why is the charge on the capacitor divided by the capacitance?

2. I understand that $$\ -V_0 + RI + Q/C = 0 \Rightarrow \dot{Q} = f(Q) = \dfrac{V_0}{R} - \dfrac{Q}{RC} \$$ by algebra, but why is this equal to $$\ f(Q) \$$? In other words, why is the rate at which charge accumulates on the capacitor, $$\ \dot{Q} \$$, a function of the charge of the capacitor, $$\ f(Q) \$$?

I would greatly appreciate it if people would please take the time to clarify these points.

• Maybe a book of circuit analysis would be good reading for you. I guess it's useful to have a solid view into elementary engineering practices. Feb 1 '20 at 9:45
• @user287001 Yes. I think the electronics textbook that I'm studying now also covers circuit analysis, but it might be better to have a seperate textbook that purely focuses on circuit analysis. Feb 2 '20 at 13:32

I'm going to try to address the mathematical details of how the equation corresponds to the circuit, rather than talking about the bigger picture of the circuit behavior, in hope of bridging the right gaps of understanding. Note that I may use some nonstandard terminology as I have not formally studied circuit analysis.

Kirchhoff's voltage law states that the directed sum of the voltages around a circuit equal zero, but what is the reason for the terms of the equation $$\ -V_0 + RI + Q/C = 0 \$$ being structured as they are? Specifically, why is the voltage given a negative sign, …

Mathematically, in order to have a sum to zero, then some terms must be positive and some terms must be negative (or degenerately, they must be all zero). It doesn't actually matter whether you put minus signs in the equation, or make the variables or constants have negative values; either will work, but there will always end up being negative numbers somewhere. You should arrange them however makes the numbers you end up with convenient to work with, which usually means, for example, choosing to have $$\V_0\$$, $$\R\$$, and $$\I\$$ be positive numbers.

But, of course, if we arbitrarily choose the signs of the terms we will not necessarily get the right answer; not all circuits are as simple as this one where any given choice of signs will give you either a correct answer or a physically impossible one.

In this case, we seem to be using the sign convention that if, as we proceed around the loop in the direction of the current arrow (which, note, does not in general indicate the actual direction of the current, but indicates the direction of current which corresponds to positive values of the current variable $$\I\$$) the voltage increases (in the typical case for that component), then the term is negative, and correspondingly if the voltage decreases then the term is positive.

Now, let's consider where those specific terms come from.

why is the resistance multiplied by the current

The ideal behavior of a resistor is described by Ohm's law, $$\V = IR\$$. The $$\V\$$ in this equation is the voltage across the resistor, so we can just drop that right into our voltage sum.

why is the charge on the capacitor divided by the capacitance

In the same way as Ohm's law describes ideal resistors,

$$C = \frac{Q}{V}$$

describes ideal capacitors (without having a historic scientist's name attached to it). The theory says that a capacitor will have a linear relationship between the charge on it and the voltage across it, and the constant of proportionality is known as capacitance, $$\C\$$. So, if we want to know the voltage, we solve for $$\V\$$ and get $$\Q/C\$$.

Physically, this occurs because the accumulation of charge opposes the further accumulation of charge, by means of an electric field concentration which, from a circuit analysis perspective, is just another voltage difference.

(Note that if the initial condition is $$\Q = 0\$$ then it doesn't matter which sign we give to the capacitor's term — changing the sign corresponds to reversing the capacitor in the circuit which, since it's symmetric, doesn't change anything.)

Finally, an ideal voltage source is a component that has a fixed voltage across it, so its term in the equation is just $$\V_0\$$, the fixed voltage. (It is negated because of the choice of signs versus current direction I mentioned earlier.) That gives us all three terms of our sum of voltages.

why is the rate at which charge accumulates on the capacitor, $$\ \dot{Q} \$$, a function of the charge of the capacitor, $$\ f(Q) \$$?

There's a fact/equation they didn't mention explicitly: Current is the flow of charge. As one might expect for a flow of substance, current $$\I\$$ flowing for time $$\t\$$ moves an amount of charge $$\Q = It\$$; or in full generality for a time-varying current,

$$Q = \int I(t) \,dt$$

When you have a current flowing through a capacitor, the charge on the capacitor is exactly this integral, because, physically, the individual charges cannot pass through the capacitor, instead causing a surplus and deficit of charges on the two capacitor plates (which is what the variable $$\Q\$$ for a capacitor refers to).

Now, getting back to the equation: if $$\Q = \int I(t) dt \$$ then also $$\\dot{Q} = \frac{dQ}{dt} = I(t), \$$ and if we substitute that in place of $$\I\$$ in our circuit equation $$\ -V_0 + RI + Q/C = 0 \$$ we get

$$-V_0 + R\dot{Q} + \frac{Q}{C} = 0$$

Solve this for $$\ \dot{Q} \$$ and you get the last step written in your quote,

$$\dot{Q} = \frac{V_0}{R} - \frac{Q}{RC}.$$

Then solve this differential equation to obtain a formula for $$\Q(t)\$$ and you've completed the problem.

1) Supply voltage V0 must match to voltage over resistor and capacitor to complete the loop. Since Ohm's law says R=U/I, then it can be rearranged to U=RI which is the voltage over resistor. Charge of capacitor is Q=CU, so rearranged, voltage U=Q/C. Thus, applied supply voltage minus resistor voltage minus capacitor voltage must be zero at all times. Rearrange the terms to get same signs. Sometimes when making a book, you have to select a notation and stick to it, even if there seems to be little sense.

2) As capacitor charges, the voltage over it increases, thus there will be less voltage over the resistor, and less current through the resistor. So the more there is voltage over capacitor (i.e. charge in it), it charges with less current, so voltage changes slower (it charges slower).

You already have an excellent answer, but maybe a little more information would be of interest. The RC low pass filter has one energy storage element (the capacitor) and one dissipative pathway (the resistor). Before the switch is closed, the input is zero volts and the cap is assumed to have no stored charge, so its voltage is zero. At t = 0, the switch closes and the input voltage jumps to some $$\ V_0 \$$ volts. So this system is governed by a first order ordinary differential equation with initial condition.

All systems with a single energy storage element, a single dissipative pathway and an initial condition are governed by the same differential equation. So this applies to many systems, e.g. a cup of hot coffee cooling down (Newton's law of cooling); first order radioactive decay; fluorescence decay of an excited atom and on and on. It is all over the place.

Here is my figure showing the differential equation and its solution, assuming a unit step function input at t = 0 s:

Also shown in the figure is my numerical simulation model (using Extend), with RC = 2 s and $$\ V_0 \$$ = 1 V. Everything works exactly as @Justme says in his answer.

1. It helps to label the voltage of the resistor. When current flows, in this case from left to right, the left side of the resistor is the + voltage, and the right side the -. It's the opposite of the voltage source.

2. Consider the steady-state voltage on the capacitor. What will it be? Will there be current flowing in that case? Is there a point when charge stops accumulating (think of this in both the approximate and exact sense, as they lead to two different answers).