Chapter 2:Network Analysis And Network Theorems

Example 2.1:Page number-50

In [2]:
import math
v=10
r=4
#case a
i=v/float(r)
print "i=",format(i,'.1f'),"A"
#case b
#6ohm resistor is in series with 4 ohm resistor
i=v/(6+4)
v1=i*6
v2=i*4
print "voltage across 6 ohm resistor=",format(v1,'.1f'),"V"
print "voltage across 4 ohm resistor=",format(v2,'.1f'),"V"
#case c
i=10 #constant in both cases
v4=i*4
print "voltage when 4 ohm resistor is connected=",format(v4,'.1f'),"V"
v6=i*6
v=v4+v6
print "voltage when both resistors are in series=",format(v,'.1f'),"V"
i= 2.5 A
voltage across 6 ohm resistor= 6.0 V
voltage across 4 ohm resistor= 4.0 V
voltage when 4 ohm resistor is connected= 40.0 V
voltage when both resistors are in series= 100.0 V

Example 2.2:Page number-53

In [1]:
import math
i=72
v=36
rs=v/float(i)
print "rs=",format(rs,'.1f'),"ohm"
print "the load voltage is expressed as 36rl/(0.5+rl)"
%matplotlib inline
import matplotlib.pyplot as plt
x=[40,50,60,72]
y=[36,34,32,30]
plt.plot(x,y)
plt.xlabel('il(A)')
plt.ylabel('vl(V)')
plt.show()
rs= 0.5 ohm
the load voltage is expressed as 36rl/(0.5+rl)

Example 2.3:Page number-55

In [5]:
import math
v=24
r=0.75
ir=v/r
print "ir=",format(ir,'.1f'),"A"
il=v/(10+r) #since 10 is in series with r
print "il=",format(il,'.2f'),"A"
ir= 32.0 A
il= 2.23 A

Example 2.4:Page number-56

In [7]:
import math
vs=12
rs=0.3
il=10
#case a
p=vs*il
print "power=",format(p,'.1f'),"W"
#case b
power=il**2*rs
print "power dissipated=",format(power,'.1f'),"W"
#case c
totpow=(vs-il*rs)*il
print "total power supplied by practical source is=",format(totpow,'.1f'),"W"
i=vs/rs
print "current source=",format(i,'.1f'),"A"
power= 120.0 W
power dissipated= 30.0 W
total power supplied by practical source is= 90.0 W
current source= 40.0 A

Example 2.5:Page number-58

In [8]:
import math
#case a
#v0/vs=r2/(r1+r2)=0.4r2=0.6r1
r1=10
r2=(0.6*r1)/float(0.4)
print "r2=",format(r2,'.1f'),"ohm"
#case b
#when r2 is parallel to r3
r3=200000
req=(r2*r3)/(r2+r3)
print "req=",format(req,'.1f'),"ohm"
#v0/vs=0.5825
change=(0.6-0.5825)/float(0.6)
print change
r3=20000
req=(r2*r3)/(r3+r2)
print "req=",format(req,'.1f'),"ohm"
#v0/vs=0.4615
change=(0.6-0.4615)/0.6
print change
r2= 15.0 ohm
req= 15.0 ohm
0.0291666666667
req= 15.0 ohm
0.230833333333

Example 2.6:Page number-60

In [12]:
import math
r=2
i=2
i3=3 #obtained by applying current divider rule to figure
i4=1
req=1/float(0.5+0.25+0.166) #1/2,1/4,1/6 values are converted to decimal form
print "req=",format(req,'.2f'),"ohm"
i2=(4*i4/float(6))
i1=(6*i2)/float(req)
#tracing circuit cabc via 6 ohm resistor and applying ohms law,
vs=i1*i4+i2*6
print "vs=",format(vs,'.2f'),"V"
req= 1.09 ohm
vs= 7.66 V

Example 2.7:Page number-61

In [13]:
import math
#combining series parallel series
#[(2+2+2)||(6+5+2)||10]+5
#[[6*6/6+6]+7]||10]+5=[10+10/10*10]+5=5+5=10
print "the value of series parallel resistances is 10 ohm"
the value of series parallel resistances is 10 ohm

Example 2.8

In [20]:
import math
#case a
#rab=(80+40)||(60+40)
rab=(120*100)/float(120+100)
print "rab=",format(rab,'.2f'),"ohm"
#rab=(80||60)+(40||40)
rab=(4800/float(140))+(1600/80)
print "rab=",format(rab,'.3f'),"ohm"
#case b
#(60+80)||(40+40)
rcd=(140*80)/float(140+80)
print "rcd=",format(rcd,'.2f'),"ohm"
#(60||40)+(80||40)
rab=float(2400/float(100))+(3200/float(120))
print "rab=",format(rab,'.2f'),"ohm"
rab= 54.55 ohm
rab= 54.286 ohm
rcd= 50.91 ohm
rab= 50.67 ohm

example 2.9:Page number-65

In [22]:
import math
#simplifying the circuit 
ceq=1/float(0.333+0.666+0.2) #converted to decimal form
print "ceq=",format(ceq,'.8f'),"F"
ceq= 0.83402836 F

