Capacitor Switching Transient

A resistor ( 0.3420 Ω 0.3420 \, \Omega ), an inductor ( 2.4926 mH 2.4926 \, \text{mH} ), and a capacitor ( 53.0516 μ F 53.0516 \mu F ) are connected in series with an AC voltage source with an instantaneous peak value of 100 V 100 V and a frequency of 60 Hz 60 \text{Hz} . There is also a switch in series with these components.

Initially, both the inductor and capacitor are completely de-energized, and the switch is closed when the voltage source is at its positive peak. What is the maximum instantaneous voltage which develops across the capacitor?

Appendix:

To help analyze this, let's write the state-space representation of the circuit dynamics. This is very helpful because it allows us to express the rates of change of the "state variables" in terms of the state variables themselves, and in terms of the circuit forcing function. Here, the state variables are the current through the inductor and the voltage across the capacitor. The circuit forcing function is the source voltage.

Start with the fundamental equations:

v L = L d i d t i = C d v C d t v_L = L \frac{di}{dt} \\ i = C \frac{dv_C}{dt}

Then apply conditions imposed by the circuit topology:

v S R i v C = L d i d t i = C d v C d t v_S - Ri - v_C = L \frac{di}{dt} \\ i = C \frac{dv_C}{dt}

Finally, re-arrange for the state variable derivatives in terms of the state variables and forcing functions:

d i d t = v S R i v C L d v C d t = i C \frac{di}{dt} = \frac{v_S - Ri - v_C}{L} \\ \frac{dv_C}{dt} = \frac{i}{C}

This form facilitates numerical solution. We could also solve using Laplace transforms, but the numerical solution is actually much simpler to understand and implement.

Bonus: If a power utility wants to install shunt capacitor banks for voltage support, and their practice is to switch in the bank at a random point on the voltage wave, for what instantaneous voltage must the banks be rated in general?


The answer is 187.3.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Carsten Meyer
May 5, 2021

As an alternative to Steven Chase's solution, here is one based on Laplace-Transforms. Before we begin, we normalize all currents, voltages, time and elements by the values given below: voltages: 1 kV , currents: 1 kA , time: 1 ms R : 1 Ω , C : 1 mF , L : 1 mH , ω , ω s : 1 kHz \begin{aligned} \text{voltages:}&&&\SI{1}{kV}, &&&\text{currents:}&&&\SI{1}{kA},&&&\text{time:}&&&\SI{1}{ms}&&& \Rightarrow &&&&R:&&&\SI{1}{\ohm}, &&& C:&&&\SI{1}{mF}, &&&L:&&&\SI{1}{mH},&&&\omega,\:\omega_s:&&&\SI{1}{kHz} \end{aligned} The network equations remain the same in the process, but now all currents, voltages, time and elements represent their normalized dimensionless counterparts. For simplicity, let's assume the switch closes at t = 0 t=0 . Then the voltage source has the form v s ( t ) = 0.1 cos ( 2 π 0.06 t ) = : V 0 cos ( ω s t ) , ω s 0.378 v_s(t)=0.1\cos(2\pi \cdot 0.06 t)=:V_0 \cos(\omega_s t),\qquad \omega_s\approx 0.378


After switching ( t 0 t\geq 0 )

