Capacitor Transient Response

Thread Starter

silv3r.m00n

Joined Apr 15, 2010
70
Hello

This chapter >> http://www.allaboutcircuits.com/vol_1/chpt_16/2.html
on Capacitor Transient Response has a spice program at the end as follows :

capacitor charging
v1 1 0 dc 15
r1 1 2 10k
c1 2 0 100u ic=0
.tran .5 10 uic
.plot tran v(2,0) v(1,2)
.end

When I run the program in spice i get the correct plot.
I want to see the current also.
so I added
.plot tran v(2,0) v(1,2) i(v1)

but the current graph is flat i.e. near zero values right from the beginning.

Current is supposed to start from v/r and then slowly become zero. But I cant see that in the plot.

Is my program wrong ?

Please help
 

Thread Starter

silv3r.m00n

Joined Apr 15, 2010
70
Instead of i(v1), try i(r1) or i(c1).
i(r1) or i(c1) gives error : Error: no such vector r1#branch

I guess current can only be measured across a voltage source in spice.
To measure it across a particular resistance branch a false voltage source = 0V has to be added.

Silver
 

Thread Starter

silv3r.m00n

Joined Apr 15, 2010
70
Or try plotting the current only, it might only a problem in Y-axis scale of the V and I.
Worked.

But the current is mirror image. It starts from -V/R and slowly moves to 0.

I see this everywhere. Currents are always reversed.

Rich (BB code):
AC Source connected to a resistor
v1 1 0 ac sin(0 100 60 0 0)
rload 1 0 2
.tran 1m 30m 
.plot tran v(1) i(v1)
.end
The above simple program shows the plot of voltage and current. And they are out of phase by 180 degree. Why does this happen ? Is the program wrong somewhere. The current is supposed to be in phase with voltage.
 
Top