#Example 2.1_a
#Determine the Output voltage for open-loop differential amplifier for figure 2_9
#Variable declaration
vin1=5*10**-6 #input voltage in volts
vin2=-7*10**-6 #input voltage in volts
A=200000 #Voltage gain
#Calculation
vo=A*(vin1-vin2) #Output voltage in volts
#Result
print "Output voltage is vo",vo,"Volts"
#Example 2.1_b
#Determine the Output voltage for open-loop differential amplifier for figure 2_9
#Variable declaration
vin1=10*10**-3 #input voltage in volts
vin2=20*10**-3 #input voltage in volts
A=200000 #Voltage gain
#Calculation
vo=A*(vin1-vin2) #Output voltage in volts
#Result
print "Output voltage is vo",vo,"Volts"
#Example 2.2_a
#Determine the Output voltage for an inverting amplifier for figure 2_10
#Variable declaration
vin1=20*10**-3 #input voltage in volts
A=200000 #Voltage gain
#Calculation
vo=-A*(vin1) #Output voltage in volts
#Result
print "Output voltage is vo",vo,"Volts"
#Example 2.2_b
#Determine the Output voltage for an inverting amplifier for figure 2_10
#Variable declaration
vin1=-50*10**-6 #input voltage in volts
A=200000 #Voltage gain
#Calculation
vo=-A*(vin1) #Output voltage in volts
#Result
print "Output voltage is vo",vo,"Volts"