Chapter 18: Transient Behaviour

Example 18.1, Page 376

In [7]:
#Initialisation
c=100*10**-6               #capacitance in farad
r=100*10**3                #resistance in ohm
v=20                       #volt
t=25                       #time in seconds
e=2.71828                  #mathematical constant

#Calculation
T=c*r                     #time in seconds
v1=v*(1-e**(-t*T**-1))    #volt

#Result
print'v = %.2f V'%v1
v = 18.36 V

Example 18.2, Page 378

In [12]:
import math

#Initialisation
l=400*10**-3               #inductance in henry
i1=300                     #current in milliamp
r=20                       #resistance in ohm
v=15                       #volt
t=25                       #time in seconds
e=2.71828                  #mathematical constant

#Calculation
T=l/r                     #time in seconds
i=(v*r**-1)*10**3         #current in amp
t=((math.log(i/(i-i1)))/(math.log(e)))*0.02  #expression to find time t

#Result
print't = %.1f mSec'%(t*10**3)
t = 10.2 mSec

Example 18.3, Page 382

In [9]:
#Initialisation
c=20*10**-6               #capacitance in farad
r=10*10**3                #resistance in ohm
v=5                       #volt
v2=10                       #volt

#Calculation
T=c*r                     #time in seconds

#Result
print'v = %d - %d e^( -t/%.1f )  V'%(v2,v,T)
v = 10 - 5 e^( -t/0.2 )  V
In [ ]: