# Kirchoff's law for RC circuit

1. Apr 1, 2012

### jd12345

I cant figure out the differential equation made in RC circuits
During charging E = iR + q/C .......I understand this

During discharging my book says that since E = 0 , iR + q/C = 0 and by using i = dq/dt it solves the equation
But using kirchoff's law i end up with the equation q/C - iR = 0. I searched a bit and some books have used the equation q/C - iR = 0( that i came up with) but then they substitute i as - dq/dt.

Which is the correct differential equation and if we substitue i as - dq/dt we should substitute it as negative dq/dt in both the cases. Why in one case we susbsitute as positive dq/dt and in other negative dq/dt???

2. Apr 1, 2012

### K^2

It depends on which direction you chose for +I, which is kind of arbitrary. But if you want +I direction to correspond to conventional current flowing from +q plate to -q plate, then you get dq/dt=-I and q/C-IR=0.

3. Apr 1, 2012

### jd12345

but still if we take I = - dq/dt we should substitute i dq/dt in the 1st equation as well( i.e. in q/C + iR = 0)
Sorry if you told me already.
Could you explain me how to make the differential equation in RC circuits -

4. Apr 1, 2012

### K^2

For ANY junction, you have dq/dt = Ʃ Iin - Ʃ Iout. Normally, you want that to be 0, because you don't want charge buildup at junctions. Capacitor is notable exception. You can think of its plates as two junctions, one at +q, the other at -q. Because they are close together, capacitor overall is neutral, which lets you get away with non-zero charge on the plates, unlike any other junction.

For a general circuit, you will build a system of differential equation with one equation for each loop and for each junction. You might not need all of them, as I'm going to demonstrate in a moment.

You should probably start with the loops. For each loop, you need to pick a direction. The choice is arbitrary, but if possible, having wire segments common to several loops have same direction helps. For this circuit, I would pick loop that starts from +ve terminal of capacitor, runs through resistor, and returns to -ve terminal, so that the direction of the loop agrees with direction of conventional current. Again, it doesn't matter, so long as you are consistent.

The loop passes through two elements that will affect electric potential, capacitor and resistor. For capacitor, you pick up +q/C when loop runs from -q plate to +q plate. If it runs from +q to -q, you'll pick up -q/C. For resistor, you pick up -IR if loop agrees with direction you chose to measure I, and +IR if loop runs in opposite direction.

For choice of direction to measure I, think of it as hooking up ammeter. You can hook it up one way and get positive current, or switch leads, and you get negative current. Which direction to call +I and which -I is arbitrary. You usually want that positive current from + to - terminal, but it's not always possible, for example, if you have AC or an LC circuit involved.

So assuming you chose the loop to run from + to -, and you chose to measure I along the loop, the loop picks up +q/C and -IR. So your first equation is q/C-IR.

Now you go to junction rules. You have two of them. One is for +q plate, and only has Iout, and the other has -q and only Iin. So equation for +ve plate reads d(+q)/dt=-I, second d(-q)/dt=I. These are exactly the same, but with minus sign in different places. So all you get out of this is dq/dt=-I.

So now you have a system of equations: {dq/dt=-I, q/C-IR=0}. This one's easy to solve by substitution. dq/dt=-q/RC, q=q0e^(-t/RC) and I=(q0/RC)e^(-t/RC).

Now, suppose that you decided to make a different choice. Suppose, you decided to measure positive current from -ve plate to +ve plate. In that case, your +ve terminal only has the Iin, and its equation is dq/dt=I. Furthermore, direction of your loop doesn't agree with direction chosen to measure current, so instead of picking up -IR, you pick up +IR on resistor. Your loop equation is now q/C+IR=0.

What does that give you? Well, you get exactly the same solution for q, q=q0e^(-t/RC), but for I you get I=-(q0/RC)e^(-t/RC).

What does that mean? You either get positive current from + to -, or negative current from - to +. That's exactly the same thing.

So the choice of convention will not change the result. It only changes how that result is represented in your numbers. Obviously, when you have multiple junctions and multiple elements, it's easy to get confused, so you should be particularly systematic when working with these rules, and try to pick consistent directions for currents and loops.

5. Apr 1, 2012

Thank you!