Chapter 1 Circuit Analysis Port Point of View

Example 1.2 , Page no:4

In [1]:
import math
from __future__ import division

#initialisation of variables
R1=1 #ohm
R2=1 #ohm
R3=1 #ohm
Vs=10 #simWtv
Vb=10 #v
a=0
Is=3 #A

#CALCULATIONS
V21=1/3*Vs #simWtv
i21=V21/R2
temp=R1*R2/(R1+R2) #Temp=R1||R2
i32=Vb/(R3+temp)
i22=(R1/(R1+R2))*i32
i2=i21+i22
i1=(Vs/(R1+R2))

#RESULTS
print"Find the current i2 by superposition theorem";
print"the current i2 by superposition theorem =",round(i2,3),"A";
Find the current i2 by superposition theorem
the current i2 by superposition theorem = 6.667 A

Example 1.3 , Page no:5

In [2]:
import math
from __future__ import division

#initialisation of variables
Va=4 #V
Ia=2 #A
R1=2 #ohm
R2=3 #ohm

#CALCULATIONS
Vth=Va+Ia*R1
Zth=R1+R2

#RESULTS
print"Find the Thevenin equivalent voltage VTh and impedance ZTh";
print"Thevenin equivalent voltage VTh  is =",round(Vth),"V";
print"Impedance ZTh is =",round(Zth,3),"Ohm";
Find the Thevenin equivalent voltage VTh and impedance ZTh
Thevenin equivalent voltage VTh  is = 8.0 V
Impedance ZTh is = 5.0 Ohm

Example 1.4 , Page no:6

In [3]:
import math
from __future__ import division

#initialisation of variables
Va=4 #V
a=0.25 #A/V
R1=2 #ohm
R2=3 #ohm

#CALCULATIONS
Vth=Va/(1-a*R1)
Vdp=R1+R2
Idp=1-a*R1
Zth=Vdp/Idp

#RESULTS
print"Find the Thevenin equivalent voltage VTh and impedance ZTh";
print"Thevenin equivalent voltage VTh  is =",round(Vth,3),"V";
print"Impedance ZTh is =",round(Zth,3),"Ohm";
Find the Thevenin equivalent voltage VTh and impedance ZTh
Thevenin equivalent voltage VTh  is = 8.0 V
Impedance ZTh is = 10.0 Ohm

Example 1.6 , Page no:17

In [4]:
import math
from __future__ import division

#initialisation of variables
Va=4.0 #V
a=0.25 #A/V
R1=2 #ohm
R2=3 #ohm
I=2
Zth=5

#CALCULATIONS
Ia=(Va/(R1+R2))+((R1*I)/(R1+R2))
Yn=1/Zth

#RESULTS
print"Find the Norton equivalent current IN and admittance YN";
print"Norton equivalent current IN  is =",round(Ia,2),"V";
print"Admittance YN is =",round(Yn,2),"Ohm";
Find the Norton equivalent current IN and admittance YN
Norton equivalent current IN  is = 1.6 V
Admittance YN is = 0.2 Ohm

Example 1.7 , Page no:19

In [5]:
import math
from __future__ import division

#initialisation of variables
V1=10 #V
V2=15 #V
R1=4 #ohm
R2=6 #ohm

#CALCULATIONS
I=(V1-V2)/(R1+R2)
Vth=V1-I*R1
Zth=(R1*R2)/(R1+R2)

#RESULTS
print"Find the The´venin equivalent for the network to the left of terminals a; b.";
print"The value of I is =",round(I,3),"A";
print"The value of Thevenin Equivalent voltage=",round(Vth,3),"V";
print"The value of Thevenin Impedance =",round(Zth,3),"ohm";
Find the The´venin equivalent for the network to the left of terminals a; b.
The value of I is = -0.5 A
The value of Thevenin Equivalent voltage= 12.0 V
The value of Thevenin Impedance = 2.4 ohm

Example 1.8 , Page no:19

In [6]:
import math
from __future__ import division

#initialisation of variables
V1=10 #V
V2=15 #V
R1=4 #ohm
R2=6 #ohm

#CALCULATIONS
Iab1=V1/R1
Iab2=V2/R2
In=Iab1+Iab2
Zth=(R1*R2)/(R1+R2)
Yn=1/Zth #Rth=Zth

#RESULTS
print"Find the Norton equivalent for the network to the left of termin";
print"Then by superpostion";
print"The value of In =",round(In,3),"A and Yn=",round(Yn,3),"A";
Find the Norton equivalent for the network to the left of termin
Then by superpostion
The value of In = 5.0 A and Yn= 0.417 A

Example 1.9 , Page no:20

In [7]:
import math
from __future__ import division

#initialisation of variables
V1=10 #V
V2=15 #V
R1=4 #ohm
R2=6 #ohm

