In this chapter we are looking at the differential equationsthat govern RC circuits. For a capacitor that is discharging, weknow that going around the circuit the voltage should sum tozero:
Vc + Vr = 0.
Written in terms of charge and current, this is:
q/C = - i R.
Rewritten, q/C = -dq/dt R.
What this is telling us is that the current is being set by thecharge on the capacitor. We can use a numerical approach to modelthis system. We know that dq/dt is a change in charge divided by achange in time:
Δq/Δt or (qf-qi)/Δt, where qi is the initial charge and qf isthe final charge.
Treating q as qi, this allows us to state:
qi/C = -(qf-qi)/Δt.
Solving for qf, we get:
qf = qi – (qi/RC) Δt.
qf = qi (1 – Δt/RC).
In other words, at each small step in time, we subtract off avalue proportional to the current charge.
We can model this behavior in a spreadsheet. We’ll use sometricks to help us out. In the top of the spreadsheet we’ll definefour quantities: Δt, R, C and qi. This gives us details of thecircuit and also the change in time. I put in some sample values,feel free to change them in order to experiment with how circuitswork.
We then set up three columns. The first is a time column, thesecond is qi and the third is qf. Let’s look at first row. Timeinitial is zero, charge initial is set by the variables at the topof the chart and qf is done by formula, it is qi multiplied by(1–Δt/RC). Note that these values use absolute relationships, eg.$B$2, so if the formula gets copied, then it always refers back tothe values at the top of the chart.
The next line down is really the key to the whole affair. Thetime column is the time from the line above, plus the delta t. Theqi is the qf from the previous line, and the qf is calculated fromthe qi on this line. Note that since so many of the entries are inreference to the previous line, we can simply copy this expressionto the line below to now have a three-step process. In fact, we cando this repeatedly (I did it 500 times) to watch how q changes fromstep-to-step in time. I graphed the q(t) behavior, and you can seeit is an exponential, just as predicted by theory.
For this week’s homework, add a battery to this circuit and makea new spreadsheet that corresponds to charging up an emptycapacitor. Your spreadsheet should include the appropriate graph.Note that for things like RC circuits, it is usually simpler tojust solve the differential equation. For more complex problems,scientists and engineers will often use numerical methods ratherthan directly tackle hard math problems.