In [1]:

```
from __future__ import division
#dc input power, ac output power, Efficiency
Ib=5e-3# # Base current in amperes
# From Fig. 13.8
RB=1.5e3# # in ohms
RC=16# # in ohms
bta=40#
VCC=18# # in volts
VBE=0.7# # in volts
IBQ=(VCC-VBE)/RB# # in amperes
ICQ=bta*IBQ# # in amperes
Pi_dc=VCC*ICQ# # dc input power in watts
Ic=bta*Ib# # in amperes
Po_ac=Ic**2*RC# # ac output power
eta=Po_ac*100/Pi_dc# # Efficiency in percentage
print "dc input power = %0.2f W "%Pi_dc
print "ac output power = %0.2f W "%Po_ac
print "Efficiency = %0.2f %%"%eta
```

In [2]:

```
from __future__ import division
from math import sqrt, pi
#Transformer turns ratio
def parallel(a,b):
c=a*b/(a+b)#
return c
RL=parallel(parallel(16,16),parallel(16,16))# # in ohms
RL_dash=8e3# # in ohms
TR=sqrt(RL_dash/RL)# # Transformer turns ratio
print "Transformer turns ratio = %0.2f "%TR
```

In [1]:

```
from __future__ import division
#Efficiency
P_ac=2# # in watts
ICQ=150e-3# # in amperes
VCC=36# # in volts
P_dc=VCC*ICQ# # in watts
eta=P_ac*100/P_dc# # Efficiency in percentage
print "Efficiency = %0.2f %%"%eta
```

In [3]:

```
from __future__ import division
from math import pi,sqrt
#Maximum input power, Maximum ac output power, Maximum conversion efficiency, Maximum power dissipated by each transistor
VCC=15# # in volts
RL=8# # in ohms
P_dc=2*VCC**2/(pi*RL)# # Maximum input power in watts
P_ac=VCC**2/(2*RL)# # Maximum ac output power in watts
eta=P_ac*100/P_dc# # Maximum efficiency in percentage
PD=2*VCC**2/(pi**2*RL)# # Maximum power dissipated in watts
PD_each=PD/2# # Maximum power dissipated by each transistor in watts
print "Maximum input power = %0.2f W "%P_dc
print "Maximum ac output power = %0.2f W "%P_ac
print "Maximum conversion efficiency = %0.2f %% "%eta
print "Maximum power dissipated by each transistor = %0.2f W "%PD_each
```

In [4]:

```
from __future__ import division
from math import pi,sqrt
#Supply voltage, Peak current drawn from each supply, Total supply power, Power conversion efficiency, Maximum power that each transistor can dissipate safely
P_ac=20# # Average power delivered in watts
RL=8# # Load in ohms
Vm=sqrt(2*P_ac*RL)# # Peak output voltage in volts
VCC=Vm+5# # Supply voltage in volts
Im=Vm/RL# # Peak current drawn from each supply in amperes
P_dc=2*Im*VCC/pi# # Total supply power in watts
eta=P_ac*100/P_dc# # Power conversion efficiency in percentage
PD=2*VCC**2/(pi**2*RL)# # Maximum power dissipated in watts
PD_each=PD/2# # Maximum power dissipated by each transistor in watts
print "Supply voltage = %0.2f V "%VCC
print "Peak current drawn from each supply = %0.2f A "%Im
print "Total supply power = %0.2f W "%P_dc
print "Power conversion efficiency = %0.2f %% "%eta
print "Maximum power that each transistor can dissipate safely = %0.2f W "%PD_each
```

In [5]:

```
from __future__ import division
from math import pi,sqrt
#Thermal resistance, Power rating at 70°C, Junction temperature at 100 mW
TAo=25# # in °C
PDo=200# # in mili-watts
Tj_max=150# # Maximum junction temperature in °C
T=70# # in °C
P=100# # in mili-watts
TA=50# # Ambient temperature in °C
theta=(Tj_max-TAo)/PDo# # Thermal resistance in °C per mili-watts
PR=(Tj_max-T)/theta# # Power rating at 70 °C in mili-watts
Tj=TA+theta*P# # Junction temperature at 100 mW in °C
print "Thermal resistance = %0.2f °C/mW "%theta
print "Power rating at 70 °C = %0.2f mW "%PR
print "Junction temperature at 100 mW = %0.2f °C "%Tj
```