# A transistor has the following currents: Ib is 20 mA and Ic is 4.98 A. Calculate Ie.
# Given data
Ib = 20*10**-3# # Base current=20 mAmps
Ic = 4.98# # Collector current=4.98 Amps
Ie = Ic+Ib#
print 'The Emitter Current Ie = %0.2f Amps'%Ie
# A transistor has the following currents: Ie is 100 mA, Ib is 1.96 mA. Calculate Ic.
# Given data
Ie = 100.0*10**-3# # Emitter current=100 mAmps
Ib = 1.96*10**-3# # Base current=4.98 Amps
Ic = Ie-Ib#
print 'The Collector Current Ic = %0.5f Amps'%Ic
print 'i.e 98.04 mAmps'
# A transistor has the following currents: Ie is 50 mA, Ic is 49 mA. Calculate Ib.
# Given data
Ie = 50.0*10**-3# # Emitter current=50 mAmps
Ic = 49.0*10**-3# # Collector current=20 mAmps
Ib = Ie-Ic#
print 'The Base Current Ib = %0.4f Amps'%Ib
print 'i.e 1 mAmps'
# A transistor has the following currents: Ie is 15 mA, Ib is 60 uA. Calculate Alpha(dc).
# Given data
Ie = 15.*10**-3# # Emitter current=15 mAmps
Ib = 60.*10**-6# # Base current=60 uAmps
Ic = Ie-Ib#
Adc = Ic/Ie#
print 'The Value of Alpha(dc) = %0.4f'%Adc
# A transistor has the following currents: Ic is 10 mA and Ib is 50 uA. Calculate Beta(dc).
# Given data
Ic = 10.*10**-3# # Collector current=10 mAmps
Ib = 50.*10**-6# # Base current=50 uAmps
Bdc = Ic/Ib#
print 'The Value of Beta(dc) = %0.f'%Bdc
# A transistor has Beta(dc) of 150 and Ib of 75 uAmps. Calculate Ic.
# Given data
Bdc = 150.# # Beta(dc)=150
Ib = 75.*10**-6# # Base current=75 uAmps
Ic = Bdc*Ib#
print 'The Collector Current Ic = %0.5f Amps'%Ic
print 'i.e 11.25 mAmps'
# A transistor has Beta(dc) of 100. Calculate Alpha(dc).
# Given data
Bdc = 100.0# # Beta(dc)=100
Adc = Bdc/(1+Bdc)#
print 'The Value of Alpha(dc) = %0.4f'%Adc
# A transistor has Alpha(dc) of 0.995. Calculate Beta(dc).
# Given data
Adc = 0.995# # Alpha(dc)=100
Bdc = Adc/(1-Adc)#
print 'The Value of Beta(dc) =%0.2f'%Bdc
# Calculate Pd if Vcc is 10 V and Ib is 50 uAmps. Assume Beta(dc) is 100.
# Given data
Bdc = 100.# # Beta(dc)=100
Ib = 50.*10**-6# # Base current=50 uAmps
Vcc = 10.# # Supply voltage=10 Volts
Vce = Vcc
Ic = Bdc*Ib#
Pd = Vce*Ic#
print 'The Power Dissipation = %0.2f Watts'%Pd
print 'i.e 50 mWatts'
# The transistor has a power rating of 0.5 W. If Vce is 20 V, calculate the maximum allowable collector current, Ic, that can exist without exceeding the transistor’s power rating.
# Given data
Pdmax = 0.5# # Power dissipation(max)=0.5 Watts
Vce = 20.# # Voltage (collector to emitter)=20 Volts
Ic = Pdmax/Vce#
print 'The Maximum Allowable Collector Current Ic(max) = %0.3f Amps'%Ic
print 'i.e 25 mAmps'
# Assume that a transistor has a power rating Pd(max) of 350 mW at an ambient temperature Ta of 25°C. The derating factor is 2.8 mW/°C. Calculate the power rating at 50°C.
# Given data
f = 2.8*10**-3# # Derating factor=2.8 mW/°C
Pd = 350.*10**-3# # Power dissipation(max)=350 mWatts
Ta = 25.# # Ambient Temperature=25°C
Tp = 50.# # Power rating at 50°C
delT = Tp-Ta# # Difference between max and min temp
delPd = delT*f#
Prat = Pd-delPd#
print 'The Power Rating at 50°C = %0.2f Watts'%Prat
print 'i.e 280 mWatts'
%matplotlib inline
from matplotlib.pyplot import plot,xlabel,ylabel,show,title
# Solve for Ib, Ic, Vce. Also, Construct a dc load line showing the valuse of Ic(sat), Vce(off), Icq, Vceq.
# Given data
Vcc = 12.# # Supply voltage=12 Volts
Vbe = 0.7# # Base-Emitter Voltage=0.7 Volts
Rb = 390.*10**3# # Base Resistor=390K Ohms
Rc = 1.5*10**3# # Collector Resistor=1.5K Ohms
B = 150.# # Beta(dc)=150
Ib = (Vcc-Vbe)/Rb#
print 'The Base Current = %0.4f Amps.'%Ib
print 'Approx 28.97 mAmps'
Icq = B*Ib#
print 'The Collector Current = %0.4f Amps'%Icq
print 'Approx 4.35 mAmps'
Vceq = Vcc-(Icq*Rc)#
print 'The Voltage Collector-Emitter = %0.2f Volts'%Vceq
# For DC load line
Icsat = (Vcc/Rc)#
Vceoff = Vcc#
Vce1=[Vceoff, Vceq ,0]
Ic1=[0 ,Icq ,Icsat]
#To plot DC load line
print "Q(%f,%f)\n"%(Vceq,Icq)
plot(Vce1, Ic1)
plot(Vceq,Icq)
plot(0,Icq)
plot(Vceq,0)
plot(0,Icsat)
plot(Vceoff,0)
xlabel("Vce in volt")
ylabel("Ic in Ampere")
title("DC Load-line for Base-Biased Transistor Circuit")
show()
%matplotlib inline
from matplotlib.pyplot import plot,xlabel,ylabel,show,title
# Solve for Vb, Ve, Ic, Vc, and Vce. Also, calculate Ic(sat) and Vce(off). Finally, construct a dc load line showing the values of Ic(sat), Vce(off), Icq, and Vceq.
# Given data
R1 = 33.*10**3# # Resistor 1=33 kOhms
R2 = 5.6*10**3# # Resistor 2=5.6 kOhms
Rc = 1.5*10**3# # Collector resistance=1.5 kOhms
Re = 390.# # Emitter resistance=390 Ohms
Bdc = 200.# # Beta(dc)= 200
Vcc = 18.# # Supply voltage = 18 Volts
Vbe = 0.7# # Base-Emmiter Voltage=0.7 Volts
Vb = Vcc*(R2/(R1+R2))#
print 'The Base Voltage = %0.2f Volts'%Vb
Ve = Vb-Vbe#
print 'The Emmiter Voltage = %0.2f Volts'%Ve
Ie = Ve/Re# # Emitter current
Ic = Ie#
Vc = Vcc-(Ic*Rc)#
print 'The Collector Voltage = %0.2f Volts'%Vc
print 'Approx 10.65 Volts'
Vce = Vcc-(Ic*(Rc+Re))#
print 'The Collector-Emitter Voltage = %0.2f Volts'%Vce
print 'Approx 8.74 Volts'
Icsat = Vcc/(Rc+Re)#
print 'The Current Ic(sat) = %0.2f Amps'%Icsat
print 'i.e 9.52 mAmps'
Vceoff = Vcc#
print 'The Voltage Vce(off) = %0.2f Volts'%Vceoff
Icq = Ic
Vceq = Vce
Vce1=[Vcc, Vceq, 0]
Ic1=[0, Icq, Icsat]
#To plot DC load line
print "Q(%f,%f)\n"%(Vceq,Icq)
plot(Vce1, Ic1)
plot(Vceq,Icq)
plot(0,Icq)
plot(Vceq,0)
plot(0,Icsat)
plot(Vceoff,0)
xlabel("Vce in Volt")
ylabel("Ic in mAmps")
title("DC Load-line for Voltage Divider-Biased Transistor Circuit")
show()
# For the pnp transistor, solve for Vb, Ve, Ic, Vc, and Vce.
# Given data
R1 = 33.*10**3# # Resistor1=33 kOhms
R2 = 6.2*10**3# # Resistor2=6.2 kOhms
Rc = 2.*10**3# # Collector resistance=2 kOhms
Re = 500.# # Emitter resistance=500 Ohms
Vcc = 12.# # Supply voltage=12 Volts
Vbe = 0.7# # Base-Emmiter Voltage=0.7 Volts
Vb = -Vcc*(R2/(R1+R2))#
print 'The Base Voltage = %0.2f Volts'%Vb
print 'Approx -1.9 Volts'
Ve = Vb-(-Vbe)#
print 'The Emitter Voltage = %0.2f Volts'%Ve
print 'Approx -1.2 Volts'
Ic = -(Ve/Re)# # Ic =~ Ie
print 'The Collector Current = %0.2f Amps'%Ic
print 'Approx 2.4 mAmps'
Vc = -Vcc+(Ic*Rc)
print 'The Collector Voltage = %0.2f Volts'%Vc
Vce = -Vcc+(Ic*(Rc+Re))#
print 'The Collector-Emitter Voltage = %0.2f Volts'%Vce
# Calculate Ie and Vc
# Given data
Vee = 6.# # Supply voltage at emitter=6 Volts
Vcc = 15.# # Supply voltage at collector=15 Volts
Vbe = 0.7# # Base-Emmiter Voltage=0.7 Volts
Rc = 1.5*10**3# # Collector resistance=1.5 kOhms
Re = 1.*10**3# # Emitter resistance=1 kOhms
Ie = (Vee-Vbe)/Re#
print 'The Emitter current = %0.4f Amps'%Ie
print 'i.e 5.3 mAmps'
Ic = Ie# # Ic =~ Ie
Vc = Vcc-Ic*Rc#
print 'The Collector voltage = %0.2f Volts'%Vc