# Help with capacitor basics? (the math part) [ANSWERED. Come here for the proof if you want it!] Answered

I understand the operation for capacitors, which make a lot of intuitive sense to me, and seems deceptively simple. I know that the derivative  of the voltage across a capacitor (the slew rate, if you will) is proportional to the current, for a given capacitance. So when the voltage is not changing much, like when it is connected across power supply rails, and the capacitor has little-to-no current flowing through it, and it appears as a high impedance. Fair enough. And when I am winding up the wick on the constant-voltage power supply, so that the slew rate is constant, and the voltage is changing at a constant rate, the current will be relative to how fast that voltage rising/falling. Again, that makes sense. I have proven that to myself time and time again.

The technical math way of showing all that is this:

dV/dT * C = I

or with units plugged in:

d(volts)/d(seconds) * Farads = Amps (or something like that)

Likewise, I know that I can do things in reverse, and that forcing a controlled current through the capacitor, that the slew rate of the voltage across the capacitor will be proportional to that. In other words; the voltage will be integrated over time (as it steadily rises or falls). I do not like integrals in math (esp. when they require by parts or partial fractions!), but the concepts do come in handy in practical design! This is also my 2nd favorite way of imagining what an integral are! (My favorite is actually the water cup or well analogy, where a water faucet or hose is a function, and a the level of water in the cup, pool, well, etc. is the integrated result. That makes the function of integrals really clear and deceptively easy LOL!)

So, I basicly have been trying to figure out how to take these simple, easy-to-understand relationships, and take ohms law, and have a super basic RC circuit, with 5V, 5 ohms, and 0.1F. I have so far figured out how to take ohms law, substitute I in the capacitor formula, and get a function. HOWEVER, this is where I get stuck.

--------------------------------------------------------------------------------------------------------

Here is the circuit:

+5V---(V2)-----/\/\/\/\/\/----(V1)-----| |-------0v----(grd)

So after having a bit of a think, I have figured out that I really need to account for 2 different V's. The 5V power supply, V2, and the voltage across the capacitor, V2. I know that the current flowing through everything in a series circuit is the same, so then I can easily figure out current by calculating the voltage drop across the resistor which is this:

I = (V2 - V1) / R

So now, lets plug that into the mysterious capacitor derivative thingy: (All I did was substitute the I in the capacitor formula with the that ohms law formula above.)

dV(1)/dT * C = (V(2) - V(1) ) / R.

--------------------------------------------------

Now, I just plug in the values, and simplify as much as I can, to make it more friendly to my eyes. C = 0.1F, and R = 5 in my case, since I am using a 5 ohm resistor, 100mF capacitor, and I know V2 = 5V, since that is the output of a 7805 voltage reg.

d(V(1))/dT * 0.1F = (5V - V(1) ) / 5ohms.

That dV/dT is a bit hard to look at, so I will use V prime, or V' to represent that instead:

V(1)' * 0.1 = (5 - V(1)) / 5

I do not know how to simplify that further though, to end up with that weird inverse exponential curve that is the time constant thingy, with that decaying charging curve. I have V on one side, and V' on the other side. :( So this is how far I got:

