Chapter3-Network Theorem 2

Ex1-pg3.2

In [1]:
##Network Theorem 2
##pg no 3.2
##example 3.1
print("When 10-V source is acting alone:");
print("By current-division formula :");
I1=10.*(0.87/(1.0+0.87));
print"%s %.2f %s"%("I1=10*(0.87/(10+0.87))= ",I1," A (down)");
print("When 4 A source is acting alone:");
print("By current-division formula :");
I2=2.86*(0.875/(10.+0.875));
print"%s %.2f %s"%("I2=2.86*(0.875/(10+0.875))= ",I2," A (down)");
print("By superposition theorem:");
I=I1+I2;
print"%s %.2f %s"%("\nI=I1+I2=0.8+0.23= ",I," A (down)");
When 10-V source is acting alone:
By current-division formula :
I1=10*(0.87/(10+0.87))=  4.65  A (down)
When 4 A source is acting alone:
By current-division formula :
I2=2.86*(0.875/(10+0.875))=  0.23  A (down)
By superposition theorem:

I=I1+I2=0.8+0.23=  4.88  A (down)

Ex2-pg3.3

In [2]:
##Network Theorem 2
##pg no 3.4
##example 3.2
print("When 4-A source is acting alone:");
print("By current-division formula :");
I1=3.33*(3.53/(6.+3.53));
print"%s %.2f %s"%("I1=3.33*(3.53/(6+3.53)) = ",I1," A (down)");
print("When 10-V source is acting alone:");
print("By current-division formula :");
I2=0.833*(3.53/(6.+3.53));
print"%s %.2f %s"%("I2=0.833*(3.53/(6+3.53))= ",I2," A (up)");
print("When 3-A source is acting alone:");
print("By current-division formula :");
I3=3*(3.53/(6.+3.53));
print"%s %.2f %s"%("I3=3*(3.53/(6+3.53))= ",I3," A (down)");
print("By superposition theorem:");
I=I1-I2+I3;
print"%s %.2f %s"%("\nI=I1-I2+I3=1.23-0.31+1.11= ",I," A (down)");
When 4-A source is acting alone:
By current-division formula :
I1=3.33*(3.53/(6+3.53)) =  1.23  A (down)
When 10-V source is acting alone:
By current-division formula :
I2=0.833*(3.53/(6+3.53))=  0.31  A (up)
When 3-A source is acting alone:
By current-division formula :
I3=3*(3.53/(6+3.53))=  1.11  A (down)
By superposition theorem:

I=I1-I2+I3=1.23-0.31+1.11=  2.04  A (down)

Ex3-pg3.5

In [3]:
##Network Theorem 2
##pg no 3.5
##example 3.3
print("When 4-A source is acting alone:");
print("By current-division formula :");
I1=4./(2.+1.);
print"%s %.2f %s"%("I1=4/(2+1) = ",I1," A (down)");
print("When 3-A source is acting alone:");
print("By current-division formula :");
I2=3.*(2./(2.+1.));
print"%s %.2f %s"%("I2=3*(2/(2+1)) = ",I2," A (down)");
print("When 1-A source is acting alone:");
print("By current-division formula :");
I3=1.*(2./(2.+1.));
print"%s %.2f %s"%("I3=1*(2/(2+1)) = ",I3," A (down)");
print("By superposition theorem:");
I=I1+I2+I3;
print"%s %.2f %s"%("\nI=I1+I2+I3=1.33+2+0.66= ",I," A (down)");
When 4-A source is acting alone:
By current-division formula :
I1=4/(2+1) =  1.33  A (down)
When 3-A source is acting alone:
By current-division formula :
I2=3*(2/(2+1)) =  2.00  A (down)
When 1-A source is acting alone:
By current-division formula :
I3=1*(2/(2+1)) =  0.67  A (down)
By superposition theorem:

I=I1+I2+I3=1.33+2+0.66=  4.00  A (down)

Ex4-pg3.7

In [4]:
##Network Theorem 2
##pg no 3.
##example 3.4
print("When 6-V source is acting alone:");
VAB1=6.;
print"%s %.2f %s"%("VAB1 = ",VAB1," V");
print("When 10-V source is acting alone:");
print("Since the resistor of 5 ohm is shorted,the voltage across it is zero")
VAB2=10.;
print"%s %.2f %s"%("VAB2= ",VAB2," V" );
print("When 5-A source is acting alone:");
print("Due to short circuit in both the parts");
VAB3=0.;
print"%s %.2f %s"%("VAB3 = ",VAB3," V");
print("By superposition theorem:");
VAB=VAB1+VAB2+VAB3;
print"%s %.2f %s"%("\nVAB=VAB=VAB1+VAB2+VAB3= ",VAB," V");
When 6-V source is acting alone:
VAB1 =  6.00  V
When 10-V source is acting alone:
Since the resistor of 5 ohm is shorted,the voltage across it is zero
VAB2=  10.00  V
When 5-A source is acting alone:
Due to short circuit in both the parts
VAB3 =  0.00  V
By superposition theorem:

VAB=VAB=VAB1+VAB2+VAB3=  16.00  V

Ex5-pg3.7

In [5]:
##Network Theorem 2
##pg no 3.7
##example 3.5
print("When 5-A source is acting alone:");
print("By current-division formula :");
I1=5.*(2./(2.+4.));
print"%s %.2f %s"%("I1=5*(2/(2+4)) = ",I1," A (down)");
print("When 2-A source is acting alone:");
print("By current-division formula :");
I2=2.*(2./(2.+4.));
print"%s %.2f %s"%("I2=2*(2/(2+4)) = ",I2," A (down)");
print("When 6-V source is acting alone:");
print("Applying KVL to the mesh");
print("-2*I3-6-4*I3=0");
print("I3=-1");
I3=-1.;
print"%s %.2f %s"%("I3=-1 A= ",I3," A (down)");
print("By superposition theorem:");
I=I1+I2+I3;
print"%s %.2f %s"%("\nI=I1+I2+I3=1.67+0.67-1= ",I," A (down)");
When 5-A source is acting alone:
By current-division formula :
I1=5*(2/(2+4)) =  1.67  A (down)
When 2-A source is acting alone:
By current-division formula :
I2=2*(2/(2+4)) =  0.67  A (down)
When 6-V source is acting alone:
Applying KVL to the mesh
-2*I3-6-4*I3=0
I3=-1
I3=-1 A=  -1.00  A (down)
By superposition theorem:

I=I1+I2+I3=1.67+0.67-1=  1.33  A (down)

Ex6-pg3.8

In [6]:
##Network Theorem 2
##pg no 3.8
##example 3.6
a=15./38.;
b=10./38.;
x=a+b;
print"%s %.2f %s"%("\nApplying KCL at node 1, \nI1 =",a,"");##When the 15 V source is acting alone
print"%s %.2f %s"%("\nApplying KCL at node 1, \nI1 = ",b,"");##When the 10 V source is acting alone
print"%s %.2f %s"%("\nBy superposition theorem, \nI = I1+I2 = ",x," A");
Applying KCL at node 1, 
I1 = 0.39 

