import math
#initialisation of variables
Rl=10.0 #in K
Rs=1.0 #in K
hie=1.1 #in K
hre=2.5*(10**-4)
hfe=50.0
hoe=25*(10**-3) #in K^-1
#Calculations
Ai= -hfe/(1+(hoe*Rl)) #Current Gain or Current Amplification
print("Ai= %.2f " %Ai)
Ri = hie + (hre*Rl*Ai)
print("Ri= %.2f K" %Ri)
Av=(Ai*Rl)/Ri #Voltage Gain
print("Av= %.2f " %Av)
Avs=(Av*Ri)/(Ri+Rs) #Overall Voltage Gain taking source resistance into account
print("Avs= %.2f " %Avs)
Ais=(Ai*Rs)/(Ri+Rs) #Overall current gain taking source resistance into account
print("Ais= %.2f " %Ais)
#Results
Yo=hoe-((hfe*hre)/(hie+Rs)) #Admittance
print("Yo= %.2f K^-1 " %Yo)
Zo = 1.0/Yo #Impedence
print("Zo= %.2f K " %Zo)
import math
#initialisation of variables
#Yo = I/Vo
#When current in a short circuit placed across the output terminals and V is the open circuit voltage
print('When current in a short circuit placed across the output terminals and V is the open circuit voltage')
print('I = -hf*I1=-(hf*Vs)/(Rs+hi)')
#Applying KVL
print('Vs = I1*(Rs+hi)+hr*V = -ho*V*(Rs+hi)/hf+hr*V')
print('or')
print('V = -(hf*Vs/(Rs+hi))/(ho-hf*hr(Rs+hi))')
import math
#initialisation of variables
hie=1.1#in K
hre=2.5*(10^-4)
hfe=50
hoe=25*(10^-3)#in K^-1
r=200#in K
Rs=10#in K
Ri=1#in K
Rl=10#in K
#Calculations
rl=(r*Rs)/(r+Rs)#in K
Ai = -hfe/(1+(hoe*rl))#Current Gain
print("Ai = %.2f " %Ai)
Ri = hie + (hre*Ai*rl)
print("Ri = %.2f K" %Ri)
Av=(Ai*rl)/Ri#Voltage Gain
print("Av = %.2f " %Av)
k = r/(1-Av)
ri = (Ri*k)/(Ri+k)
print("ri = %.2f K" %ri)
#Results
Avs = Av*(ri/(ri+Rs))#Overall voltage Gain taking Source resistance into account
print("Avs = %.2f " %Avs)
ai = Avs*((ri+Rs)/Rl)
print("ai = -I2/I1 = %.2f " %ai)
import math
#initialisation of variables
hie = 2#in K
hfe = 50
hre = 6*(10^-4)
hoe = 25*(10^-3)#in K^-1
hic=2#in K
hfc=-51
hrc=1
hoc=25*(10^-3)#/in K^-1
Re2=5#in K
Rs=1#in K
Rc1=5#in K
#The Second Stage
#Calculations
Rl = Re2
Ai2 = -hfc/(1+(hoc*Re2))#Current Gain in @nd Transistor
print("Ai2 = %.2f " %Ai2)
Ri2 = hic + (hrc*Ai2*Re2)
print("Ri2 = %.2f K" %Ri2)
Av2 = (Ai2*Re2)/Ri2#Voltage Gain in 2nd Transistor
print("Av2 = %.2f " %Av2)
#The First Stage
Rl1 = (Rc1*Ri2)/(Rc1+Ri2)
print("Rl1 = %.2f K" %Rl1)
Ai1 = -hfe/(1+(hoe*Rl1))#Current Gain in 1st Transistor
print("Ai1 = %.2f " %Ai1)
Ri1 = hie + (hre*Ai1*Rl1)
print("Ri1 = %.2f K" %Ri1)
Av1 = (Ai1*Rl1)/Ri1#Voltage Gain in 1st Transistor
print("Av1 = %.2f " %Av1)
print('The output Admittance of Transistor')
Yo1 = hoe - ((hfe*hre)/(hie+Rs))
print("Yo= %.2f K^-1 " %Yo)
Ro1 = 1/Yo1
#Output Impedence of First Stage
print('Output Impedence of First Stage')
ro1 = (Ro1*Rc1)/(Ro1+Rc1)
print("ro1= %.2f K " %ro1)
rs2 = ro1
Yo2 = hoc - ((hfc*hrc)/(hic+rs2))
print("Yo2= %.2f K^-1 " %Yo2)
A1 = (Ai2*Ai2*Rc1)/(Ri2+Rc1)#Overall Current gain
print("A1 = %.2f " %A1)
Av = Av2*Av1#Overall Voltage Gain
print("Voltage Gain Av = %.2f " %Av)
print(Av,' = Av=')
#Results
Avs = (Av*Ri1)/(Ri1+Rs)#Overall Voltage gain with Source Impedence
print("Overall Voltage gain taking Source Impedence into account = Avs = %.2f " %Avs)
import math
#initialisation of variables
hie = 2#in K
hfe = 50
hre = 6*(10^-4)
hoe = 25*(10^-3)#in K^-1
hic=2#in K
hfc=-51
hrc=1
hoc=25*(10^-3)#/in K^-1
Re2=5#in K
Rs=5#in K
Rc1=5#in K
#Calculations
#For the CC output Stage
print('For the CC output Stage')
Rl = Re2
Ai2 = 1+ hfe#Current gain in 2nd Transistor
print("Ai2= %.2f " %Ai2)
Ri2 = hie+((1+hfe)*Rl)
print("Ri2= %.2f K" %Ri2)
Av2=1-(hie/Ri2)#voltage gain in 2nd transistor
print("Av2= %.2f " %Av2)
#For the CE input Stage
print('For the CE input Stage')
Ai1=-hfe#Current gain in 1st transistor
Ri1 = hie
print("Ai1= %.2f " %Ai1)
Rl1=(Rc1*Ri2)/(Rc1+Ri2)
print("Rl1= %.2f K" %Rl1)
Av1=(Ai1*Rl1)/Ri1#Voltage gain in 1st transistor
print("Av1= %.2f " %Av1)
ro1=Rc1
Ro2 = (hie+Rs)/(1+hfe)
ro2=(Ro2*Rl)/(Ro2+Rl)
print("Effective Source Impedence = %.2f k" %ro2)
Av = Av1*Av2#Overall voltage gain
#Results
print("Overall Voltage Gain= %.2f k" %Av)
Ai = Ai1*Ai2*(Rc1/(Rc1+Ri2))#Overall current Gain
print("Overall Current Gain= %.2f k" %Ai)