##Ex7_1
import math
Ie = 6.0*10**-3
Ve = 1.1
Re = Ve/Ie
print'%s %.2f %s'%("Ie = ",(Ie),"A")##current flowing in emitter resistance
print'%s %.2f %s'%("Ve = ",(Ve),"V")##voltage drop across emitter resistance
print'%s %.2f %s'%("Re = ",(Re),"ohm")##emitter resistance
##Ex7_2
import math
TA = 30.
TJ = 48.
PD = 4.
TR = (TJ - TA)/PD
print'%s %.2f %s'%("TA = ",(TA),"degreeC")##ambient temperature at which transistor is operated
print'%s %.2f %s'%("TJ = ",(TJ),"degreeC")##junction temperature
print'%s %.2f %s'%("PD = ",(PD),"W")##dissipated power
print'%s %.2f %s'%("TR = (TJ - TA)/PD = ",(TR),"degreeC/W")##termal resistance
##Ex7_3
import math
TA = 28.
TJ = 50.
TR = 10.
PD = (TJ - TA)/TR
print'%s %.2f %s'%("TA = ",(TA),"degreeC")##ambient temperature at which transistor is operated
print'%s %.2f %s'%("TJ = ",(TJ),"degreeC")##junction temperature
print'%s %.2f %s'%("TR = ",(TR),"degreeC/W")##termal resistance
print'%s %.2f %s'%("PD = (TJ - TA)/TR = ",(PD),"W")##dissipated power
##Ex7_4
import math
RC = 4.*10**3
RB = 1.2*10**6
VCC = 9.
VBE = .2
beta = 80.
print'%s %.2f %s'%("RC = ",(RC),"ohm")##collector resistance
print'%s %.2f %s'%("RB = ",(RB),"ohm")##base resistance
print'%s %.2f %s'%("VCC = ",(VCC),"V")##collector supply voltage
print'%s %.2f %s'%("VBE = ",(VBE),"V")##voltage across base and emittter
print'%s %.2f %s'%("beta = ",(beta),"")##current gain
IB = (VCC - VBE)/RB
print'%s %.2e %s'%("IB = (VCC - VBE)/RB = ",(IB),"A")##base current
IC = beta*IB
print'%s %.2e %s'%("IC = beta*IB = ",(IC),"A")##collector current
VCE = VCC - (IC*RC)
print'%s %.2f %s'%("VCE = VCC - (IC*RC) = ",(VCE),"V")##collector-emitter voltage
print'%s %.2f %s %.4f %s'%("The Q-point is(",(VCE),"V"and " ",(IC),"A")##Q-point in fixed bias circuit
##Ex7_5
import math
VBE = 0.6
beta = 100.
print'%s %.2f %s'%("beta = ",(beta),"")##current gain
print'%s %.2f %s'%("VBE = ",(VBE),"V")##voltage across base and emitter
##according to given circuit;
VCC = 12.
RC = 5.*10**3
print'%s %.2f %s'%("VCC = ",(VCC),"V")##collector supply voltage
print'%s %.2f %s'%("RC = ",(RC),"ohm")##collector resistance
## optimum operating point is half of (VCC/RC)
IC = (1./2.)*(VCC/RC)
print'%s %.4f %s'%("IC = VCC/(2*RC) = ",(IC),"A")##collector current at optimum operating point
IB = IC/beta
print'%s %.2e %s'%("IB = IC/beta = ",(IB),"A")##base current
##from the closed circuit in the given fig., we have
print("IB*RB = VCC - VBE")
RB = (VCC - VBE)/IB
print'%s %.2f %s'%("RB = (VCC - VBE)/IB = ",(RB),"ohm")##veriable resistance across base-collector as given in circuit
##Ex7_6
import math
RC = 2.*10**3
beta = 100.
VCC = 9.
RB = 500.*10**3
VBE = 0.6
print'%s %.2f %s'%("RC = ",(RC),"ohm")##collector resistance
print'%s %.2f %s'%("beta = ",(beta),"")##current gain
print'%s %.2f %s'%("VCC = ",(VCC),"V")##collector supply voltage
print'%s %.2f %s'%("RB = ",(RB),"ohm")##base resistance
print'%s %.2f %s'%("VBE = ",(VBE),"V")##base-emitter voltage
IB = (VCC - VBE)/RB
print'%s %.2e %s'%("IB = (VCC - VBE)/RB = ",(IB),"Amp")##base current
IC = beta*IB
print'%s %.4f %s'%("IC = beta*IB = ",(IC),"A")##collector current
VCE = VCC - IC*RC
print'%s %.2f %s'%("VCE = VCC - IC*RC = ",(VCE),"V")##collector-emitter voltage
print'%s %.2f %s %.2e %s '%("operating point is(",(VCE),"V " and " ",(IC),"A)")
##Ex7_7
import math
VCC = 12.
RB = 300.*10**3
RC = 1.5*10**3
Re = 2.*10**3
beta = 100.
print'%s %.2f %s'%("VCC = ",(VCC),"V")##collector supply voltage
print'%s %.2f %s'%("RB = ",(RB),"ohm")##base resistance
print'%s %.2f %s'%("RC = ",(RC),"ohm")##collector resistance
print'%s %.2f %s'%("Re = ",(Re),"ohm")##emitter resistance
print'%s %.2f %s'%("beta = ",(beta),"")##current gain
IB = VCC/(RB + beta*Re)
print'%s %.2e %s'%("IB = VCC/(RB + beta*Re) = ",(IB),"A")##base current
IC = beta*IB
print'%s %.2e %s'%("IC = beta*IB = ",(IC),"A")##collector current
IE = IB + IC
print'%s %.2e %s'%("IE = IB + IC = ",(IE),"A")##emitter current
VCE = VCC - IC*RC - IE*Re
print'%s %.2f %s'%("VCE = VCC - IC*RC - IE*Re = ",(VCE),"V")##collector-emitter voltage
print'%s %.2f %s %.4f %s '%("quiescent point is(",(VCE),"V " and "" ,(IC),"A)")
##Ex7_8
import math
VCC = 9.
RC = 3.*10**3
RB = 500.*10**3
beta = 100.
VBE = 0.7
print'%s %.2f %s'%("VCC = ",(VCC),"V")##collector supply voltage
print'%s %.2f %s'%("RC = ",(RC),"ohm")##collector resistance
print'%s %.2f %s'%("RB = ",(RB),"ohm")##base resistance
print'%s %.2f %s'%("beta = ",(beta),"")##current gain
print'%s %.2f %s'%("VBE = ",(VBE),"V")##emitter-base voltage
##for a Fixed Bais Circuit;
IB = (VCC - VBE)/RB
print'%s %.2e %s'%("IB = (VCC - VBE)/RB = ",(IB),"A")##base current
IC = beta*IB
print'%s %.2e %s'%("IC = beta*IB = ",(IC),"A")##collector current
VCE = VCC - IC*RC
print'%s %.2f %s'%("VCE = VCC - IC*RC = ",(VCE),"V")##collector-emitter voltage
print'%s %.2f %s %4f %s '%("operating point is(",(VCE),"V" and " ",(IC),"A)")
S = 1+beta
print'%s %.2f %s'%("S = 1 + beta = ",(S),"")##stability factor
## NOTE : in the textbook author has taken beta = 100 for calculation
## but has mention beta = 50 in Question
## I am working with beta = 100.
##Ex7_9
import math
R1 = 80.*10**3
R2 = 25.*10**3
Re = 2.*10**3
Rc = 2.*10**3
beta = 100.
VCC = 12.
VBE = 0.7
print'%s %.2f %s'%("R1 = ",(R1),"ohm")
print'%s %.2f %s'%("R2 = ",(R2),"ohm")
print'%s %.2f %s'%("Re = ",(Re),"ohm")##emitter resistance
print'%s %.2f %s'%("Rc = ",(Rc),"ohm")##collector resistance
print'%s %.2f %s'%("beta = ",(beta),"")##current gain
print'%s %.2f %s'%("VCC = ",(VCC),"V")##collector supply voltage
print'%s %.2f %s'%("VBE = ",(VBE),"V")##base-emitter voltage
Rb = R1*R2/(R1+R2)
print'%s %.2f %s'%("Rb = R1*R2/(R1+R2) = ",(Rb),"ohm")##base resistance
VB = VCC*(R2/(R1+R2))
print'%s %.2f %s'%("VB = VCC(R2/(R1+R2)) = ",(VB),"V")##base voltage
IB = (VB - VBE)/(Rb*(1+((1+beta)*(Re/Rb))))
print("IB = (VB - VBE)/(Rb*(1+((1+beta)*(Re/Rb))))")
print'%s %.2e %s'%(" = ",(IB),"A")##base current
IC = beta*IB
print'%s %.2e %s'%("IC = beta*IB = ",(IC),"A")##collector current
IE = IC
VCE = VCC - IC*Rc - IE*Re
print'%s %.2f %s'%("VCE = VCC - IC*Rc - IE*Re = ",(VCE),"V")##collector-emitter voltage
print'%s %.2f %s %.2e %s '%("operating point is(",(VCE),"V" and " ",(IC),"A)")
S = (1.+beta)*((1.+Rb/Re)/(1.+beta+Rb/Re))
print'%s %.2f %s'%("S = (1+beta)*[(1+Rb/Re)*(1+beta+Rb/Re)] = ",(S),"")
##Ex7_10
import math
delta_IC = 0.01*10**-3
delta_beta = 5.
print'%s %.2e %s'%("delta_IC = ",(delta_IC),"A")##change of collector current
print'%s %.2f %s'%("delta_beta = ",(delta_beta),"A")##change in current gain
print'%s %.2e %s'%("S'''' = delta_IC/delta_beta = ",(delta_IC/delta_beta),"")##stability
##Ex7_11
import math
TA = 30.
TJ = 48.
PD = 4.
TR = (TJ - TA)/PD
print'%s %.2f %s'%("TA = ",(TA),"degreeC")##ambient temperature at which transistor is operated
print'%s %.2f %s'%("TJ = ",(TJ),"degreeC")##junction temperature
print'%s %.2f %s'%("PD = ",(PD),"W")##dissipated power
print'%s %.2f %s'%("TR = (TJ - TA)/PD = ",(TR),"degreeC/W")##termal resistance
##Ex7_12
import math
TA = 28.
TJ = 50.
TR = 10.
PD = (TJ - TA)/TR
print'%s %.2f %s'%("TA = ",(TA),"degreeC")##ambient temperature at which transistor is operated
print'%s %.2f %s'%("TJ = ",(TJ),"degreeC")##junction temperature
print'%s %.2f %s'%("TR = ",(TR),"degreeC/W")##termal resistance
print'%s %.2f %s'%("PD = (TJ - TA)/TR = ",(PD),"W")##dissipated power