If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Capacitor i-v equation in action

Demonstrates the capacitor i-v equation by deriving the voltage on a capacitor driven by a current source. Written by Willy McAllister.
The capacitor is one of the ideal circuit elements. Let's put a capacitor to work to see the relationship between current and voltage. The two forms of the capacitors's $i$-$v$ equation are:
$i=\text{C}\phantom{\rule{0.167em}{0ex}}\frac{dv}{dt}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}$ $v=\frac{1}{\text{C}}\phantom{\rule{0.167em}{0ex}}{\int }_{\phantom{\rule{0.167em}{0ex}}0}^{\phantom{\rule{0.167em}{0ex}}T}i\phantom{\rule{0.167em}{0ex}}\text{d}t+{v}_{0}$
$\text{C}$ is the capacitance, a physical property of the capacitor.
$\text{C}$ is the scale factor for the relationship between $i$ and $dv/dt$.
$\text{C}$ determines how much $i$ gets generated for a given amount of $dv/dt$.
${v}_{0}$ is the initial voltage across the capacitor, at $t=0$.
In this article we'll work with the integral form of the capacitor equation. Our example circuit is a current source connected to a $1\phantom{\rule{0.167em}{0ex}}\mu \text{F}$ capacitor.

## Voltage before, during, and after the current pulse

Suppose we apply a pulse of current to the $1\phantom{\rule{0.167em}{0ex}}\mu \text{F}$ capacitor for $3$ milliseconds. We'll assume the initial voltage across the capacitor is zero.
$\text{C}=1\phantom{\rule{0.167em}{0ex}}\mu \text{F}$
${v}_{0}=0$
What is the capacitor voltage, $v\left(t\right)$?
We use the integral form of the capacitor equation to solve for $v\left(t\right)$ in three separate chunks: before, during, and after the current pulse.

### Before the pulse

Before the current pulse $\left(t<0\right)$, no current is flowing, so no charge accumulates on $\text{C}$. Therefore, ${v}_{\left(t<0\right)}=0$. We didn't even have to use the equation.

### During the pulse

