How much energy is stored in the capacitor after 18us?

I have the following problem:

Consider the circuit below

The graph shows the current through a $$\50 uF\$$ capacitor. The initial voltage across the capacitor is $$\V_0=10V\$$.

How much energy is stored in the capacitor at 18 us?

Okay, so I tried to solve this problem with LT-spice, but I run into a problem.

I simulated the current with Lt-spice and set the initial voltage across the capacitor to 10V.

I then ran a transient analysis on the circuit and got the following two graphs.

The first graph shows me the current and voltage through and over the capacitor. The second graph shows me the power of the capacitor.

From the first graph, I see that the voltage across the capacitor is 10.546V at 18us. From there, I thought to use this formula, to calculate the energy of the capacitor:

$$\E=\frac{1}{2} \cdot C \cdot v^2=\frac{1}{2} \cdot 50uF \cdot (10.546V)^2= 2.78 mJ\$$

However, from the second graph (the power graph) I see that the integral of the power function is $$\E=0.280 mJ\$$.

So which answer is right? I hope someone can help me figure this out.

• I don't think you are supposed to use a simulator for this question. Do you know how current, $I$, and charge, $Q$, are related? Do you know how the capacitor energy is related to the charge? Mar 10, 2020 at 13:27
– JRE
Mar 10, 2020 at 13:32
• Sorry, I will edit. The correct number is 50 microfarads. Yeah, charge and energy in a capacitor are related by the formula: E = 1/2*Q^2/C, right?
– Carl
Mar 10, 2020 at 13:34
• @Carl, Yes, that's the energy formula. Now you just need to calculate $Q$ from the graph of $I(t)$. Mar 10, 2020 at 13:40
• Just a minor helper: for PWL souces, when you need to simulate small timesteps, similar to what you have (5u, .., 5.000001u), it's useful to know that you can add time points relative to the previous ones, like this: 5u ... +1n ..., which makes for less typing and cluttering. Mar 11, 2020 at 15:43

Your cap is precharged. Your integral isn't taking that initial energy into account.

Use 0.5CV^2 to calculate the initial energy and you get 2.5mJ, then add that to your integral which is the change in energy. You get exactly 2.78mJ which is what you get when you apply 0.5CV^2 to the last point in your graph.

• Agree with DJNguyen. The energy stored in the capacitor only requires knowledge of the voltage and capacitance. Don’t care about previous history. Mar 10, 2020 at 15:42
• So, the correct answer is 2.78 mJ?
– Carl
Mar 10, 2020 at 15:43
• @Carl It depends whether the question is asking how much energy is in the cap by the end or how much energy has been added to the cap. 2.78mJ for the first, 0.278mJ for the second. Mar 10, 2020 at 15:45
• It specifically asks for how much energy is STORED at 18us. So I suppose that means that 2.78mJ is correct.
– Carl
Mar 10, 2020 at 15:50
• @carl it says "after" not "at" which is why it is unclear to me what it wants Mar 10, 2020 at 15:52

Current is charge per unit time: $$\ I = \frac Q t \$$.

Charge is current by time: $$\ Q = It \$$.

• For 0 to 5 μs: Q = 2 × (5 - 0).
• For 5 to 7 μs: Q = 0.4 × (7 - 5).

You should be able to work out the rest. Add them up and you've got the total charge passed into the capacitor. From that you can work out the voltage and the energy.

• Why doesn't his VI integral work though? I did something similar the other day on a DAQ and the numbers matched 0.5CV^2. Mar 10, 2020 at 13:52
• Oh, he has an initial voltage Mar 10, 2020 at 13:54
• Q = 2A*5us + 0.4A*2us + 3A*6us +-0.5A*3us = 1.4395 *10^-5 C. The energy is then: $E = 1/2 \cdot Q \cdot V^2 = 1/2 \cdot 1.4395 \cdot 10^-5 \cdot (10.546V)^2?=0.0015 J$. Is this the correct answer then?
– Carl
Mar 10, 2020 at 15:37

Your calculation does not account for the initial condition. Try the following:

$$E=C\cdot\frac{V_2^2-V_1^2}{2} = 50\mu F \cdot\frac{10.546V^2-10V^2}{2} = 280\mu J$$

The standard equation for the voltage across a capacitor (as a function of the current through the capacitor) is an integral equation. If the current is constant, as it is in each of the chart segments, the equation reduces to a simple algebraic equation that relates voltage, current, capacitance, and time. Since all initial conditions are known, you can step through each chart segment as constant-current charges and discharges.