5 + (1/2 * V(1)') = V(1)

EDIT: I HAVE ADDED THE PROOF HERE IF YOU WANT IT

Tags:

## Discussions

I think what you are describing is essentially the same problem as in the Wikipedia article titled "RC Circuit", in the section labeled natural response, here:

http://en.wikipedia.org/wiki/RC_circuit#Natural_re...

Although when you look at that, you're probably going to wonder how the author went from:

C*(dV/dt) + V/R = 0 (equation 1)

to

V = V0*exp(-t/R*C) (equation 2)

in one step. Right? I mean how does that work?

Well, the I think the answer to this question is for differential equations of this form, you can guess at the form of the solution: V(t) = something. Then substitute your guess back into the original differential equation to see if it satisfies it.

For example, I guess V(t) will have the form V(t) = a*exp(b*t)

Starting with this form, I don't actually know what a and b are. So a and b are unknowns, but I'm hopeful they'll be determined by the original diffy eq, and maybe some initial conditions.

I take the first derivative of my guess solution, and get dV/dt = b*a*exp(b*t)

If I substitute those into equation 1, I get:

C*b*a*exp(b*t) + (1/R)*a*exp(b*t) = 0

Then divide both sides by a*exp(b*t) to get"

C*b +(1/R) = 0, which looks good, provided: b = -1/(R*C)

So the guess worked, and I found a value for b. I still want a value for a. To get that I use the following boundary condition, erm initial condition.

I say the voltage on the capacitor at time t=0 is known, and I call it V0.

V(t=0) = V0

So V(t=0) = V0 = a*exp(b*t) = a*exp(b*0) = a*exp(0) = a*1

So, a = V0 . So now the guess equation has all its parameters solved, and I can just substitute the solved a and b into the guess equation,

V(t) = a*exp(b*t) = V0*exp(-t/R*C)

Which is what I was trying to prove.

By the way, I think for this class of differential equation, a function equal to some linear combination of its derivatives, like

y(t) = a1*y'(t) + a2*y''(t) + a3*y'''(t) + ... +an*yn(t)

(where {a1,a2,a3,...an} are all constants, and {y'(t),y''(t),y'''(t) ... yn(t) are the 1st, 2nd, 3rd, ... nth derivatives with respect to t)

there was some sort of existence and uniqueness theorem. That is to say the diffy eq was somehow guaranteed to have just one solution. So if you found one solution that works, then you found them all.

Also BTW, if you are building a real thing with a discharging capacitor, depending on what it is, it might be more accurate to model it as a RLC circuit.

http://en.wikipedia.org/wiki/RLC_circuit

The just plain RC circuit has some funny properties. Specifically the current through the resistor changes instantaneously from 0 to V0/R, at t=0, when the switch closes, so that dI/dt is infinite at t=0. The RLC circuit doesn't have that problem, as long as L is greater than 0.

Thanks for the in-depth explanation! Although I have figured it out today in math class when asking the math prof. to show me what she did, then it made sense, and it was actually really simple! And more intuitive, too, every step make made sense (w/ some understanding in differential functions, of course).

The first step would be to get all the V's over to one side, all the rest of the stuff to the other side, and move the dT to the other side, splitting apart the derivative thing so that it is a differential function.

---

Then just integrate both sides w/ respect to the D(whatever) on both sides

---

Then do some U-sub, and the theorem int(1/x)=ln|x|

---

Knowing some basic log properties, and taking everything to the power of 'e,' to cancel out the ln on the one side, and "move" it to the other side, and simplifying more, the final correct result is achieved!!! :D :D :D

[There should be a pdf file uploaded to show the work. I am not even going to bother trying to type all that calculus into ASCII characters here!]

Oh right. The integrate-both-sides trick.

I don't know if you're going to want to know this or not, but when you take the integral of both sides, you get a arbitrary constant, e.g. a plus K, where K=constant.

Then when you take the exponential of both sides, you get a factor of exp(K).

integral((dV2)/(V1-V2)) = integral((dt)/(R*C))

-1*integral((dV2)/(V2-V1)) = integral((dt)/(R*C))

-1*ln(abs(V2-V1)) + K = t/(R*C)

ln(abs(V2-V1)) = K - t/(R*C)

exp(ln(abs(V2-V1))) = exp(K - t/(RC*)) = exp(K)*exp(-t/(RC*)*

(V2-V1) = exp(K)*exp(-t/(RC*)

But then that's no big deal, because you probably wanted a constant factor there. exp(K) is just the initial value of V2-V1; i.e exp(K) = (V2(t=0) - V1)

Shouldn't the +K be on both sides, since both sides are indefinite integrals?

I guess it literally comes from the initial voltage on the capacitor, since obviously that would make a difference? I just noticed that that is not shown in the final answer. I can see where is would come from if I did a definite int with K and X as by lower and upper bounderies.

There were two arbitrary constants, one for each integral, but I just combined them together. The difference of two arbitrary constants is just some other arbitrary constant. K = Kleft - Kright

-1*ln(abs(V2-V1)) + Kleft = t/(R*C) + Kright

ln(abs(V2-V1)) = K - t/(R*C) where K=Kleft-Kright

By the way, I found another calculus-based treatment of the RC circuit in my old physics book. (Giancoli, Douglas C. Physics for Scientists and Engineers with Modern Physics. 2nd Ed. (c) 1989. Prentice Hall.) This author also uses the integrate-both-sides trick, to solve a 1st order differential equation. A picture of this is attached.

Actually, reading that was probably what prompted my choice of the letter K for the arbitrary constant. I mean the usual choice of C, or C1, etc, would be confusing here since C is capacitance here.

I was also going to mention, in this same book, for problems involving a second order diff eq, the author uses the guess-the-solution-has-a-certain-form, like y(t)= A*sin(k*x)+B*cos(k*x). Then magically that gues-solution satisfies the diff eq, but there's still some work to do finding the parameters A,B, and k.

Thats what I thought. However, what that final formula seems to say, roughly, is that the derivative of voltage is proportional to voltage. I suppose that sost of makes sense, thinking about the relationship of the slope of the charge/discharge curve of the capacitor and the voltage across it, however, I cannot for the life of me figure out how to solve it further.

Do I just take the integral of both sides? If I do that, I end up with this:

5T+(1/2*V)=intergal(V)dT.

Then what? That is just even more difficult to wrap my head around.