Apologies in advance for the long question, but I've hit a dead end trying to work through an interesting capacitor sizing problem. I'm hoping someone here can help.

Problem Description

I have a variable current load consisting of several DC motors going through a pre-set run sequence. For the time period of interest, I have the load's current draw over time. This was calculated using the motors' torque requirements for this application, and it consists of many individual points separated at regular intervals across the sample period. This data shows that as you may expect, there are high-current spikes in the load current. I want to calculate the minimum capacitor size \$C\$ so that the capacitor voltage \$v_c(t)\$ never drops below 90% of the supply voltage \$V_s\$, assuming that \$v_c(0)=V_s\$. Below is a simplified diagram of the problem.



simulate this circuit – Schematic created using CircuitLab

Known Values

  • \$V_s\$ and \$R_s\$ are known
  • Time of highest current spike \$t_{peak}\$ is known
  • \$i_{load}(t)\$ is known at a sampling interval from \$t=0\$ to a point beyond \$t=t_{peak}\$
  • \$v_c(t)\$ is known for two values of \$t\$:
    • \$v_c(0) = V_s\$
    • \$v_c(t_{peak}) \geq 0.9V_s\$

Assume that source \$V_s\$ can supply infinite current. Ideally, I would also like to know how to solve this if there is a current limit on \$V_s\$, but this assumption simplifies the problem.

Solution Attempt

I start by equating in and out currents at the node labeled \$v_c(t)\$:

$$ i_s(t) = i_c(t) + i_{load}(t) \label{kcl} \tag{1} $$

We know \$i_{load}(t)\$, and the other two values can be represented easily enough:

$$ i_s(t) = \frac{V_s - v_c(t)}{R_s} \\ i_c(t) = C\frac{dv_c}{dt} $$

Substituting into \ref{kcl}, we get: $$ \frac{V_s - v_c(t)}{R_s} = C\frac{dv_c}{dt} + i_{load}(t) $$

Rearranging, we get:

$$ \begin{align} \frac{dv_c}{dt} + \frac{v_c(t)}{R_sC} = \frac{V_s - R_si_{load}(t)}{R_sC} \label{origEq} \tag{2} \end{align} $$

I am attempting to solve this first order linear differential equation for \$v_c(t)\$, and use the conditions from the Known Values section to solve for a minimum capacitance \$C\$. To solve, we can first find an integrating factor \$\mu(t)\$:

$$ \begin{align} \mu(t) &= e^{\int{\frac{1}{R_sC}dt}} \\ &= e^{\frac{t}{R_sC}} \end{align} $$

Multiplying both sides of \ref{origEq} by \$\mu(t)\$,

$$ e^{\frac{t}{R_sC}}\frac{dv_c}{dt} + e^{\frac{t}{R_sC}}\frac{v_c(t)}{R_sC} = e^{\frac{t}{R_sC}}\frac{V_s - R_si_{load}(t)}{R_sC} $$ Using the product rule, $$ \frac{d}{dt}\left(e^{\frac{t}{R_sC}}v_c(t)\right) = e^{\frac{t}{R_sC}}\frac{V_s - R_si_{load}(t)}{R_sC} $$ Now, I chose \$0\$ and \$t_{peak}\$ as the bounds of integration because those are the two times \$t\$ for which I know both \$v_c(t)\$ and \$i_{load}(t)\$. Integrating, $$ \begin{align} \int_0^{t_{peak}}{\frac{d}{dt}\left(e^{\frac{t}{R_sC}}v_c(t)\right)dt} &= \int_0^{t_{peak}}{e^{\frac{t}{R_sC}}\frac{V_s - R_si_{load}(t)}{R_sC}dt} \\ \left.\left(e^{\frac{t}{R_sC}}v_c(t)\right)\right|_0^{t_{peak}} &= \frac{V_s}{R_sC}\int_0^{t_{peak}}{e^\frac{t}{R_sC}dt} - \frac{1}{C}\int_0^{t_{peak}}{i_{load}(t)e^\frac{t}{R_sC}dt} \\ &= \left.\left(V_se^\frac{t}{R_sC}\right)\right|_0^{t_{peak}} - \frac{1}{C}\int_0^{t_{peak}}{i_{load}(t)e^\frac{t}{R_sC}dt} \end{align} $$

I know that I can approximate the definite integral \$\int_0^{t_{peak}}{i_{load}(t) dt}\$ through a Riemann sum because I know \$i_{load}(t)\$ for this time period, but I can't evaluate the last remaining integral because the unknown \$C\$ is still present. Attempting integration by parts on this isolated integral,

