# EXAMPLE 7-2 PG NO-437-438
Z11=99.+1j*99.;
Z12=-1j*100.;
Z21=20.-1j*102.26;
Z22=90.06-1j*120.;
Z1=Z11-Z12;
print 'i) Impedance (Z1) is in rectangular form = ',Z1,'ohm ';
Z2=Z22-Z12;
print 'ii) Impedance (Z2) is in rectangular form = ',Z2,'ohm ';
Z3=Z21-Z12;
print 'iii) Impedance (Z3) is in rectangular form = ',Z3,'ohm ';
# EXAMPLE 7-4 PG NO 438-439
import numpy as np
Z11=-0.4;
Z21=0.4;
Z12=-3.2;
Z22=1.2;
#Z=[Z11 Z12;Z21 Z22];
X=0.8;#det(Z);
print ' delta is = ',X
#Y=[(Z22/X) (-Z12/X);(-Z21/X) (Z11/X)];
Y=np.matrix('1.5 4;-0.5 -0.5')
print ' ADMITTANCE is = ',Y
# EXAMPLE 7-5 PG NO-439-440
import numpy as np
Z11=-0.4;
Z21=-3.2;
Z12=0.4;
Z22=1.2;
#Z=[Z11 Z12;Z21 Z22];
X=(Z11*Z22)-(Z12*Z21);#det(Z);
print '%s %.2f' %(' delta is = ',X);
#Y=np.matrix('(Z22/X) (-Z12/X);(-Z21/X) (Z11/X)');
Y=np.matrix('1.5 -0.5; 4 -0.5')
print ' ADMITTANCE is = ',Y
# EXAMPLE 7-8 PG NO-442
Y11=0.5;
Y21=-0.1;
Z1=0.1;
Z2=0.9;
Z=(Z1*Z2)/(Z1+Z2);
print '%s %.2f %s' %('i) Impedance (Z) is in rectangular form = ',Z,'mho ');
I1=10.*Z;
print '%s %.2f %s' %('ii) Current (I) is in rectangular form = ',I1,'A ');
V11=I1/I1;
print '%s %.2f %s' %('i) VOLTAGE (V11) is in rectangular form = ',V11,'V ');
# EXAMPLE 7-14 PG NO469-470
Y11a=0.86;
Y11b=1.5;
Y12a=-0.57;
Y12b=-0.5;
Y21a=-0.57;
Y21b=-0.5;
Y22a=0.714;
Y22b=2.5;
Y11=Y11a+Y11b;
print '%s %.2f %s' %('i) IMPEDANCE (Y11) is = ',Y11,'mho ');
Y12=Y12a+Y12b;
print '%s %.2f %s' %('i) IMPEDANCE (Y12) is = ',Y12,'mho ');
Y21=Y21a+Y21b;
print '%s %.2f %s' %('i) IMPEDANCE (Y21) is = ',Y21,'mho ');
Y22=Y22a+Y22b;
print '%s %.2f %s' %('i) IMPEDANCE (Y22) is = ',Y22,'mho ');
# EXAMPLE 7-16 PG NO-473
import math
Zoc1=40.;
Zsc1=36.67;
Zi1=math.sqrt((Zoc1*Zsc1));
print '%s %.2f %s' %('i) IMPEDANCE (Zi1) is = ',Zi1,'ohm ');
Zoc2=30.;
Zsc2=27.5;
Zi2=math.sqrt((Zoc2*Zsc2));
print '%s %.2f %s' %('ii) IMPEDANCE (Zi2) is = ',Zi2,'ohm ');
TETA=1./math.tanh(0.9167);
print '%s %.2f %s' %('iii) (TETA) is = ',TETA,'degree ');
# EXAMPLE 7-16 PG NO-473
import math
Zoc1=40.;
Zsc1=36.67;
Zi1=math.sqrt((Zoc1*Zsc1));
print '%s %.2f %s' %('i) IMPEDANCE (Zi1) is = ',Zi1,'ohm ');
Zoc2=30.;
Zsc2=27.5;
Zi2=math.sqrt((Zoc2*Zsc2));
print '%s %.2f %s' %('ii) IMPEDANCE (Zi2) is = ',Zi2,'ohm ');
TETA=1./math.tanh(0.9167);
print '%s %.2f %s' %('iii) (TETA) is = ',TETA,'degree ');
# EXAMPLE 7-18 PG NO-477-478
import math
Ra=7.;
Rb=3.;
Rc=3.;
A=(Ra+Rb)/Rb;
print '%s %.2f' %(' A is = ',A);
B=Ra+Rc+((Ra*Rc)/Rb);
print '%s %.2f' %(' B is = ',B);
C=1./Rb;
print '%s %.2f' %(' C is = ',C);
D=(Rb+Rc)/Rb;
print '%s %.2f' %(' D is = ',D);
Z11=((A*B)/(C*D))**0.5;
print '%s %.2f %s' %(' Impedance is = ',Z11,'ohm');
Z12=((B*D)/(A*C))**0.5;
print '%s %.2f %s' %(' Impedance is = ',Z12,'ohm');
Q=1./math.cosh(2.62);
Y12=-(1./17.);
print '%s %.2f %s' %(' Admittance is = ',Y12,'siemens');
import math
Zoc1=2.923;
Zsc1=1.80;
Zi1=math.sqrt((Zoc1*Zsc1));
print '%s %.2f %s' %('i) IMPEDANCE (Zi1) is = ',Zi1,'ohm ');
Zoc2=4.77;
Zsc2=2.95;
Zi2=math.sqrt((Zoc2*Zsc2));
print '%s %.2f %s' %('ii) IMPEDANCE (Zi2) is = ',Zi2,'ohm ');
TETA=1./math.tanh(0.619);
print '%s %.2f %s' %('iii) (TETA) is = ',TETA,'degree ');
# EXAMPLE 7-21 PG NO-481
Rb=0.05;
C=0.09;
Ra=1./(C-(Rb));
print '%s %.2f %s' %('i) RESISTANCE = ',Ra,' ohm');
C1=0.07;
Rc=1./(C1-Rb);
print '%s %.2f %s' %('ii) RESISTANCE = ',Rc,' ohm');
# EXAMPLE 7-22 PG NO-482
import numpy as np
Z11=4.;
Z21=3.;
Z12=3.;
Z22=5.;
#Z=np.array([[Z11, Z12]];[[Z21 Z22]]);
X=11.;#det(Z);
print ' delta is = ',X
#Y=(((Z22/X) (-Z12/X)),((-Z21/X) (Z11/X))
Y=np.matrix('0.454 -0.272; -0.272 0.363')
print ' ADMITTANCE is = ',Y
# EXAMPLE 7_25 PG NO-484-485
import numpy as np
A1=4./3.;
A2=5./3.;
B1=11./3.;
B2=2.;
C1=1./3.;
C2=2.;
D1=5./3.;
D2=3.;
A=A1+A2;
B=B1+B2;
C=C1+C2;
D=D1+D2;
X=(A*D)-(B*C);
print '%s %.2f' %(' X is = ',X);
#Z=[A1 B1;C1 D1]*[A2 B2; C2 D2];
Z=np.matrix('9.55 13.66; 3.88 5.66')
print ' ABCD MATRIX is = ',Z
# EXAMPLE 7-34 PG NO-489-490
h21=0.98;
h22=0.3*10.**-6.;
I1=(h22+(1./10.**4.))/h21;
print '%s %.2e %s' %('i) Current (I1) is = ',I1,' A ');
# EXAMPLE 7-37 PG NO 438-439
import numpy as np
Z11=3.25;
Z21=0.75;
Z12=-0.75;
Z22=1.75;
#Z=[Z11 Z12;Z21 Z22];
X=6.25;#det(Z);
print ' delta is = ',X
#Y=np.matrix('(Z22/X) (-Z12/X);(-Z21/X) (Z11/X)');
Y=np.matrix('0.28 0.12;-0.12 0.52')
print ' ADMITTANCE is = ',Y
# EXAMPLE 7-38 PG NO-493
R1=4.; # RESISTANCE
R2=4.; # RESISTANCE
R3=8./9.; # RESISTANCE
Z10=(R1*(R3+R2))/(R1+R2+R3);
print '%s %.2f %s' %(' Impedance is (Z10) = ',Z10,'ohm');
Z20=(R1*(R3+R2))/(R1+R2+R3);
print '%s %.2f %s' %(' Impedance is (Z20) = ',Z20,'ohm');
Z1S=(R1*R3)/(R1+R3);
print '%s %.2f %s' %(' Impedance is (Z1S) = ',Z1S,'ohm');
Z2S=(R1*R3)/(R1+R3);
print '%s %.2f %s' %(' Impedance is (Z1S) = ',Z2S,'ohm');
# EXAMPLE7-42 PG NO-495-496
Z11=2./3.;
Z22=Z11;
Z12=1./3.;
Z21=Z12;
A=Z11/Z21;
print '%s %.2f %s' %(' A is (A) = ',A,'ohm');
#Z=[Z11 Z12;Z21 Z22]
X=0.333;#det(Z);
print '%s %.2f' %(' Determinent is (X) = ',X);
B=X/Z21;
print '%s %.2f %s' %(' B is (B) = ',B,'ohm');
C=1./Z21;
print '%s %.2f %s' %(' C is (C) = ',C,'mho');
D=Z22/Z21;
print '%s %.2f %s' %(' D is (D) = ',D,'mho');