Example 2.10:Page number-67

In [29]:
import math
#case a
I=12/(2+((12*24)/float(36))) #values taken from circuit
I1=I*(24/float(36))
I2=I*(12/float(36))
print "i=",format(I,'1f'),"A"
print "i1=",format(I1,'1f'),"A"
print "i2=",format(I2,'1f'),"A"
#case b
power=(I**2)*2
print "power consumed by 2 ohm resistor=",format(power,'.2f'),"W"
power=(I1**2)*12
print "power consumed by 12 ohm resistor=",format(power,'.2f'),"W"
power=(I2**2)*24
print "power consumed by 2 ohm resistor=",format(power,'.2f'),"W"
#case c
v=I*2
print "voltage drop=",format(v,'.1f'),"V"
i= 1.200000 A
i1= 0.800000 A
i2= 0.400000 A
power consumed by 2 ohm resistor= 2.88 W
power consumed by 12 ohm resistor= 7.68 W
power consumed by 2 ohm resistor= 3.84 W
voltage drop= 2.4 V

Example 2.11:Page number-69

In [30]:
import math
#case a
#values taken and calculated from figure
r1=6
r2=12
r3=18
rab=3.21 #calculating similar to above using parallel in series resistances
print "rab=3.12ohm"
#case b
r4=30
r5=15
r6=30
ran=6 #similar as above
print "ran=6 ohm"
rab=3.12ohm
ran=6 ohm

Example 2.12:Page number-73

In [31]:
import math
#eqns derived from figure
#6v1-4v2=2-->1
#-4v1+7v2=-3-->2
#eqn 1 and 2 are written in matrix form and solved using cramers rule
print "v1=0.0769 V"
print "v2=-0.3846V"
print "current in 0.5ohm resistance is 0.154A,0.25ohm resistance is 1.846,0.66ohm resistor is -1.154A"
v1=0.0769 V
v2=-0.3846V
current in 0.5ohm resistance is 0.154A,0.25ohm resistance is 1.846,0.66ohm resistor is -1.154A

Example 2.13:Page number-74

In [32]:
import math
#from the figure the eqns are written in matrix form and using cramers rule the value of v1 and v2 can be found
print "v1=3.6V"
print "v2=2.2V"
print "the current in 0.6 ohm resistor is 10.8A,0.2 ohm resistor is 7A,0.16ohm resistor is 13.2 A"
v1=3.6V
v2=2.2V
the current in 0.6 ohm resistor is 10.8A,0.2 ohm resistor is 7A,0.16ohm resistor is 13.2 A

Example 2.14:Page number-76

In [33]:
import math
#kcl is applied to the circuit and the eqns obtained are solved using cramer's rule
print "the voltages of nodes 1 and 3 are 50.29 and 57.71 respectively"
#i3=v/r
print "current through 16 ohm resistor is 1.64A"
the voltages of nodes 1 and 3 are 50.29 and 57.71 respectively
current through 16 ohm resistor is 1.64A

Example 2.15:Page number-78

In [34]:
import math
#the eqns obtained are converted to matrix form for solving using cramer's rule values are found
i1=5.224
i2=0.7463
i3=3.28
v=(i1-i3)*3
print "voltage across 3 ohm resistor is=",format(v,'.3f'),"V"
voltage across 3 ohm resistor is= 5.832 V

Example 2.16:page number-79

In [35]:
import math
#kvl eqns are obtained from figure which are solved to obtain currents
print "currents obtained are i1=2.013 and i2=1.273"
currents obtained are i1=2.013 and i2=1.273

Example 2.17:Page number-80

In [37]:
import math
#the currents are obtained by solving the eqns
i1=5.87
i2=-0.13
i3=-1.54
v=18-1.54*8
print "voltage at node D=",format(v,'.2f'),"v"
i=5.86/float(4)
print "current in 4 ohm resistor is=",format(i,'.2f'),"A"
power=18*1.54
print "power supplied by 18V source is=",format(power,'.2f'),"W"
voltage at node D= 5.68 v
current in 4 ohm resistor is= 1.47 A
power supplied by 18V source is= 27.72 W

Example 2.18:Page number-82

In [38]:
import math
#node eqns are obtained form the figure
print "va=8.33V and vb=4.17V"
i=8.33/float(8)
print "current through 8 ohm resistor is=",format(i,'.2f'),"A"
va=8.33V and vb=4.17V
current through 8 ohm resistor is= 1.04 A

Example 2.19:Page number-83

In [39]:
import math
#eqns obtained are calculated just like above problems and are aolved for i1 and i2
print "i1=-1.363A and i2=-3.4A"
i1=-1.363A and i2=-3.4A

Example 2.20:Page number-84

In [40]:
import math
#eqns are obtained from the figure and are solved for currents
i1=6.89
i2=3.89
i3=-2.12
i=2*(i2-i1)
print "current supplied by dependent source is=",format(i,'.1f'),"A"
power=6*i1
print "power supplied by voltage source is=",format(power,'.2f'),"W"
current supplied by dependent source is= -6.0 A
power supplied by voltage source is= 41.34 W

