#Example 1.1_a
#The equivalent circuit of the Motorola op-amp MC 1435 is shown in Figure.No-1.2
#Determine the collector current in each transistor and the dc voltage at the
#output terminal
#Variable declaration
Vcc=6 #Voltage in volts
Vbe5=0.7 #Voltage in volts
Vee=6 #Voltage in volts
Vbe3=6.7 #Voltage in volts
Vbe6=0.7 #Voltage in volts
Vbe7=0.7 #Voltage in volts
Rc1=6.7*10**3 #Resistance in ohms
Ic1=0 #initialization
#Calculation
Vc1=Vcc-Rc1*Ic1
Ve4=Vc1-Vbe5
I4=(Ve4+Vee)/(9.1*10**3+5.5*10**3)
Vb3=5.5*10**3*I4-Vee
Ve3=Vb3-Vbe3
Ie3=(Ve3+Vbe3)/3.3*10**3
Ic1=1.08*10**-3/2.765 #Since Ie3=2*Ic1
Vc1=Vcc-Rc1*Ic1
Ve4=Vc1-Vbe5
Ie4=(Ve4+Vee)/(29.2*10**3)
Ic5=Ie4
Vc5=Vcc-3.8*10**3*Ic5
Ve6=Vc5-Vbe6
Ie6=(Ve6+Vee)/(15*10**3)
Ve7=Ve6+Vbe7
I1=(Vcc-Ve7)/400
Ie8=I1
Ve8=-Vee+2*10**3*Ie8
#Result
print "Collector current Ic1 is",round(Ic1*10**3,2),"mA"
print "Voltage Vc1 is",round(Vc1,2),"V"
print "Voltage Ve4 is",round(Ve4,2),"V"
print "Current Ie4 is",round(Ie4*10**3,3),"mA"
print "Current Ic5 is",round(Ic5*10**3,3),"mA"
print "Voltage Vc5 is",round(Vc5,2),"V"
print "Voltage Ve6 is",round(Ve6,2),"V"
print "Current Ie6 is",round(Ie6*10**3,3),"mA"
print "Voltage Ve7 is",round(Ve7,2),"V"
print "Current I1 is",round(I1*10**3,2),"mA"
print "Current Ie8 is",round(Ie8*10**3,2),"mA"
print "Voltage Ve8 at the output terminal is",round(Ve8,2),"V"