#CALCULATIONS
I=(V1-V2)/(R1+R2)
Vth=V1-I*R1
Iab1=V1/R1
Iab2=V2/R2
In=Iab1+Iab2
Zth=Vth/In

#RESULTS
print"Find the The´venin impedance as the ratio of open-circuit voltage to short-circuit current";
print"The value of I is =",round(I,3),"A";
print"Then by superpostion"
print"The value of Zth is =",round(Zth,3),"ohm";
Find the The´venin impedance as the ratio of open-circuit voltage to short-circuit current
The value of I is = -0.5 A
Then by superpostion
The value of Zth is = 2.4 ohm

Example 1.11 , Page no:20

In [8]:
import math
from __future__ import division

#initialisation of variables
Va=4.0 #V
a=0.25 #A/V
R1=2 #ohm
R2=3 #ohm
I=2
Zth=5

#CALCULATIONS
Ia=(Va/(R1+R2))+((R1*I)/(R1+R2))
Yn=1/Zth

#RESULTS
print"Find the Norton equivalent current IN and admittance YN";
print"Norton equivalent current IN  is =",round(Ia,3),"V";
print"admittance YN is =",round(Yn,3),"Ohm";
Find the Norton equivalent current IN and admittance YN
Norton equivalent current IN  is = 1.6 V
admittance YN is = 0.2 Ohm

Example 1.12 , Page no:21

In [9]:
import math
from __future__ import division

#initialisation of variables
Va=4.0 #V
a=0.25 #A/V
R1=2 #ohm
R2=3 #ohm
I=2
Zth=5

#CALCULATIONS
V1=1.231*(10**-2) #V
I1=1*(10**-3) #A
Z11=V1/I1 #Ohm
V2=2.308*(10**-3) #V
I2=1*(10**-3) #A
Z12=V2/I2 #Ohm
V3=4.615*(10**-3) #V
I3=1*(10**-3) #A
Z21=V3/I3 #Ohm
V4=4.615*(10**-3) #V
I4=1*(10**-3) #A
Z22=V4/I4 #Ohm

#RESULTS
print"Solve Problem 1.11 using a SPICE method";
print"The value of Z11=",round(Z11,3),"Ohm";
print"The value of Z12=",round(Z12,3),"Ohm";
print"The value of Z21=",round(Z21,3),"Ohm";
print"The value of Z22=",round(Z22,3),"Ohm";
Solve Problem 1.11 using a SPICE method
The value of Z11= 12.31 Ohm
The value of Z12= 2.308 Ohm
The value of Z21= 4.615 Ohm
The value of Z22= 4.615 Ohm

Example 1.13 , Page no:22

In [10]:
import math
from __future__ import division

#initialisation of variables
V2=0 #V
Ia=0 #A
#h11=V1/I1
h11=10 #ohm
#Here I2=-I1
#Therefor h21=I2/I1 h21=-1
h21=-1 #ohm
I1=0 #A
h12=0.5 #Ohm
I2=1.3 #A
V2=6 #V

#CALCULATIONS
Ia=V2/6 #A
V1=V2-10*(0.3) #V
h22=I2/V2 #Ohm

#RESULTS
print"Determine the h parameters for the two-port network";
print"The value of h11=10.000 ohm h21=",round(h11,3),"ohm h12=",round(h21,3),"ohm h12=",round(h12,3),"ohm h22=",round(h22,3),"ohm";
Determine the h parameters for the two-port network
The value of h11=10.000 ohm h21= 10.0 ohm h12= -1.0 ohm h12= 0.5 ohm h22= 0.217 ohm

Example 1.15 , Page no:23

In [11]:
import math
from __future__ import division

#initialisation of variables
#Let V=V2/V1
RL=2000
h11=100 #ohm
h12=0.0025 #ohm
h21=20 #ohm
h22=0.001 #mS

#CALCULATIONS
V=1/(h12-(h11/h21)*((1/RL)+h22))

#RESULTS
print"Find the voltage-gain ratio V2/V1";
print"The value of V2/V1=",round(V,3);
Find the voltage-gain ratio V2/V1
The value of V2/V1= -200.0

Example 1.19 , Page no:25

In [12]:
import math
from __future__ import division

#initialisation of variables
T=1

#CALCULATIONS
I0=(1/T)*(4*(T/2)+1*(T/2)) #A
I=(2*(1/T)*((4**2)*(T/2)+(1**2)*(T/2)))**(1/2) #A

#RESULTS
print"Find (a) the average value of the current and (b) the rms value of the current.";
print"I0=",round(I0,3),"A";
print"I=",round(I,3),"A";
Find (a) the average value of the current and (b) the rms value of the current.
I0= 2.5 A
I= 4.123 A