For any time $T$ during the current pulse $\left(0, charge accumulates on $\text{C}$ and the voltage rises. We can apply the capacitor equation to find out how $v$ changes,
$v\left(T\right)=\frac{1}{\text{C}}\phantom{\rule{0.167em}{0ex}}{\int }_{\phantom{\rule{0.167em}{0ex}}0}^{\phantom{\rule{0.167em}{0ex}}T}i\phantom{\rule{0.167em}{0ex}}\text{d}t+{v}_{0}$
Since $i$ is constant during this time, we can take it outside the integral. We can also ignore ${v}_{0}$, since it's zero.
$v\left(T\right)=\frac{i}{\text{C}}\phantom{\rule{0.167em}{0ex}}{\int }_{\phantom{\rule{0.167em}{0ex}}0}^{\phantom{\rule{0.167em}{0ex}}T}\text{d}t$
$v\left(T\right)=\frac{i}{\text{C}}\phantom{\rule{0.167em}{0ex}}\phantom{\rule{0.167em}{0ex}}t{|}_{\phantom{\rule{0.167em}{0ex}}0}^{\phantom{\rule{0.167em}{0ex}}T}$
$v\left(T\right)=\frac{i}{\text{C}}\phantom{\rule{0.167em}{0ex}}T\phantom{\rule{2em}{0ex}}\text{volts}$
This is the equation of a line with slope $i/\text{C}$, valid any time during the current pulse. The slope is:
$\frac{i}{\text{C}}=\frac{2×{10}^{-3}\phantom{\rule{0.167em}{0ex}}\text{A}}{1×{10}^{-6}\phantom{\rule{0.167em}{0ex}}\text{F}}=2000\phantom{\rule{0.167em}{0ex}}\text{volts/second}$
By the end of the pulse, $T=3\phantom{\rule{0.167em}{0ex}}\text{ms}$, the voltage across the capacitor rises to:
${v}_{\left(T=3\phantom{\rule{0.167em}{0ex}}\text{ms}\right)}=2000\phantom{\rule{0.167em}{0ex}}\text{volts/s}\phantom{\rule{0.167em}{0ex}}\cdot \phantom{\rule{0.167em}{0ex}}0.003\phantom{\rule{0.167em}{0ex}}\text{s}=6\phantom{\rule{0.167em}{0ex}}\text{volts}$

### After the pulse

After the pulse $\left(3\phantom{\rule{0.167em}{0ex}}\text{ms} - The current falls to $0$, so charge stops accumulating on the capacitor. Since no charge is moving, we should expect the voltage not to change. We can confirm this by applying the capacitor equation at starting time $t=3\phantom{\rule{0.167em}{0ex}}\text{ms}$, and starting voltage ${v}_{3\phantom{\rule{0.167em}{0ex}}\text{ms}}=6\phantom{\rule{0.167em}{0ex}}\text{V}$.
$v=\frac{1}{\text{C}}\phantom{\rule{0.167em}{0ex}}{\int }_{\phantom{\rule{0.167em}{0ex}}3\phantom{\rule{0.167em}{0ex}}\text{ms}}^{\phantom{\rule{0.167em}{0ex}}T}0\phantom{\rule{0.167em}{0ex}}\text{d}t+6=6\phantom{\rule{0.167em}{0ex}}\text{volts}$
The current has stopped, so the charge stays put, and the capacitor voltage remains at $6\phantom{\rule{0.167em}{0ex}}\text{V}$.
Assembling the three chunks together gives us $v\left(t\right)$,
Try it yourself. Adjust the size and duration of the current pulse ($\text{green}$ dot).
• How many ways can you achieve an ending voltage of $4\phantom{\rule{0.167em}{0ex}}\text{V}$?
• What happens to $v\left(t\right)$ if the current pulse goes negative?
This circuit configuration (current source driving a capacitor) has a nickname, it is called an integrator.

## Want to join the conversation?

• Would you walk us through the UNITS issues for this example? Specifically, how Amps per Farad becomes volts per second. I keep getting lost somewhere in the middle.
• Here's one path to an answer. I'll start with the basic capacitor equation: q = Cv.
(q = charge, C = capacitance, v = voltage)
Now convert the variables to unit names. The units of q are Coul (Coulombs), units of capacitance are F (farads), v stays volts.
Substitute in the unit names and you get the definition of a farad,
F = Coul/V
Now modify Coul so we can talk about current. Multiply the right side by sec/sec.
F = (Coul/sec) / (V/sec)
Coul/sec is the definition of current, so Coul/sec has units of Amps,
F = A / (V/sec)
Now one last step to rearrange this into the form you asked for,
A/F = V/sec

(By the way, congratulations on 4 million points on Khan Academy. You have possibly learned nearly everything!)
• How could you know what is the current value that the capacitor is charging at(which is represented by i in the equations) when you don't have a current source but rather a voltage source?
• Good question. You have curiosity, a great trait for a learner.

If you replace the current source with a voltage source in the schematic at the top of this article you end up a circuit that does not make much sense. Say the voltage source produces a voltage pulse with very very sharp transitions. The capacitor equation says i = C dv/dt. The sharp transition means dv/dt will be a very large value for a very short time. If the voltage transition is instantaneous the equation predicts a pulse of infinite current in zero time. The reason this simple circuit is troublesome is because no resistor is involved.

When you add a resistor in series with the capacitor you get what is called the Natural Response of an RC circuit. That is covered in great detail in the sequence of videos and articles here,
or try this revised version: https://spinningnumbers.org/a/rc-natural-response-intuition.html

Simulate this circuit by copy/pasting this big fat URL into a browser:
https://spinningnumbers.org/circuit-sandbox/index.html?value=[["r",[224,72,1],{"name":"","r":"0","json":0},["3","1"]],["c",[256,88,0],{"name":"","c":"1u","json":1},["2","0"]],["w",[256,72,256,88]],["g",[200,136,0],{"json":3},["0"]],["w",[256,136,200,136]],["a",[232,72,0],{"color":"magenta","offset":"0","json":5},["3","2"]],["w",[224,72,232,72]],["w",[256,72,248,72]],["w",[200,136,88,136]],["v",[88,88,0],{"name":"Vin","value":"pulse(0,1,0,1n,1n,10m,20m)","json":9},["1","0"]],["w",[176,72,88,72]],["w",[88,72,88,88]],["view",38.928,33.1336,3.0517578125,"50","10","1G",null,"100","0.029","1000"]]

Click on TRAN. The current spikes are huge. Double-click on the resistor and change it to 1000 ohms. Do TRAN again and you are looking at the Natural Response of an RC.
• Can someone please post the answer for the end question? I feel it's kind hard and I wish I can check with the answers...thank you!
• Have you grabbed the green dot in the last plot and dragged it around?
• I thought a capacitor should lose its charge once voltage is taken away.
• When you "take away" the voltage you disconnect the wire to the capacitor, and it leaves behind a capacitor with no physical connection to anything else. Therefore, there is no current path available for charge to move off the capacitor. The charge remains on the capacitor plates, producing a voltage according to q = Cv, or v = q/C.

It's just like a bucket that you fill with water from a hose. Water happens to be able to flow through the air from the hose end into the bucket. (Charge generally does not jump off wires, so it needs a continuous metal path to flow.) If you fill the bucket half way up with water (charge), and then turn off the hose, what happens to the water? Does it "discharge" over time? No it does not, assuming there's no hole in the bucket. A hole would be called a "leakage path".

If you charge up a capacitor and remove the current path the voltage should remain the same forever. If you observe the voltage going down (it won't ever go up), that means there is some kind of electrical leakage path for charge to escape.
• The said the Capacitance they were going to use was one micro farad, but in the calculation 1*10^-6 micro farads was used. Is this a mistake?
• I am confused between t and T. What is difference between both of them, what quantites are specified by them ? Aren't both time itself ?
(1 vote)
• Why would no charges flow after pulse ? Capacitor has voltage of 6 volts, and won't it force electrons to flow around wire ? How can we decide that current is zero. We stopped current from current source, but won't capacitor cause current ?
(1 vote)
• Think of a capacitor as a bucket. It can hold charge, it can let charge flow in, or flow out. If the current pulse goes to a value of zero, that forces the value of current everywhere in the circuit to zero. The charge on the capacitor does not "have to" flow out. It just sits on the cap.

The analogy is filling a bucket with a garden hose. If the hose is on water current flows into the bucket and the water level (voltage) goes up and up. If you shut off the hose what happens? Easy! The water sits in the bucket. All the water is static, it does not flow anywhere because there is no path for water current. It's exactly the same for a capacitor.
• What does the green dot have to do with the graph if it goes negative
(1 vote)
• When you pull the green dot down below the horizontal time axis that means the current source has a negative value, which is equivalent to flipping the arrow on the current source symbol the other way. Charge piles up on the bottom plate of the capacitor instead of the top, and the resulting voltage (the top plate vs the bottom plate) is negative.