InterviewSolution
| 1. |
Derive formula for charging and discharging of a capacitor |
|
Answer» It's a pretty straightforward process. There are three steps: Write a KVL equation. Because there's a capacitor, this will be a differential equation.Solve the differential equation to get a general solution.Apply the initial condition of the circuit to get the particular solution. In this case, the conditions tell us whether the capacitor will charge or discharge.Let's go through this. Instead of using an actual step function, I'm going to use a DC input and assume the capacitor starts out discharged. First, you write a KVL equation: Vi=vR+vCIn circuit analysis, we like to use current instead of charge. So instead of Q=CV, we use i=CdVdt. The resistor and capacitor share the same current, so: iR=iC=CdvCdtYou can put this into the KVL equation: vR=RiR=RiC=RCdvCdtVi=RCdvCdt+vCThis is a first-order linear differential equation. Using, some algebra, you can rearrange it into a solvable form: RCdvCdt=Vi−vcdvCVi−vC=dtRCIntegrating both sides gives: −ln(Vi−vC)=tRC+C0You can get rid of the ln by moving the negative sign and making both sides a power of e: Vi−vC=e−t/RC+C0=e−t/RCeC0C0 is a constant of integration, so eC0 is also a constant. Let's rename it to C1 for convenience: Vi−vC=C1e−t/RCThe differential equation is solved, but there's still an unknown (C1). You can find its value if you know the initial condition of the circuit. In this case, I said that the capacitor started out discharged (vC=0 at t=0), so let's use that: Vi−0=C1e−0/RC=C1⋅1C1=ViNow you can find the fully-solved equation: Vi−vC=Vie−t/RCvC=Vi−Vie−t/RCvC=Vi(1−e−t/RC)Is this correct? At t=0, you have: vC=Vi(1−1)=0and at t=∞, you have: vC=Vi(1−0)=ViSo the capacitor starts out discharged, ends up fully-charged, and in between there's an exponential decay. That's correct! For the discharge, Vi=0 and the initial condition is that the capacitor is charged to a nonzero value, which I'll call V0. You can use these to solve for C1 again: 0−V0=C1e−0/RCC1=−V0−vC=−V0e−t/RCvC=V0e−t/RC |
|