Example 2.21:Page number-86

In [2]:
import math
#the following problem is based on usage of superposition theorem
i8=12/float(6+4+8) #current for 8 ohm resistor.the resistances are in series with each other.Hence 6+4+8
#next when voltage source is short circuited (8+4) total of resistance is obtained.The 4A is distributed in parallel branches as per current divider rule
i=(4*6)/float(6+12)
print "i8=",format(i8,'.3f'),"A"
print "i8'=",format(i,'.3f'),"A"
tot=i8+i
print "total current=",format(tot,'.1f'),"A"
i8= 0.667 A
i8'= 1.333 A
total current= 2.0 A

Exampe 2.22:Page number-88

In [8]:
import math
#kvl is applied to circuit
i=1
vth=12-(1*4) #12 is voltage 1 is current and 4 is resistance
rth=(4*5)/float(4+5)
i6=vth/float(rth+6) #since current passes through 6 ohm resistor
print i6,"A"
0.972972972973 A

Example 2.23:Page number-89

In [4]:
import math
#thevenin's theorem and superposition theorem used here
#applying mesh eqns to the 2 circuits and after getting the eqns they are solved using cramer's rule to obtain i1 and i2
i1=-0.6
i2=-1.2
#the value of currents indicates that they have assumed to be flowing in directions opposite to the assumed direction
vth=12-1.2*3 #voltage eqn
rth=1.425 #(1+2||12)||3=(1+(2*12)/(2+12))||3=19/7||3=19/7*3/19/7+3=1.425
i2=vth/(rth+2)
print "current through 2 ohm resistor is=",format(i2,'.2f'),"A"
print "Note that the same problem is again solved using superposition theorem and hence ignored " 
current through 2 ohm resistor is= 2.45 A
Note that the same problem is again solved using superposition theorem and hence ignored 

Example 2.24:Page number-91

In [5]:
import math
#using thevenin's theorem
#applying kcl at node a va is obtained
va=12
rth=1.33 #2||4
i5=vth/(rth+5)
print "current through 5 ohm resistor is=",format(i5,'.3f'),"A"
current through 5 ohm resistor is= 1.327 A

Example 2.25:Page number-92

In [6]:
import math
#applying kvl to circuit
i=0.414
vth=12-4*0.414 #using vth formula
#when terminals a and b are short circuited applying kcl to node a gives isc=5*i
isc=2.07
rth=vth/isc
print "rth=",format(rth,'.3f'),"A"
rth= 4.997 A

Example 2.26:Page number-93

In [7]:
import math
#norton's theorem
v=10
#applying kvl to closed circuit 
isc=12/float(2+2) 
rn=4 #resistance obtained by short circuiting v and opening i
iab=(4*3)/float(4+4) #current through 4 ohm connected across AB
print "iab=",format(iab,'.1f'),"A"
iab= 1.5 A

Example 2.27:Page number-103

In [8]:
import math
#natural frequency needs to be determined
#req=[(6+6)||4]+[1||2]=3.6666
req=3.6667
l=4 #inductance
s=-req/float(l)
print "natural frequency=",format(s,'.5f'),"secinverse"
natural frequency= -0.91668 secinverse

Example 2.28

In [9]:
import math
#req=[10+2+(5||15)]=15.75
#case a
c=0.4
req=15.75
s=-1/float(c*req)
print "natural frequency=",format(s,'.5f'),"secinverse"
#case b
tc=req*0.4 #time constant
print "time constant=",format(tc,'.1f'),"sec"
natural frequency= -0.15873 secinverse
time constant= 6.3 sec

Example 2.30:Page number-109

In [11]:
import math
v=120
r=40
i=v/float(r)
#applying kvl to the closed loop
v=3*520
print "voltage=",format(v,'.1f'),"v"
#when v=120,R can be found by I*(r+20)=120-->r=20
r=20
print "r=20 ohm"
#when r=20 total r=20+20+20=60
r=60
l=10
tc=l/float(r) #time constant
print "tc=",format(tc,'.4f'),"sec"
#i=I0*e^-(t/tc)=3*e^(-6t)
energy=(10*9)/float(2)
benergy=0.05*energy
print "balance energy=",format(benergy,'.2f'),"J"
#(L*i^2)/2=2.25-->hence i=0.6708
#3*e^-6t=0.6708-->e^-6t=0.2236-->applying log on both sides we get t=0.25
print "t=0.25 sec"
voltage= 1560.0 v
r=20 ohm
tc= 0.1667 sec
balance energy= 2.25 J
t=0.25 sec

Example 2.34:Page number-116

In [12]:
import math
v=120
V=200
#v=V(1-e^-5/2R)
#120=200*(1-e^-5/2R)
#applying log on both sides and solving we get R=2.72 Mohm
print "R=2.72Mohm"
R=5 
tc=10
#applying in the above eqn and solving lograthmically we get t=9.16
print "t=9.16 sec"
R=2.72Mohm
t=9.16 sec
In [ ]: