At t = 0, the switch is at Position 1.

We note that `q(0)=0`.

`R(dq_1)/(dt)+1/Cq_1=V`

`500(dq_1)/(dt)+1/(0.5xx10^-6)q_1=20`

`(dq_1)/(dt)+4000q_1=0.04`

Using SNB to solve this differential equation, we have:

`q_1(t)=1/(100,000)(1-e^(-4,000t))`

NOTE: By differentiating, this gives us:

`i_1(t)=` `d/(dt)1/100000(1-e^(-4000t))=` `0.04e^(-4000t`

We need to find `tau`:

`tau=RC=500xx0.5xx10^-6=` `0.00025`.

Now, at `t=0.00025`, the charge will be:

`q_1(0.00025)`

`=[1/(100,000)(1-e^(-4,000t))]_(t=0.00025)`

`=6.3212xx10^-6`

#### Position 2

At `t=tau`, switch at Position 2:

Applying the formula `R(dq_2)/(dt)+1/Cq_2=V` again:

`500(dq_2)/(dt)+1/(0.5xx10^-6)q_2=-40`

NOTE: The negative voltage is because the current will flow in the opposite direction through the resistor and capacitor.

Once again, we solve using Scientific Notebook:

`500(dq_2)/(dt)+1/(0.5xx10^-6)q_2=-40`

` q_2(0)=6.3212xx10^-6`

Exact solution is:

`q_2(t)` `=-0.00002+2.6321xx10^-5e^(-4000t)`

So the current transient will be:

`i_2=(dq_2)/(dt)`

`=d/(dt)(-0.00002+2.6321xx10^-` `{:5e^(-4000t))`

`=-0.10528e^(-4000t)`

This expression assumes that time starts at `t=0`. However, we moved the switch to Position 2 at `t=0.00025`, so we need:

`i_2=-0.10528e^(-4000(t-0.00025))` `=-0.10528e^(1-4000t`

So the complete current transient is:

`i_1(t)=0.04e^(-4000t)` for `0 <= t <= 0.00025`

`i_2(t)=-0.10528e^(1-4000t)` for `t>0.00025`

The graph is quite interesting:

Open image in a new page

Graph of current `i` at time `t`.