#Initialisation
Ri=1000 #Input Resistance of amplifier in Ohm
Rs=100 #Output Resistance of sensor in Ohm
Rl=50 #Load Resistance
Ro=10 #Output Resistance of amplifier in Ohm
Av=10 #Voltage gain
Vs=2 #Sensor voltage
#Calculation
Vi=Ri*Vs*(Rs+Ri)**-1 #Input Voltage of Amplifier
Vo=Av*Vi*Rl*(Ro+Rl)**-1 #Output Voltage of Amplifier
#Result
print'Ouput voltage of and amplifier = %.1f V'%Vo
#Initialisation
Vo=15.2 #Output Voltage of Amplifier
Vi=1.82 #Input Voltage of Amplifier
#Calculation
Av=Vo/Vi #Voltage gain
#Result
print'Voltage Gain, Av = %.2f'%Av
#Initialisation
Av=10 #Voltage gain
Vi=2 #Input Voltage of Amplifier
Rl=50 #Load Resistance
Ro=0 #Output Resistance of amplifier in Ohm
#Calculation
Vo=Av*Vi*Rl/(Ro+Rl) #Output Voltage of Amplifier
#Result
print'Ouput voltage of and amplifier = %.1f V'%Vo
#Initialisation
Vo=15.2 #Output Voltage
Rl=50 #Load Resistance
#Calculation
Po=(Vo**2)/Rl #Output Power
#Result
print'Output Power, Po = %.1f W'%Po
#Initialisation
Vi=1.82 #Input Voltage of Amplifier
Ri=1000 #Input Resistance of amplifier in Ohm
Vo=15.2 #Output Voltage of Amplifier
Rl=50 #Load Resistance
#Calculation
Pi=(Vi**2)*Ri**-1 #Input Power in Watt
Po=(Vo**2)*Rl**-1 #Output Power in Watt
Ap=Po/Pi #Power Gain
#Result
print'Power Gain, Ap = %d'%Ap #wrong answer in textbook
import math
#Initialisation
P=1400 #Power gain
#Calculation
pdb=10*math.log10(P) #Power Gain in dB
#Result
print'Power Gain (dB) = %.1f dB'%pdb