The network is supposed to be de-energized for t < 0 t<0 , so all initial conditions at t = 0 t=0^- vanish and u C ( t ) u_C(t) only depends on v s ( t ) v_s(t) . We calculate the transfer function via voltage divider: H ( s ) : = U c ( s ) V s ( s ) = 1 s C 1 s C + R + s L = 1 C L s 2 + s R L + 1 C L = : ω 2 ( s + α ) 2 + ω 2 s 0 = R 2 L + R 2 4 L 2 1 C L 0.069 + 2.75 j = : α + j ω U c ( s ) = H ( s ) V s ( s ) = ω 2 ( s + α ) 2 + ω 2 V 0 s s 2 + ω s 2 \begin{aligned} H(s)&:=\frac{U_c(s)}{V_s(s)}=\frac{ \frac{1}{sC} }{ \frac{1}{sC} + R + sL }= \frac{\frac{1}{CL}}{s^2+s\frac{R}{L} + \frac{1}{CL}}=:\frac{\omega^2}{(s+\alpha)^2+\omega^2} &&&\left|\:s_0 = -\frac{R}{2L}+\sqrt{ \frac{R^2}{4L^2} - \frac{1}{CL} }\approx -0.069 + 2.75j=:-\alpha + j\omega\right.\\[.5em] U_c(s)&=H(s)V_s(s)=\frac{\omega^2}{(s+\alpha)^2+\omega^2}\cdot\frac{V_0s}{s^2+\omega_s^2} \end{aligned} Using two very general (and useful) formulae for inverse Laplace-Transforms with complex pole pairs, we directly get u C ( t ) u_C(t) : u C ( t ) = V 0 H ( j ω s ) cos ( ω s t + H ( j ω s ) ) + ω V s ( s 0 ) e α t sin ( ω t + V s ( s 0 ) ) 0.102 cos ( 0.377 t 0.00697 ) + 0.102 e 0.069 t sin ( 2.75 t + 4.69 ) \begin{aligned} u_C(t)&=V_0|H(j\omega_s)|\cos(\omega_st + \sphericalangle H(j\omega_s)) + \omega |V_s(s_0)|e^{-\alpha t}\sin(\omega t + \sphericalangle V_s(s_0)) \\[.5em] &\approx 0.102 \cos(0.377 t-0.00697)+0.102 e^{-0.069t}\sin(2.75t+4.69) \end{aligned} The pure cosine in the first term describes the harmonic steady state (HSS) the circuit will converge to, while the decaying sine in the second term describes the effect of switching. Comparing angle frequencies, we find ω 7.3 ω s \omega\approx 7.3\omega_s , so we expect a high frequency ringing around the HSS: With fixpoint iteration (or just zooming far into the graph), the first maximum is the global maximum and lies at u c , m a x 0.187 kV u _{c,max}\approx \SI{0.187}{kV} . In volts, the answer is 187 \boxed{187}


Bonus: If we want to switch on the shunt capacitor at any point of the cosine wave, we need to add a phase-parameter to v s ( t ) v_s(t) : v s ( t ) = V 0 cos ( ω s t + ϕ ) V s ( s ) = V 0 s c ϕ ω s s ϕ s 2 + ω s 2 c ϕ : = cos ( ϕ ) , s ϕ : = sin ( ϕ ) \begin{aligned} v_s(t)&=V_0\cos(\omega_s t +\phi)&&&\Rightarrow &&&&V_s(s)&=V_0\frac{s c_\phi - \omega_s s_\phi}{s^2+\omega_s^2} &&&\left| c_\phi:=\cos(\phi),\quad s_\phi:=\sin(\phi)\right. \end{aligned} The general formula for u C ( t ) u_C(t) above still holds - changing parameters are colored in red: u C ( t ) = V 0 H ( j ω s ) cos ( ω s t + ϕ + H ( j ω s ) ) + ω V s ( s 0 ) e α t sin ( ω t + V s ( s 0 ) ) \begin{aligned} u_C(t)&=V_0|H(j\omega_s)|\cos(\omega_st + \red{\phi} + \sphericalangle H(j\omega_s)) + \omega \red{|V_s(s_0)|}e^{-\alpha t}\sin(\omega t + \red{\sphericalangle V_s(s_0)}) \end{aligned} With the triangle inequality, we get an upper estimate for u C ( t ) u_C(t) that does not depend on ϕ \phi : u C ( t ) V 0 H ( j ω s ) + V 0 ω s 0 + ω s s 0 2 + ω s 2 2.2 V 0 |u_C(t)|\leq |V_0H(j\omega_s)|+|V_0\omega|\frac{|s_0|+\omega_s}{|s_0^2+\omega_s^2|}\approx 2.2|V_0| Adding 10% tolerance, the capacitors should be rated for V m a x 2.5 V 0 V_{max}\approx 2.5|V_0|

João Areias
Mar 21, 2018

Steven Chase's solution is nice, I just want to share my solution too. I'm keeping my v c v_c in an array because I want to graph my result later on.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import matplotlib.pyplot as plt
import numpy as np

f = 60 #Hz
Vpp = 100 #V

def dx(x, u):
    L = 2.4926e-3
    C = 53.0516e-6
    R = 0.3420

    A = np.array([
        [   0,  1/C],
        [-1/L, -R/L],
    ], dtype='float64')
    B = np.array([
        [  0],
        [1/L],
    ], dtype='float64')
    return np.matmul(A, x) + u*B


t_max = 0.067
seg = 1000000

t = np.linspace(0, t_max, seg)
dt = t_max/seg