Applying KCL at node 1, 
I1 =  0.26 

By superposition theorem, 
I = I1+I2 =  0.66  A

Ex7-pg3.9

In [7]:
##Network Theorem 2
##pg no 3.8
##example 3.7
a=3.;
b=2.;
x=a+b;
print"%s %.2f %s"%("\napplying KCL at node 1, \nIx1 = ",a," A");##when the 30 V source is acting alone
print"%s %.2f %s"%("\napplying KCL at the mesh, \nIx2 = ",b," A");##when the 20 V source is acting alone
print"%s %.2f %s"%("\nBy superposition theorem, Ix = Ix1+Ix2 = ",x," A");
applying KCL at node 1, 
Ix1 =  3.00  A

applying KCL at the mesh, 
Ix2 =  2.00  A

By superposition theorem, Ix = Ix1+Ix2 =  5.00  A

Ex8-pg3.10

In [8]:
##Network Theorem 2
##pg no 3.10
##example 3.8
##when 5 V source is acting alone
import math
import numpy
from numpy import linalg
print("Vx+10I1=5");##equation 1
print("Applying KVL to mesh,");
print("4Vx+12I1=5");##equation 2
A=numpy.matrix([[1, 10],[4 ,12]]);##solving equation in matrix form
B=([[5],[5]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = 0.535 A");
##when the 2 A source is acting alone
print("Vx+10I2=0");##equation 1
print("Applying KCL at Node x,");
print("Vx=-10/7");##equation 2
A1=numpy.matrix([[1, 10],[1 ,0]]);##solving equation in matrix form
B1=numpy.matrix([[0], [-10/7]])
X1=numpy.dot(numpy.linalg.inv(A1),B1);
print[X1];
print("I2 = 0.1428 A");
a=0.535;
b=0.1428;
x=a+b;
print"%s %.3f %s"%("\nBy superposition theorem, \nI = I1+I2 = ",x," A ");
Vx+10I1=5
Applying KVL to mesh,
4Vx+12I1=5
[matrix([[-0.35714286],
        [ 0.53571429]])]
I1 = 0.535 A
Vx+10I2=0
Applying KCL at Node x,
Vx=-10/7
[matrix([[-2. ],
        [ 0.2]])]
I2 = 0.1428 A

By superposition theorem, 
I = I1+I2 =  0.678  A 

Ex9-pg3.10

In [9]:
##Network Theorem 2
##pg no 3.10
##example 3.9
##when 100 V source is acting alone
import numpy
from numpy import linalg
print("Vx-5I1=0");##equation 1
print("Applying KVL to mesh,");
print("10Vx-15I1=-100");##equation 2
A=numpy.matrix([[1, -5],[10 ,-15]]);##solving equation in matrix form
B=numpy.matrix([[0], [-100]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];##negative because of opposite direction
print("I1 = 2.857 A");
##when the 10 A source is acting alone
print("9Vx+10I2=0");##equation 1
print("Applying KCL at Node 1,");
print("Vx=-100/7");##equation 2
A=numpy.matrix([[9, 10],[1, 0]]);##solving equation in matrix form
B=numpy.matrix([[0] ,[-100/7]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I2 = 12.857 A");
a=2.857;
b=12.857;
x=a+b;
print"%s %.2f %s"%("\nBy superposition theorem, \nI = I1+I2 = ",x," A ");
Vx-5I1=0
Applying KVL to mesh,
10Vx-15I1=-100
[matrix([[-14.28571429],
        [ -2.85714286]])]
I1 = 2.857 A
9Vx+10I2=0
Applying KCL at Node 1,
Vx=-100/7
[matrix([[-15. ],
        [ 13.5]])]
I2 = 12.857 A

By superposition theorem, 
I = I1+I2 =  15.71  A 

Ex10-pg3.11

In [10]:
##Network Theorem 2
##pg no 3.11
##example 3.10
##when 17 V source is acting alone
import numpy
from numpy import linalg
print("Vx+2I1=0");##equation 1
print("Applying KVL to mesh,");
print("-5Vx-5I1=17");##equation 2
A=numpy.matrix([[1, 2],[-5 ,-5]]);##solving equation in matrix form
B=([[0], [17]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = 3.4 A");
##when the 1 A source is acting alone
print("4Vx+3I2=0");##equation 1
print("Applying KCL at Node x,");
print("Vx=-6/5");##equation 2
A=numpy.matrix([[4, 3],[1, 0]]);##solving equation in matrix form
B=numpy.matrix([[0],[-6/5]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I2 = 1.6 A");
a=3.4;
b=1.6;
x=a+b;
print"%s %.2f %s"%("\nBy superposition theorem, \nI = I1+I2 = ",x," A ");
Vx+2I1=0
Applying KVL to mesh,
-5Vx-5I1=17
[matrix([[-6.8],
        [ 3.4]])]
I1 = 3.4 A
4Vx+3I2=0
Applying KCL at Node x,
Vx=-6/5
[matrix([[-2.        ],
        [ 2.66666667]])]
I2 = 1.6 A

By superposition theorem, 
I = I1+I2 =  5.00  A 

Ex11-pg3.12

In [11]:
##Network Theorem 2
##pg no 3.12
##example 3.11
##when 5 A source is acting alone
print("-V1+4I=0");##equation 1
print("Applying KCL to node 1,");
print("1.25V1-4I=5");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix([[-1, 4],[1.25 ,-4]]);##solving equation in matrix form
B=([[0] ,[5]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("V1 = 20 V");
##when the 20 V source is acting alone
print("from the figure,");
print("V2-3I=0");##equation 1
print("Applying KVL to the mesh,");
print("I=-20");##equation 2
A=([[1 ,-3],[0 ,1]]);##solving equation in matrix form
B=([[0] ,[-20]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("V2 = -60 V");
a=20.;
b=-60.;
x=a+b;
print"%s %.2f %s"%("\nBy superposition theorem, \n V = V1+V2 =",x," V ");
-V1+4I=0
Applying KCL to node 1,
1.25V1-4I=5
[matrix([[ 20.],
        [  5.]])]
V1 = 20 V
from the figure,
V2-3I=0
Applying KVL to the mesh,
I=-20
[array([[-60.],
       [-20.]])]
V2 = -60 V

By superposition theorem, 
 V = V1+V2 = -40.00  V 

Ex12-pg3.13

In [12]:
##Network Theorem 2
##pg no 3.13
##example 3.12
##when 18 V source is acting alone
print("Vx+I1=0");##equation 1
print("Applying KVL to mesh,");
print("3Vx-6I1=-18");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix([[1, 1],[3 ,-6]]);##solving equation in matrix form
B=([[0] ,[-18]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = 2 A");
##when the 3 A source is acting alone
print("from the figure,");
print("Vx=2 V");##equation 1
print("Applying KCL at node 1,");
print("3Vx-6I2=0");##equation 2
A=([[1 ,0],[3 ,-6]]);##solving equation in matrix form
B=([[2] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I2 =1 V");
a=2;
b=1;
x=a+b;
print"%s %.2f %s"%("\nBy superposition theorem, \n I = I1+I2 = ",x," A ");
Vx+I1=0
Applying KVL to mesh,
3Vx-6I1=-18
[matrix([[-2.],
        [ 2.]])]
I1 = 2 A
from the figure,
Vx=2 V
Applying KCL at node 1,
3Vx-6I2=0
[array([[ 2.],
       [ 1.]])]
I2 =1 V

By superposition theorem, 
 I = I1+I2 =  3.00  A 

Ex13-pg3.14

In [13]:
##Network Theorem 2
##pg no 3.14
##example 3.13
##when 120 V source is acting alone
print("Applying KVL to mesh,");
print("Iy1=5.45 A");
##when the 12 A source is acting alone
print("from the figure,");
print("V1+4Iy2=0");##equation 1
print("Applying KCL at node 1,");
print("-V1/8 +9/4Iy2=-12");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix([[1, 4],[-1/8 ,9/4]]);##solving equation in matrix form
B=([[0] ,[-12]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("Iy2 =-4.36 A");
##when 40 V source is acting alone
print("Applying KVL to mesh,");
print("Iy3=-1.82 A");
a=5.45;
b=-4.36;
c=-1.82;
x=a+b+c;
print"%s %.2f %s"%("\nBy superposition theorem, \n I = Iy1+Iy2+Iy3 = ",x," A ");
Applying KVL to mesh,
Iy1=5.45 A
from the figure,
V1+4Iy2=0
Applying KCL at node 1,
-V1/8 +9/4Iy2=-12
[matrix([[ 8.],
        [-2.]])]
Iy2 =-4.36 A
Applying KVL to mesh,
Iy3=-1.82 A

By superposition theorem, 
 I = Iy1+Iy2+Iy3 =  -0.73  A 

Ex14-pg3.15

In [14]:
##Network Theorem 2
##pg no 3.15
##example 3.14
##when 18 V source is acting alone
print("Vx1-31=0");##equation 1
print("Applying KVL to mesh,");
print("-3Vx1-9I=-18");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix([[1, -3],[-3 ,-9]]);##solving equation in matrix form
B=([[0] ,[-18]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("Vx1 = 3 V");
##when the 5 A source is acting alone
print("from the figure,");
print("V1+Vx2=0");##equation 1
print("Applying KCL at node 1,");
print("1/2V1-1/2Vx2=5");##equation 2
A=numpy.matrix([[1, 1],[1/2 ,-1/2]]);##solving equation in matrix form
B=([[0] ,[5]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("Vx2= -5 V");
##when the 36 V source is acting alone
print("from the figure,");
print("Vx3+3I=0");##equation 1
print("Applying KVL to the mesh,");
print("3Vx3-9I=-36");##equation 2
A=numpy.matrix([[1, 3],[3 ,-9]]);##solving equation in matrix form
B=([[0] ,[-36]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("Vx3= -6 V");
a=3.;
b=-5.;
c=-6.;
x=a+b+c;
print"%s %.2f %s"%("\nBy superposition theorem, \n Vx = Vx1+Vx2+Vx3 = ",x," V ");
Vx1-31=0
Applying KVL to mesh,
-3Vx1-9I=-18
[matrix([[ 3.],
        [ 1.]])]
Vx1 = 3 V
from the figure,
V1+Vx2=0
Applying KCL at node 1,
1/2V1-1/2Vx2=5
[matrix([[ 5.],
        [-5.]])]
Vx2= -5 V
from the figure,
Vx3+3I=0
Applying KVL to the mesh,
3Vx3-9I=-36
[matrix([[-6.],
        [ 2.]])]
Vx3= -6 V

By superposition theorem, 
 Vx = Vx1+Vx2+Vx3 =  -8.00  V 

Ex15-pg3.16

In [15]:
##Network Theorem 2
##pg no 3.16
##example 3.15
a=10.;
b=2.;
c=(5.*a)-(20.*b);
x=20.;
y=30.;
z=5.;
r=z+((x*y)/(x+y));
i=c/(r+c);
##Calculation of Vth(Thevenin's voltage)
print("removing the 10 ohm resistor from the circuit");
print"%s %.2f %s"%("\nFor mesh 1, \nI1 = ",a," A");
print"%s %.2f %s"%("\nApplying KVL to mesh 2,, \nI2 = ",b," A");
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",c," V");
##Calculation of Rth(Thevenin's Resistance)
print("replacing the current source of 10 A with an open circuit  and voltage source of 100 V with a short circuit,");
print"%s %.2f %s"%("\nRth = ",r," Ohm");
##Calculation of IL(load current)
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 10 ohm resistor from the circuit

For mesh 1, 
I1 =  10.00  A

Applying KVL to mesh 2,, 
I2 =  2.00  A

Writing Vth equation, 
 Vth =  10.00  V
replacing the current source of 10 A with an open circuit  and voltage source of 100 V with a short circuit,

Rth =  17.00  Ohm

IL =  0.37  A

Ex16-pg3.17

In [16]:
##Network Theorem 2
##pg no 3.17
##example 3.16
a=30.;
b=20.;
c=50.;
d=5.;
e=24.;
v=220.;
x=(v/(a+c));
y=(v/(b+d));
z=(20.*y)-(30.*x);
r=((a*c)/(a+c))+((b*d)/(b+d));
i=z/(r+e);
##Calculation the Vth (Thevenin's voltage)
print("removing the 24 Ohm resistor from the network");
print"%s %.2f %s"%("\nI1 = ",x," A");
print"%s %.2f %s"%("\nI2 = ",y," A");
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",z," V");
##Calculation of Rth (Thevenin's resistance)
print("replacing the 220 V source with short circuit");
print"%s %.2f %s"%("\nRth = ",r," Ohm");
##Calculation of IL (load current)
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 24 Ohm resistor from the network

I1 =  2.75  A

I2 =  8.80  A

Writing Vth equation, 
 Vth =  93.50  V
replacing the 220 V source with short circuit

Rth =  22.75  Ohm

IL =  2.00  A

Ex17-pg3.18

In [17]:
##Network Theorem 2
##pg no 3.18
##example 3.17
print("removing the 3 Ohm resistor from the network");
print("Applying KVL to mesh 1");
print("11*I1-9*I2=50");##equation 1
print("Applying KVL to mesh 2");
print("-9*I1+18*I2=0");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix([[11, -9],[-9 ,18]]);##solving equation in matrix form
B=numpy.matrix([[50] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1=7.69 A");
print("I2=3.85 A");
##Calculation of Vth (Thevenin's voltage)
a=7.69;
b=3.85;
v=-((5.*b)+(8.*(b-a)));##the B terminal is positive w.r.t A
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",v," V");
##Calculation of Rth (Thevenin's resistance)
x=4.;
y=2.;
z=5.;
##delta into star network
r1=((x*y)/(x+y+z));
r2=((x*z)/(x+y+z));
r3=((z*y)/(x+y+z));
print"%s %.2f %s %.2f %s %.2f %s "%("\nR1 = ",r1," Ohm"and " \nR2 = ",r2," Ohm" and "\nR3 =",r3," Ohm");
m=1.73;
n=8.91;
r=(r2+(m*n)/(m+n));
print"%s %.2f %s"%("\nRth = ",r," Ohm");
##Claculation of IL (Load Current)
i=v/(r+3.);	
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 3 Ohm resistor from the network
Applying KVL to mesh 1
11*I1-9*I2=50
Applying KVL to mesh 2
-9*I1+18*I2=0
[matrix([[ 7.69230769],
        [ 3.84615385]])]
I1=7.69 A
I2=3.85 A

Writing Vth equation, 
 Vth =  11.47  V

R1 =  0.73  
R2 =  1.82 
R3 = 0.91  Ohm 

Rth =  3.27  Ohm

IL =  1.83  A

Ex18-pg3.21

In [18]:
##Network Theorem 2
##pg no 3.21
##example 3.18
print("removing the 20 Ohm resistor from the network");
print("Applying KVL to mesh 1");
print("30*I1-15*I2=-75");##equation 1
print("Applying KVL to mesh 2");
print("-15*I1+20*I2=20");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix([[30, -15],[-15 ,20]]);##solving equation in matrix form
B=numpy.matrix([[-75] ,[20]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1=-3.2 A");
print("I2=-1.4 A");
##Calculation of Vth (Thevenin's voltage)
a=-3.2;
b=-1.4;
v=45.;
v1=45.-10.*(a-b);
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",v1," V");
##Calculation of Rth (Thevenin's resistance)
x=10.;
y=5.;
z=5.;
##delta into star network
r1=((x*y)/(x+y+z));
r2=((x*z)/(x+y+z));
r3=((z*y)/(x+y+z));
print"%s %.2f %s %.2f %s %.2f %s"%("\nR1 = ",r1," Ohm" and " \nR2 = ",r2," Ohm " and "\nR3 = ",r3," Ohm");
m=16.25;
r=((m*r1)/(m+r1))+r1;
print"%s %.2f %s"%("\nRth = ",r," Ohm");
##Claculation of IL (Load Current)
i=v1/(r+20.);
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 20 Ohm resistor from the network
Applying KVL to mesh 1
30*I1-15*I2=-75
Applying KVL to mesh 2
-15*I1+20*I2=20
[matrix([[-3.2],
        [-1.4]])]
I1=-3.2 A
I2=-1.4 A

Writing Vth equation, 
 Vth =  63.00  V

R1 =  2.50  
R2 =  2.50 
R3 =  1.25  Ohm

Rth =  4.67  Ohm

IL =  2.55  A

Ex19-pg3.22

In [19]:
##Network Theorem 2
##pg no 3.22
##example 3.19
print("removing the 3 Ohm resistor from the network");
print("Applying KVL to mesh 1");
print("I1=6");##equation 1
print("Applying KVL to mesh 2");
print("-12*I1+18*I2=42");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix ([[1, 0],[-12 ,18]]);##solving equation in matrix form
B=numpy.matrix ([[6] ,[42]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I2= 6.33 A");
##Calculation of Vth (Thevenin's voltage)
a=6.33;
v=6.*a;
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",v," V");
##Calculation of Rth (Thevenin's resistance)
print("replacing the voltage source with short circuit and current source by open circuit");
x=6.;
y=12.;
r=(x*y)/(x+y);
print"%s %.2f %s"%("\nRth = ",r," Ohm");
##Calculation of IL (load current)
i=v/(r+3.);
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 3 Ohm resistor from the network
Applying KVL to mesh 1
I1=6
Applying KVL to mesh 2
-12*I1+18*I2=42
[matrix([[ 6.        ],
        [ 6.33333333]])]
I2= 6.33 A

Writing Vth equation, 
 Vth =  37.98  V
replacing the voltage source with short circuit and current source by open circuit

Rth =  4.00  Ohm

IL =  5.43  A

Ex20-pg3.23

In [20]:
##Network Theorem 2
##pg no 3.23
##example 3.20
print("removing the 30 Ohm resistor from the network");
print("Applying KVL to supermesh ");
print("-I1+I2=13");##equation 1
print("15*I1+100*I2=150");##equation 2
##Calculation of Vth (Thevenin's voltage)
a=3.;
v=(40.*a)-50.;
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",v," V");
##Calculation of Rth (Thevenin's resistance)
print("replacing the voltage source with short circuit and current source by open circuit");
r=(75.*40.)/(75.+40.);
print"%s %.2f %s"%("\nRth = ",r," Ohm");
##Calculation of IL (load current)
i=v/(r+30.);
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 30 Ohm resistor from the network
Applying KVL to supermesh 
-I1+I2=13
15*I1+100*I2=150

Writing Vth equation, 
 Vth =  70.00  V
replacing the voltage source with short circuit and current source by open circuit

Rth =  26.09  Ohm

IL =  1.25  A

Ex21-pg3.24

In [ ]:
##Network Theorem 2
##pg no 3.25
##example 3.21
##Calculation of Vth
v=100.;
r=20.;
x=v/r;
print("Removing the 20 Ohm resistor from the network");
print"%s %.2f %s"%("\nVth = ",v," V ");
##calculation of Rth
print("replacing the voltage source with short circuit and current source by open circuit");
print("Rth = 0");
##calculation of IL
print"%s %.2f %s"%("\nIL = ",x," A");

Ex22-pg3.25

In [21]:
##Network Theorem 2
##pg no 3.25
##example 3.22
print("removing the 10 Ohm resistor from the network");
print("Applying KVL to mesh 1");
print("4*I1-I2=-25");##equation 1
print("Applying KVL to mesh 2");
print("-I1+4*I2=10");##equation 2
import math
import numpy
from numpy import linalg
A=numpy.matrix([[4, -1],[-1 ,4]]);##solving equation in matrix form
B=([[-25] ,[10]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1=-6 A");
print("I2=1 A");
##Calculation of Vth (Thevenin's voltage)
a=-6.;
b=1.;
v=-((2.*a)+(2.*b));##the terminal B is positive w.r.t A
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",v," V");
##Calculation of Rth (Thevenin's resistance)
x=2.;
y=2.;
z=1.;
##star into delta network
r1=x+y+((x*y)/z);
r2=x+z+((x*z)/y);
r3=z+y+((z*y)/x);
print"%s %.2f %s %.2f %s %.2f %s "%("\nR1 = ",r1," Ohm" and " \nR2 = ",r2," Ohm" and  "\nR3 = ",r3," Ohm");
##Claculation of IL (Load Current)
r=1.33;
i=v/(r+v);
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 10 Ohm resistor from the network
Applying KVL to mesh 1
4*I1-I2=-25
Applying KVL to mesh 2
-I1+4*I2=10
[matrix([[-6.],
        [ 1.]])]
I1=-6 A
I2=1 A

Writing Vth equation, 
 Vth =  10.00  V

R1 =  8.00  
R2 =  4.00 
R3 =  4.00  Ohm 

IL =  0.88  A

Ex23-pg3.28

In [22]:
##Network Theorem 2
##pg no 3.28
##example 3.23
print("removing the 1 Ohm resistor from the network");
print("writing current equation for meshes 1 & 2 ");
print("I1= -3 A");##equation 1
print("I2=1 A");##equation 2
##Calculation of Vth (Thevenin's voltage)
a=-3.;
b=1.;
r=2.;
v=4.-2.*(a-b);
print"%s %.2f %s"%("\nWriting Vth equation, \n Vth = ",v," V");
##Calculation of Rth (Thevenin's resistance)
print("replacing the voltage source with short circuit and current source by open circuit");
print("Rth = 2 Ohm");
##Calculation of IL (load current)
i=v/(r+1.);
print"%s %.2f %s"%("\nIL = ",i," A");
removing the 1 Ohm resistor from the network
writing current equation for meshes 1 & 2 
I1= -3 A
I2=1 A

Writing Vth equation, 
 Vth =  12.00  V
replacing the voltage source with short circuit and current source by open circuit
Rth = 2 Ohm

IL =  4.00  A

Ex24-pg3.29

In [23]:
##Network Theorem 1
##page no-3.29
##example3.24
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("I1=2");##equation 1
print("Writing current equation to supermesh:");##meshes 2 & 3 will form a supermesh 
print("I3-I2=4");##equation 2
print("Applying KVL to supermesh:");
print("-5I2-15I3=0");##equation 3
print("solving these equations we get :");##solving equations in matrix form
import math
import numpy
from numpy import linalg
A=([[1, 0 ,0],[0 ,-1, 1],[0 ,-5, -15]]);
B=([[2], [4] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = 2 A");
print("I2 = -3 A");
print("I3 = 1 A");
a=2.;
b=-3.;
x=a-b;
print"%s %.2f %s"%("\nIsc = ",x," A");
##calculation of Rn (norton's resistance)
print("replacing the voltage source with short circuit and current source by open circuit");
c=1.;
m=15.;
y=(c*(m+x))/(c+m+x);
print"%s %.2f %s"%("\nRn = ",y," Ohm");
##calculation of IL (load current)
z=10.;
i=x*(y/(z+y));
print"%s %.2f %s"%("\nIL = ",i," A");
Applying KVL to mesh 1:
I1=2
Writing current equation to supermesh:
I3-I2=4
Applying KVL to supermesh:
-5I2-15I3=0
solving these equations we get :
[array([[ 2.],
       [-3.],
       [ 1.]])]
I1 = 2 A
I2 = -3 A
I3 = 1 A

Isc =  5.00  A
replacing the voltage source with short circuit and current source by open circuit

Rn =  0.95  Ohm

IL =  0.43  A

Ex25-pg3.30

In [24]:
##Network Theorem 1
##page no-3.30
##example3.25
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("7*I1-2*I2=20");##equation 1
print("Applying KVL to mesh 2,"); 
print("-2*I1+10*I2=-12");##equation 2
print("solving these equations we get :");##solving equations in matrix form
import numpy
from numpy import linalg
A=numpy.matrix([[7, -2],[-2 ,10]]);##solving equation in matrix form
B=([[20] ,[-12]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I2 = -0.67 A");
a=-0.67;
print"%s %.2f %s"%("\nIsc = I2 = ",a," A");
##calculation of Rn (norton's resistance)
print("replacing the voltage source with short circuit ");
b=5.;
c=2.;
d=8.;
y=((b*c)/(b+c))+d;
print"%s %.2f %s"%("\nRn = ",y," Ohm");
##calculation of IL (load current)
z=10.;
i=-a*(y/(10.+y));
print"%s %.2f %s"%("\nIL = ",i," A");
Applying KVL to mesh 1:
7*I1-2*I2=20
Applying KVL to mesh 2,
-2*I1+10*I2=-12
solving these equations we get :
[matrix([[ 2.66666667],
        [-0.66666667]])]
I2 = -0.67 A

Isc = I2 =  -0.67  A
replacing the voltage source with short circuit 

Rn =  9.43  Ohm

IL =  0.33  A

Ex26-pg3.31

In [25]:
##Network Theorem 1
##page no-3.31
##example3.26
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("7*I1-I2=10");##equation 1
print("Applying KVL to mesh 2:"); 
print("-I1+6*I2-3*I3=0");##equation 2
print("Applying KVL to mesh 3:");
print("3*I2-3*I3=20");##equation 3
print("solving these equations we get :");##solving equations in matrix form
import math
import numpy
from numpy import linalg
A=([[7, -1 ,0],[-1 ,6, -3],[0 ,3, -3]]);
B=([[10], [0] ,[20]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = -13.17 A");
a=13.17;
print"%s %.2f %s"%("\nIsc = ",a," A");
##calculation of Rn (norton's resistance)
print("replacing the voltage source with short circuit ");
c=1.;
b=6.;
x=(c*b)/(c+b);
y=x+2.;
z=(y*3.)/(y+3.);
print"%s %.2f %s"%("\nRn = ",z," Ohm");
##calculation of IL (load current)
n=10.;
i=a*(z/(z+n));
print"%s %.2f %s"%("\nIL = ",i," A");
Applying KVL to mesh 1:
7*I1-I2=10
Applying KVL to mesh 2:
-I1+6*I2-3*I3=0
Applying KVL to mesh 3:
3*I2-3*I3=20
solving these equations we get :
[array([[  0.5       ],
       [ -6.5       ],
       [-13.16666667]])]
I1 = -13.17 A

Isc =  13.17  A
replacing the voltage source with short circuit 

Rn =  1.46  Ohm

IL =  1.68  A

Ex27-pg3.32

In [26]:
##Network Theorem 1
##page no-3.32
##example3.27
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("20*I1-20*I2=10");##equation 1
print("Applying KVL to mesh 2:"); 
print("-20*I1+60*I2-20*I3=40");##equation 2
print("Applying KVL to mesh 3:");
print("-20*I2+50*I3=-100");##equation 3
print("solving these equations we get :");##solving equations in matrix form
import math
import numpy
from numpy import linalg
A=([[20, -20 ,0],[-20 ,60, -20],[0 ,-20, -50]]);
B=([[10], [40] ,[-100]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = 0.81A");
a=0.81;
print"%s %.2f %s"%("\nIsc = ",a," A");
##calculation of Rn (norton's resistance)
print("replacing the voltage source with short circuit ");
c=20.;
b=30.;
x=(c*b)/(c+b);
y=x+c;
z=(y*c)/(y+c);
print"%s %.2f %s"%("\nRn = ",z," Ohm");
##calculation of IL (load current)
n=10.;
i=a*(z/(z+n));
print"%s %.2f %s"%("\nIL = ",i," A");
Applying KVL to mesh 1:
20*I1-20*I2=10
Applying KVL to mesh 2:
-20*I1+60*I2-20*I3=40
Applying KVL to mesh 3:
-20*I2+50*I3=-100
solving these equations we get :
[array([[ 2.375],
       [ 1.875],
       [ 1.25 ]])]
I1 = 0.81A

Isc =  0.81  A
replacing the voltage source with short circuit 

Rn =  12.31  Ohm

IL =  0.45  A

Ex28-pg3.33

In [27]:
##Network Theorem 1
##page no-3.33
##example3.28
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("90*I1-60*I2=120");##equation 1
print("Applying KVL to mesh 2:"); 
print("-60*I1+100*I2-30*I3=40");##equation 2
print("Applying KVL to mesh 3:");
print("30*I2-30*I3=-10");##equation 3
print("solving these equations we get :");##solving equations in matrix form
import math
import numpy
from numpy import linalg
A=([[90, -60 ,0],[-60 ,100, -30],[0 ,30, -30]]);
B=([[102], [40] ,[-10]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I3 = 4.67A");
a=4.67;
print"%s %.2f %s"%("\nIsc = ",a," A");
##calculation of Rn (norton's resistance)
print("replacing the voltage source with short circuit ");
c=30.;
b=60.;
x=(c*b)/(c+b);
y=x+10.;
z=(y*c)/(y+c);
print"%s %.2f %s"%("\nRn = ",z," Ohm");
Applying KVL to mesh 1:
90*I1-60*I2=120
Applying KVL to mesh 2:
-60*I1+100*I2-30*I3=40
Applying KVL to mesh 3:
30*I2-30*I3=-10
solving these equations we get :
[array([[ 3.75555556],
       [ 3.93333333],
       [ 4.26666667]])]
I3 = 4.67A

Isc =  4.67  A
replacing the voltage source with short circuit 

Rn =  15.00  Ohm

Ex29-pg3.34

In [28]:
##Network Theorem 1
##page no-3.34
##example3.29
##calculation of Isc (short-circuit current)
print("Writing current equation for supermesh :");
print("I2-I1=2");##equation 1
print("Applying KVL to supermesh ,"); 
print("12*I1= 55");##equation 2
print("solving these equations we get :");##solving equations in matrix form
import numpy
from numpy import linalg
A=numpy.matrix([[-1, 1],[12 ,0]]);##solving equation in matrix form
B=([[2] ,[55]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = 4.58 A");
print("I2 = 6.58 A");
a=6.58;
print"%s %.2f %s"%("\nIsc = I2 = ",a," A");
##calculation of Rn (norton's resistance)
print("replacing the voltage source with short circuit and current source with open circuit ");
b=12.;
c=4.;
y=((b*c)/(b+c));
print"%s %.2f %s"%("\nRn = ",y," Ohm");
##calculation of IL (load current)
z=8.;
i=a*(y/(z+y));
print"%s %.2f %s"%("\nIL = ",i," A");
Writing current equation for supermesh :
I2-I1=2
Applying KVL to supermesh ,
12*I1= 55
solving these equations we get :
[matrix([[ 4.58333333],
        [ 6.58333333]])]
I1 = 4.58 A
I2 = 6.58 A

Isc = I2 =  6.58  A
replacing the voltage source with short circuit and current source with open circuit 

Rn =  3.00  Ohm

IL =  1.79  A

Ex30-pg3.35

In [29]:
##Network Theorem 1
##page no-3.35
##example3.30
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("5*I1-2*I2=-2");##equation 1
print("Applying KVL to mesh 2:"); 
print("4*I2-2*I3=-1");##equation 2
print("Applying KVL to mesh 3:");
print("-2*I1-2*I2+4*I3=0");##equation 3
print("solving these equations we get :");##solving equations in matrix form
import math
import numpy
from numpy import linalg
A=([[5, -2 ,0],[0 ,4, -2],[-2,-2, 4]]);
B=([[-2], [-1] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);
print[X];
print("I1 = -0.64A");
print("I2 = -0.55A");
print("I3 = -0.59A");
a=-0.64;
b=-0.55;
c=-0.59;
print"%s %.2f %s"%("\nIsc = I3 = ",a," A");
##calculation of Rn (norton's resistance)
print("replacing the voltage source with short circuit ");
z=2.2;
print"%s %.2f %s"%("\nRn = ",z," Ohm");
##calculation of IL (load current)
n=1.;
i=-c*(z/(z+n));
print"%s %.2f %s"%("\nIL = ",i," A");
Applying KVL to mesh 1:
5*I1-2*I2=-2
Applying KVL to mesh 2:
4*I2-2*I3=-1
Applying KVL to mesh 3:
-2*I1-2*I2+4*I3=0
solving these equations we get :
[array([[-0.61538462],
       [-0.53846154],
       [-0.57692308]])]
I1 = -0.64A
I2 = -0.55A
I3 = -0.59A

Isc = I3 =  -0.64  A
replacing the voltage source with short circuit 

Rn =  2.20  Ohm

IL =  0.41  A

Ex31-pg3.37

In [1]:
##Network Theorem 1
##page no-3.39
##example3.31
##calculation of Vth (Thevenin's voltage)
a=0.25;
import math
import numpy
from numpy import linalg
v=(10.*a)+(8.*a);
print("Writing Vth equation,");
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("4*I1-2*I2 = 1");##equation 1
print("Applying KVL to mesh 2:"); 
print("-18*I1-11*I2=0");##equation 2
A=numpy.matrix([[4, -2],[8 ,-11]]);##solving equation in matrix form
B=([[1] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];
print("I2 = 2.25 A");
a=2.25;
print'%s %.2f %s'%("\nIsc = I2 = ",a," A");
##Calculation of Rth
x=v/a;
print'%s %.2f %s'%("\nRth = ",x," Ohm");
Writing Vth equation,

Vth =  4.50  V
Applying KVL to mesh 1:
4*I1-2*I2 = 1
Applying KVL to mesh 2:
-18*I1-11*I2=0
[matrix([[ 0.39285714],
        [ 0.28571429]])]
I2 = 2.25 A

Isc = I2 =  2.25  A

Rth =  2.00  Ohm

Ex33-pg3.39

In [2]:
##Network Theorem 1
##page no-3.39
##example3.33
##calculation of Vth (Thevenin's voltage)
a=0.25;
import numpy
from numpy import linalg
v=(10.*a)+(8.*a);
print("Writing Vth equation,");
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Isc (short-circuit current)
print("Applying KVL to mesh 1:");
print("4*I1-2*I2 = 1");##equation 1
print("Applying KVL to mesh 2:"); 
print("-18*I1-11*I2=0");##equation 2
A=numpy.matrix([[4, -2],[8 ,-11]]);##solving equation in matrix form
B=([[1] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];
print("I2 = 2.25 A");
a=2.25;
print'%s %.2f %s'%("\nIsc = I2 = ",a," A");
##Calculation of Rth
x=v/a;
print'%s %.2f %s'%("\nRth = ",x," Ohm");




import numpy
from numpy import linalg
A=numpy.matrix([[4, -2],[8 ,-11]]);##solving equation in matrix form
B=([[1] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];
Writing Vth equation,

Vth =  4.50  V
Applying KVL to mesh 1:
4*I1-2*I2 = 1
Applying KVL to mesh 2:
-18*I1-11*I2=0
[matrix([[ 0.39285714],
        [ 0.28571429]])]
I2 = 2.25 A

Isc = I2 =  2.25  A

Rth =  2.00  Ohm
[matrix([[ 0.39285714],
        [ 0.28571429]])]

Ex41-pg3.47

In [3]:
##Network Theorem 1
##page no-3.47
##example3.41
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("I2-I1=4");##equation 1
print("Applying KVL at the outerpath:"); 
print("-6*I1-5*I2=2");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[-1, 1],[-6 ,-5]]);##solving equation in matrix form
B=([[4] ,[2]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];
print("I1 = -2 A");
print("I2 = 2 A");
print("Writing Vth equation,");
a=-2;
v=8-a;
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the voltage source with short circuit and current source by an open circuit ");
x=(v*1.)/(v+1.);
print'%s %.2f %s'%("\nRth = ",x," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",x," Ohm");
##calculation of Pmax
m=(v**2)/(4.*x);
print'%s %.2f %s'%("\nPmax = ",m," W");
Removing the variable resistor RL from the network:
I2-I1=4
Applying KVL at the outerpath:
-6*I1-5*I2=2
[matrix([[-2.],
        [ 2.]])]
I1 = -2 A
I2 = 2 A
Writing Vth equation,

Vth =  10.00  V
replacing the voltage source with short circuit and current source by an open circuit 

Rth =  0.91  Ohm
For maximum power transfer

Rth = RL =  0.91  Ohm

Pmax =  27.50  W

Ex42-pg3.48

In [4]:
##Network Theorem 1
##page no-3.48
##example3.42
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("I1=50");##equation 1
print("Applying KVL to mesh 2:"); 
print("5*I1-10*I2=0");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[1, 0],[5 ,-10]]);##solving equation in matrix form
B=([[50] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];

print("I2 = 25 A");
print("Writing Vth equation,");
a=25;
v=3*a;
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the current source of 50 A by an open circuit ");
x=7.;
y=3.;
m=(x*y)/(x+y);
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(v**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
I1=50
Applying KVL to mesh 2:
5*I1-10*I2=0
[matrix([[ 50.],
        [ 25.]])]
I2 = 25 A
Writing Vth equation,

Vth =  75.00  V
replacing the current source of 50 A by an open circuit 

Rth =  2.10  Ohm
For maximum power transfer

Rth = RL =  2.10  Ohm

Pmax =  669.64  W

Ex43-pg3.49

In [5]:
##Network Theorem 1
##page no-3.49
##example3.43
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("Writing the current equation for the supermesh");
print("I2-I1=6");##equation 1
print("Applying KVL to the supermesh :"); 
print("5*I1+2*I2=10");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[-1, 1],[5 ,1]]);##solving equation in matrix form
B=([[6] ,[10]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];

print("I1 = -0.29 A");
print("I2 = 5.71 A");
print("Writing Vth equation,");
a=5.71;
v=2*a;
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the current source of 50 A by an open circuit ");
x=5.;
y=2.;
m=((x*y)/(x+y))+3.+4.;
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(v**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
Writing the current equation for the supermesh
I2-I1=6
Applying KVL to the supermesh :
5*I1+2*I2=10
[matrix([[ 0.66666667],
        [ 6.66666667]])]
I1 = -0.29 A
I2 = 5.71 A
Writing Vth equation,

Vth =  11.42  V
replacing the current source of 50 A by an open circuit 

Rth =  8.43  Ohm
For maximum power transfer

Rth = RL =  8.43  Ohm

Pmax =  3.87  W

Ex44-pg3.50

In [6]:
##Network Theorem 1
##page no-3.50
##example3.44
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("Applying KVL to mesh 1");
print("15*I1-5*I2=120");##equation 1
print("Applying KVL to the mesh 2:"); 
print("I2=-6");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[15, -5],[0 ,1]]);##solving equation in matrix form
B=([[120] ,[-6]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];

print("I1 = 6 A");
print("Writing Vth equation,");
a=6.;
v=120.-(10.*a);
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the current source of 50 A by an open circuit ");
x=10.;
y=5.;
m=((x*y)/(x+y));
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(v**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
Applying KVL to mesh 1
15*I1-5*I2=120
Applying KVL to the mesh 2:
I2=-6
[matrix([[ 6.],
        [-6.]])]
I1 = 6 A
Writing Vth equation,

Vth =  60.00  V
replacing the current source of 50 A by an open circuit 

Rth =  3.33  Ohm
For maximum power transfer

Rth = RL =  3.33  Ohm

Pmax =  270.00  W

Ex45-pg3.45

In [7]:
##Network Theorem 1
##page no-3.51
##example3.45

##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("I1=3 A");##equation 1
print("Applying KVL to the mesh 2:"); 
print("-25*I1+41*I2=0");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[1, 0],[-25 ,41]]);##solving equation in matrix form
B=([[3] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];

print("I2 = 1.83 A");
print("Writing Vth equation,");
a=1.83;
v=-20.+(10.*a)+(6.*a);
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the current source of 50 A by an open circuit ");
x=25.;
y=16.;
m=((x*y)/(x+y));
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(v**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
I1=3 A
Applying KVL to the mesh 2:
-25*I1+41*I2=0
[matrix([[ 3.        ],
        [ 1.82926829]])]
I2 = 1.83 A
Writing Vth equation,

Vth =  9.28  V
replacing the current source of 50 A by an open circuit 

Rth =  9.76  Ohm
For maximum power transfer

Rth = RL =  9.76  Ohm

Pmax =  2.21  W

Ex46-pg3.52

In [8]:
##Network Theorem 1
##page no-3.52
##example3.46
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("I2-I1=2");##equation 1
print("I2=-3 A");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[-1, 1],[0 ,1]]);##solving equation in matrix form
B=([[2] ,[-3]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];

print("I1 = -5 A");
print("Writing Vth equation,");
a=-5.;
b=-3.;
v=8.-(2.*a)-b-6.;
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the voltage source with short circuit and current source by an open circuit ");
m=5.;
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(v**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
I2-I1=2
I2=-3 A
[matrix([[-5.],
        [-3.]])]
I1 = -5 A
Writing Vth equation,

Vth =  15.00  V
replacing the voltage source with short circuit and current source by an open circuit 

Rth =  5.00  Ohm
For maximum power transfer

Rth = RL =  5.00  Ohm

Pmax =  11.25  W

Ex47-pg3.53

In [10]:
##Network Theorem 1
##page no-3.52
##example3.46
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("By star-delta transformation");
a=5.;
b=20.;
c=9.;
v=100.;
i=v/(a+a+b+c+c);
print("Writing Vth equation,");
vth=v-(14.*i);
print'%s %.2f %s'%("\nVth = ",vth," V");
##calculation of Rth
print("replacing the voltage source with short circuit ");
m=23.92;
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(vth**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
By star-delta transformation
Writing Vth equation,

Vth =  70.83  V
replacing the voltage source with short circuit 

Rth =  23.92  Ohm
For maximum power transfer

Rth = RL =  23.92  Ohm

Pmax =  52.44  W

Ex48-pg3.55

In [11]:
##Network Theorem 1
##page no-3.55
##example3.48
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("Applying KVL to the mesh 1:"); 
print("35*I1-30*I2=60");##equation 1
print("Applying KVL to the mesh 2:"); 
print("I2=2");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[35, -30],[60 ,2]]);##solving equation in matrix form
B=([[60] ,[2]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];
print("I1 = 3.43 A");
print("Writing Vth equation,");
a=3.43;
b=2.;
v=20.*(a-b)+20.;
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the voltage source with short circuit and current source by an open circuit ");
x=15.;
y=20.;
m=((x*y)/(x+y));
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(v**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
Applying KVL to the mesh 1:
35*I1-30*I2=60
Applying KVL to the mesh 2:
I2=2
[matrix([[ 0.09625668],
        [-1.88770053]])]
I1 = 3.43 A
Writing Vth equation,

Vth =  48.60  V
replacing the voltage source with short circuit and current source by an open circuit 

Rth =  8.57  Ohm
For maximum power transfer

Rth = RL =  8.57  Ohm

Pmax =  68.89  W

Ex49-pg3.56

In [12]:
##Network Theorem 1
##page no-3.56
##example3.49
##calculation of Vth
print("Removing the variable resistor RL from the network:");
x=100.;
a=10.;
b=20.;
c=30.;
d=40.;
i1=x/(a+c);
i2=x/(b+d);
print'%s %.2f %s'%("\nI1 = ",i1," A");
print'%s %.2f %s'%("\ni2 = ",i2," A");
print("Writing Vth equation,");
x=2.5;
y=1.66;
v=(20.*y)-(10.*x);
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the voltage source of 100V with short circuit ");
m=((a*c)/(a+c))+((b*d)/(b+d));
print'%s %.2f %s'%("\nRth = ",m," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",m," Ohm");
##calculation of Pmax
n=(v**2)/(4.*m);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:

I1 =  2.50  A

i2 =  1.67  A
Writing Vth equation,

Vth =  8.20  V
replacing the voltage source of 100V with short circuit 

Rth =  20.83  Ohm
For maximum power transfer

Rth = RL =  20.83  Ohm

Pmax =  0.81  W

Ex50-pg3.57

In [13]:
##Network Theorem 1
##page no-3.57
##example3.50
##calculation of Vth
print("Removing the variable resistor RL from the network:");
print("Applying KVL to the mesh 1:"); 
print("9*I1-3*I2=72");##equation 1
print("Applying KVL to the mesh 2:"); 
print("-3*I1+9*I2=0");##equation 2
import numpy
from numpy import linalg
A=numpy.matrix([[9, -3],[-3 ,9]]);##solving equation in matrix form
B=([[72] ,[0]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];
print("I1 = 9 A");
print("I2 = 3 A");
print("Writing Vth equation,");
a=9.;
b=3.;
v=(6.*a)+(2.*b);
print'%s %.2f %s'%("\nVth = ",v," V");
##calculation of Rth
print("replacing the voltage source with short circuit and current source by an open circuit ");
x=6.;
y=2.;
z=4.;
m=((x*b)/(x+b))+2.;
l=((m*z)/(m+z));
print'%s %.2f %s'%("\nRth = ",l," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",l," Ohm");
##calculation of Pmax
n=(v**2)/(4.*l);
print'%s %.2f %s'%("\nPmax = ",n," W");
Removing the variable resistor RL from the network:
Applying KVL to the mesh 1:
9*I1-3*I2=72
Applying KVL to the mesh 2:
-3*I1+9*I2=0
[matrix([[ 9.],
        [ 3.]])]
I1 = 9 A
I2 = 3 A
Writing Vth equation,

Vth =  60.00  V
replacing the voltage source with short circuit and current source by an open circuit 

Rth =  2.00  Ohm
For maximum power transfer

Rth = RL =  2.00  Ohm

Pmax =  450.00  W

Ex51-pg3.58

In [14]:
##Network Theorem 1
##page no-3.58
##example3.51
##Calculation of Vth
print("from the figure");
print("Vth=4*I");
print("Applying KVL to the mesh");
print("0.5*Vth-8*I=-12");
import numpy
from numpy import linalg
A=numpy.matrix([[1, -4],[0.5 ,-8]]);##solving equation in matrix form
B=([[0] ,[-12]])
X=numpy.dot(numpy.linalg.inv(A),B);

print[X];

print("Vth=8 V");
##Calculation of Isc
v=8.;
i=12./4.;
print'%s %.2f %s'%("\nIsc = ",i," A");
##Calculation of Rth
r=v/i;
print'%s %.2f %s'%("\nRth = Vth/Isc = ",r," Ohm");
##calculation of RL
print("For maximum power transfer");
print'%s %.2f %s'%("\nRth = RL = ",r," Ohm");
##calculation of Pmax
x=v/(2.*r);
print'%s %.2f %s'%("\nIL = ",x," A");
n=(x**2)*r;
print'%s %.2f %s'%("\nPmax = ",n," W");
from the figure
Vth=4*I
Applying KVL to the mesh
0.5*Vth-8*I=-12
[matrix([[ 8.],
        [ 2.]])]
Vth=8 V

Isc =  3.00  A

Rth = Vth/Isc =  2.67  Ohm
For maximum power transfer

Rth = RL =  2.67  Ohm

IL =  1.50  A

Pmax =  6.00  W