$$ \begin{align} f(t) &= \int_0^{t_{peak}}{i_{load}(t)e^\frac{t}{R_sC}dt} \label{f} \tag{3} \\ u = e^\frac{t}{R_sC} &\implies du = \frac{1}{R_sC}e^\frac{t}{R_sC}dt \\ dv = i_{load}(t) dt &\implies v = \int{i_{load}(t)dt} \end{align} $$

This is where I've hit a wall. I can't evaluate the indefinite integral \$\int{i_{load}(t)dt}\$ because I only know \$i_{load}(t)\$ as a set of discrete points. If I try approximating \$v\$ as a definite integral \$\int_0^{t_{peak}}{i_{load}(t)dt}\$, then the integral \$f(t)\$ in \ref{f} evaluates to \$0\$, which I believe is incorrect.

Any ideas on where to go from here?

  • \$\begingroup\$ I'd advise using a different variable for the load current, because i_L is very often used as current through an inductor. In eq. 3 in the third line, is dv just a random variable? You used v earlier to denote a voltage... \$\endgroup\$
    – Huisman
    Commented Feb 18, 2019 at 11:26
  • \$\begingroup\$ Good point about i_L. And sorry -- u, du, v, and dv are commonly used when going through integration by parts, but I can see how that could be confusing. \$\endgroup\$
    – Graham
    Commented Feb 18, 2019 at 17:29

2 Answers 2


I would use an easier approach: the capacitor is only needed to act as buffer for the high-current spikes. Just get the duration of the (biggest) spike (t_duration) and the height of the (biggest) spike (I_max) from the data you got ("For the time period of interest, I have the load's current draw over time.").
The capacitor's voltage should never drop below 90%, so dv = 10% * Vs.

$$i = C*dv/dt $$

$$ C = \frac{ I_{max} * t_{duration} } { 0.1 * V_s}$$

This will yield a bigger capacitor than needed, so the voltage drop will be quite less than 10% of Vs.

Another approach is to simulate the circuit is Spice, putting the data you have ("For the time period of interest, I have the load's current draw over time.") in a Piece-wise linear current source. Pick a starting value for C, like e.g. 100uF (or use the value given in the first approach) and tweak by running a few simulations.

If you really want to solve your approach, I would suggest iteratively picking values for C and evaluate the definite integral.

  • \$\begingroup\$ Thanks for the suggestions. I have actually tried both of these approaches already. Specifically, I used a Riemann sum to estimate the charge on the capacitor and divided by 0.1Vs. As you noted, this results in a larger capacitance than needed. In this case, I believe it's much larger than is reasonable for the application. I think the reason for this is that the spike durations can be long (~150ms or longer), so I think it's overly simplistic to ignore the contribution of the power supply. \$\endgroup\$
    – Graham
    Commented Feb 18, 2019 at 17:26
  • \$\begingroup\$ The simulation is another good approach. When I tried it, the capacitance wasn't affecting the voltage drop as much as I expected, so I figured my circuit model may be overly simplistic. I'll have to try it again. \$\endgroup\$
    – Graham
    Commented Feb 18, 2019 at 17:28
  • \$\begingroup\$ Don't know if (parts of) the simulated system already exists, but you could also try different caps in the real situation, starting with the easy calculated value and scaling down while measuring the voltage across the load. Would be the best approach. \$\endgroup\$
    – Huisman
    Commented Feb 18, 2019 at 17:48

The approach by @Huisman answer is the proper one for a first order approximation, if you feel it leads to too big a capacitor for your application you can proceed to another obvious simplification.

Assume that the capacitor will be at 95% Vs and thus Vs will provide 5% * Vs / Rs. That is approximate the current originating from Vs as a constant current being subtracted from the load. This leads to:

$$ C_{mid} = \frac{(I_{max} - 0.05*V_s/R_s) * t_{duration} }{ 0.1 * V_s } $$ $$ C_{mid} = \frac{I_{max} * t_{duration} }{ 0.1 * V_s } - \frac{t_{duration}}{2*R_s} $$ $$ C_{mid} = C_{max} - \frac{t_{duration}}{2*R_s} $$

This is roughly equivalent to a trapezoidal approximation to the current being supplied by the source and would be closer to the actual capacitor size, but unlike the previous approximation it will no longer be an upper bound.

You can, however, derive an obvious lower bound for the capacitor by assuming that Vs supplies the full current for the whole duration of the discharge:

$$ C_{lower bound} = \frac{(I_{max} - 0.1*V_s/R_s) * t_{duration} }{ 0.1 * V_s } $$ $$ C_{lower bound} = C_{max} - \frac{t_{duration}}{R_s} $$

This will directly tell you if you are barking off the right tree.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.