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.

Main content

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=Cdvdt v=1C0Tidt+v0
C is the capacitance, a physical property of the capacitor.
C is the scale factor for the relationship between i and dv/dt.
C determines how much i gets generated for a given amount of dv/dt.
v0 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μF capacitor.

Voltage before, during, and after the current pulse

Suppose we apply a 2 mA pulse of current to the 1μF capacitor for 3 milliseconds. We'll assume the initial voltage across the capacitor is zero.
i(t)={2 mA;  0<t<3ms0;  at other times
C=1μF
v0=0
What is the capacitor voltage, v(t)?
We use the integral form of the capacitor equation to solve for v(t) in three separate chunks: before, during, and after the current pulse.

Before the pulse

Before the current pulse (t<0), no current is flowing, so no charge accumulates on C. Therefore, v(t<0)=0. We didn't even have to use the equation.

During the pulse

For any time T during the current pulse (0<t<3ms), charge accumulates on C and the voltage rises. We can apply the capacitor equation to find out how v changes,
v(T)=1C0Tidt+v0
Since i is constant during this time, we can take it outside the integral. We can also ignore v0, since it's zero.
v(T)=iC0Tdt
v(T)=iCt|0T
v(T)=iCTvolts
This is the equation of a line with slope i/C, valid any time during the current pulse. The slope is:
iC=2×103A1×106F=2000volts/second
By the end of the pulse, T=3ms, the voltage across the capacitor rises to:
v(T=3ms)=2000volts/s0.003s=6volts

After the pulse

After the pulse (3ms<t) - 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=3ms, and starting voltage v3ms=6V.
v=1C3msT0dt+6=6volts
The current has stopped, so the charge stays put, and the capacitor voltage remains at 6V.
Assembling the three chunks together gives us v(t),
Try it yourself. Adjust the size and duration of the current pulse (green dot).
  • How many ways can you achieve an ending voltage of 4V?
  • What happens to v(t) 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?

  • primosaur ultimate style avatar for user Tim Miner
    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.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam orange style avatar for user Willy McAllister
      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!)
      (13 votes)
  • mr pink red style avatar for user dindibo4
    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?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam orange style avatar for user Willy McAllister
      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,
      https://www.khanacademy.org/science/electrical-engineering/ee-circuit-analysis-topic/ee-natural-and-forced-response/v/ee-rc-natural-response-intuition
      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.
      (4 votes)
  • leaf green style avatar for user Jack Wu
    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!
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user onno.twisk
    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?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user jason.crosby2012
    I thought a capacitor should lose its charge once voltage is taken away.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • old spice man green style avatar for user Willy McAllister
      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.
      (2 votes)
  • mr pink red style avatar for user manavpandya31
    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)
    Default Khan Academy avatar avatar for user
  • mr pink red style avatar for user manavpandya31
    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)
    Default Khan Academy avatar avatar for user
    • spunky sam orange style avatar for user Willy McAllister
      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.
      (3 votes)
  • starky ultimate style avatar for user Alejandro Dlv
    Isn't it i=C​dv/dt because the it says di instead of dv
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops tree style avatar for user jonaskorkosh
    Voltage before the pulse:
    "Before the current pulse (t < 0), no current is flowing, so no charge accumulates on C. Therefore, v_(t<0) = 0. We didn't even have to use the equation."

    Isn't this wrong? Wouldn't the fact that no current is flowing just mean the voltage is constant and not necessarily zero? Wouldn't it be more correct to say that we assume that v_0 = 0, and calculate v(T) relative to v_0?

    C*(dv/dt) = i
    C*(dv/dt) = 0

    For i to be equal to zero, then (dv/dt) must be equal to zero, thus the voltage must be constant, but not necessarily zero?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops seed style avatar for user Galen Trostle
    If we have a pulse that is something other than zero after a certain time, how do we represent that in the limits of the integral? That is, suppose you had a pulse that was 20mA for 1 ms, then -20mA for the next 1ms. We can find the voltage between 0 and 1 ms by integrating from 0 to t, what would we put for the limits when finding the voltage between 1 and 2 ms?
    (1 vote)
    Default Khan Academy avatar avatar for user