x = np.array([
    [0],
    [0],
], dtype='float64')
V = Vpp*np.cos(2*np.pi*f*t)

Vc = []
Vc_max = float('-inf')
for i in t:
    x += dt*dx(x, Vpp*np.cos(2*np.pi*f*i))
    if x[0][0] > Vc_max:
        Vc_max = x[0][0]
    Vc.append(x[0][0])

plt.plot(t, V)
plt.plot(t, Vc)
plt.show()

print(Vc_max)

Thanks for posting. Your style is quite different from mine. I will study it to see what I can learn

Steven Chase - 3 years, 2 months ago

Log in to reply

The idea is the same as what you did but Numpy allows me to use the matrix representation of the state space and already have pre-built functions for matrix multiplication and all which makes life a whole lot easier, it is also very optimized and way faster than Python's native math operations. What I'm doing here is simply getting a vector x = [ V c I ] x = \begin{bmatrix} V_c \\ I \end{bmatrix} and I can represent my gradient as x ˙ = A x + B u \dot{x} = A \cdot x + B \cdot u where A A and B B are matrices, and u u is my input.

From what you gave on your question:

[ d V c d t d I d t ] = [ 0 1 C 1 L R L ] [ V c I ] + [ 0 1 L ] V S \begin{bmatrix} \frac{dV_c}{dt} \\ \frac{dI}{dt} \end{bmatrix} = \begin{bmatrix} 0 && \frac{1}{C} \\ \frac{-1}{L} && \frac{-R}{L} \end{bmatrix} \cdot \begin{bmatrix} V_c\\ I \end{bmatrix} + \begin{bmatrix} 0 \\ \frac{1}{L} \end{bmatrix} \cdot V_S

The components are not charged at the beginning so x 0 = [ 0 0 ] x_0 = \begin{bmatrix} 0 \\ 0 \end{bmatrix} and we can solve it numerically with Euler's method by deffining a very small value for d t dt and computing x n + 1 = x n + x n ˙ d t x_{n+1} = x_{n} + \dot{x_n} \cdot dt the rest is just using numpy for the matrix operations, my laptop only has integrated gpu, that's why I used numpy which uses the, but the nice thing about modelling it using matrices is that if you have some nice gpus and a more computation intenssive problem, the gpu will compute everything much faster than using cpus and my code can be easily ported to something like Cupy.

João Areias - 3 years, 2 months ago

Log in to reply

That's very interesting. What does it take to ensure that the calculations run on the GPU, rather than on the CPU?

Steven Chase - 3 years, 2 months ago

Log in to reply

@Steven Chase For my code, it will run on the CPU but if you replace the Numpy with the Cupy, the functions are the same so the code will pretty much not change and it uses Cuda to solve the problem, which is a language created by NVIDIA for scientific computing that only runs in NVIDIA GPUs, another thing you can do is write it using OpenCL, it's a bit more complicated though, but it lets you use AMD GPUs too.

João Areias - 3 years, 2 months ago
Steven Chase
Oct 22, 2017

Here's the code, based on the approach outlined in the appendix. The transient graph is also included in the figure in the problem. We see that the max transient voltage across the capacitor is about twice the peak source voltage (about 187.3).

import math

f = 60.0
omega = 2.0 * math.pi * f
cyc = 1.0 / f

R = 0.3420
L = 2.4926E-3
C = 53.0516E-6

##############################

I = 0.0
VC = 0.0

I_dot = 0.0
VC_dot = 0.0

##############################

t = 0.0
dt = 10.0**(-8.0)

###############################

VCmax = 0.0

###############################

while t <= 5.0 * cyc:

    VS = 100.0 * math.sin(omega * t)

    I = I + I_dot * dt
    VC = VC + VC_dot * dt

    if t > cyc / 4.0:
        I_dot = (VS - R*I - VC) / L
        VC_dot = I / C

    else:
        I_dot = 0.0
        VC_dot = 0.0

    if VC > VCmax:
        VCmax = VC


    t = t + dt

###############################

print VCmax

Why do you solve with code? Is there any another method for this?

Sahil Silare - 3 years, 3 months ago

Log in to reply

Laplace transforms work too, for simple circuits like this one. Here's a problem that has both types of solutions:

https://brilliant.org/problems/rlc-switching-quantitative/?ref_id=1454880

Steven Chase - 3 years, 3 months ago

Log in to reply

Thank you very much :)

Sahil Silare - 3 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...