system
Given the following post, respond as if you're commenting on Reddit:
human
How do capacitors work?

How would they be placed in a circuit and what effect would they have on that circuit? Could anyone also give me a good idea of a circuit that would demonstrate a capacitor? I'm just don't know what this component really does. I know that it stores charge, but that's about the limit of my knowledge on capacitors.

Help please?
gpt
Okay so imagine you have the simplest circuit. Current flows around a simple loop of wire. Now, you cut the wire. The electrons are still in motion, so one end of the cut gets a little bit depleted of electrons, and the other one gets an electron pile-up. But this won't last too long, since the depleted end now has a positive charge, and the pile-up end is negatively charged, the electrons will be pulled in the opposite direction somewhat.

A simple analogy is like a circular pipe of water that's got water flowing around through it. Imagine you were to cut the pipe *and* seal the ends simultaneously. There would be a back pressure at one end, and a low pressure at the other end, causing the flow to slow down and stop. (neglecting some other effects we'll get to in a bit like "ringing")

So what if you wanted the effect to last longer, to take a bit longer before the circuit slowed to a halt, what could you do? Well you could take the ends of each wire and add more and more metal to them, giving the electrons more space to spread out on the pile-up end, and more electrons to draw from on the depletion end. (we'll call the pile-up end the negative plate, and the depletion end the positive plate from now on). And if those plates were closer together, the electrons would "see" the opposite plate more easily and so not feel the effect as strongly (ie, electrons travelling toward the negative plate and being repelled would also be attracted to the positive plate just slightly beyond it, and so the overall repulsion would be relatively less). 

So that describes our basic "parallel plate capacitor:" The amount of charge you can "store" in the capacitor, its 'capacitance' is proportional to the area and inversely proportional to the distance between the plates. C = k A / d (where k is just a constant to show proportionality).

---

Now let's look at the next step. We have these plates of charge, one positive and one negative. The current has stopped. well since we have a potential difference, that's going to drive a current in the opposite direction, no? The electrons on the negative plate are going to be pushed off of it and pulled onto the positive plate. But since they can't cross the gap between the plates (deal with this a bit later) they have to go the opposite way of the current that charged the plates up; they are 'discharging.'

---

So now let's put a little more into it. Clearly if you just pushed the electrons harder, you could push more electrons onto the plate, so we can also make a new equation Q=CV, where the charge Q is given by the structure of the capacitor itself (how it distributes charges) and the Voltage (how strongly charges are being pushed onto the plate).

Furthermore, we'd like to see how these plates change over time, right? Well, the amount of charge being added or removed from the plates is going to relate to how much charge is already on the plates, right? If they're really charged up, there are going to be very few new charges added to them (if we're charging) or a *lot* of charges leaving them (if we're discharging). And if we want something where the rate of change is proportional to the value at that moment, we want an exponential. Some kind of e^t function. 

Well let's consider discharging full plates. They start with some charge Q0 and get rid of a lot quickly. But as time goes on, there's less pressure to push new charges out, so they lose less charge. So if we look at e^t, we see that it goes from 0 at t=-infinity, passes through "1" at t=0 and then climbs high after that. What we'd like to do is flip that graph around the t=0 axis, right? So that it starts with some value and trends toward 0 after very long times. Flipping about that axis takes t to -t. So we can say that Q(t) = Q0 * e^-t . 

Now let's think of charging. Again we know that to start there's no charge, so we want rapid change. But we also want it to level off to some constant value, where the "back-pressure" from the charge on the plates is equal to the "forward-pressure" we're using to charge it with. So we look at our e^t again. Well that won't work since it goes up to infinity, which isn't reality. We try flipping it about the t=0 axis again (e^-t ), since that at least levels off. But this graph is decreasing charge, and we want increasing. So we multiply the whole thing by a -1, giving us -e^-t . Well the charge is increasing from a negative 1 to zero... that's not right either, since it starts at 0 and goes to some steady value. So let's add 1 to it, and we get 1 - e^-t . It starts at 0 and increases to 1 in a way that's proportional to the amount that's on the plate. That's nearly what we're looking for. If we just multiply the whole thing by its steady constant charge (Q0) then we'll have it. Q(t) = Q0 * (1 - e^-t ).