View Single Post
  #20   Report Post  
Old October 14th 04, 03:38 AM
Bill Bowden
 
Posts: n/a
Default

(Alan Horowitz) wrote in message . com...

when a current just starts flowing into a RL or RC circuit, how does
the voltage "know" that it should be increasing exactly 63% during
each time-constant period?

And whence the number 63%?


It just turns out to be 63% if you add up all
the little voltage changes on the capacitor as it
charges during one time constant. The short basic
program below uses 10000 samples and keeps track
of the resistor voltage at each step and then prints
out the final capacitor voltage of 63%. The accuracy
can be improved by taking more samples. Change time
to a smaller value for a better approximation.

Voltage =1
Resistance =1
time = .0001
Limit = 1/time
For n = 1 to Limit
Current = Voltage/Resistance
Voltage = Voltage - (Current*Resistance*time)
Next n
Print "Capacitor voltage = "; (1-Voltage)*100;"%"

'Answer = 63.2139444%

-Bill