import math
#Variable Declaration
Vcc=20 #Supply Voltage(V)
Rsm=9.3*10**3 #Rsm=Rs+Rm(ohm)
Im=1*10**-3 #Emitter Current(A)
hfe=100 #Transistor h parameter
Vb1=0.7 #Base Emitter Voltage drop(V)
#Calculation
#To obtain meter current when E=10V
E=10 #Base input voltage(V)
Ve=E-Vb1 #Emitter Voltage(V) found using KVL aclong base loop
Im=Ve/Rsm #Emitter current
#With the transistor
Ib=Im/hfe #Base current is approximately equlat to Ie/hfe
Ri=E/Ib #Input resistance with transistor
#Without transistor
Ri1=Rsm #Input resistance without transistor
#Results
print "When E=10 V, meter current is",int(Im*10**3),"mA"
print
print "Input Impedance,"
print "with transistor=",round(Ri/10**6),"mega ohm"
print "without transistor=",Ri1/10**3,"kilo ohm"
import math
#Variable Declaration
R2=3.9*10**3 #in ohm
R3=3.9*10**3 #in ohm
Vcc=12 #in V
Vee=-12 #in V
Vbe=0.7 #Base Emitter voltage in V
#Calculation
#When E=0
E=0
Vr2=E-Vbe-Vee #KVL
Vr3=E-Vbe-Vee #KVL
I2=Vr2/R2 #Ohm's Law
I3=I2
print "When E=0V, I2=I3=",round(I3*10**3,1),"mA"
#When E=1
E=1 #in V
Vp=0 #in V
Ve1=E-Vbe #KVL
Ve2=Vp-Vbe #KVL
V=Ve1-Ve2 #KVL
print "When E=1V, meter circuit voltage(V)=",V,"V"
#When E=0.5
E=0.5 #in V
Vp=0 #in V
Ve1=E-Vbe #KVL
Ve2=Vp-Vbe #KVL
V=Ve1-Ve2 #KVL
print "When E=0.5, meter circuit voltage=",V,"V"
import math
#Variable Declaration
E=7.5 #in V
Vgs=-5 #FET gate source voltage in V
Vp=5 #in V
Rsm=1*10**3 #Rs+Rm in ohm
Im=1*10**-3 #in A
Ra=800*10**3 #in ohm
Rb=100*10**3 #in ohm
Rc=60*10**3 #in ohm
Rd=40*10**3 #in ohm
Eg=E*(Rc+Rd)/(Ra+Rb+Rc+Rd) #Voltage Divider Rule
Vs=Eg-Vgs #KVL
Ve1=Vs-Vbe #KVL
Ve2=Vp-Vbe #KVL
V=Ve1-Ve2 #KVL
Im=V/Rsm #Ohm's Law
print "Im is",round(Im*10**3,2),"which is",round(Im*10**3,2)*100,"% of full scale"
print "As the meter is in 10V range, 75% of full scale is",10*0.75,"V"
import math
#Variable Declaration
Im=100*10**-6 #Full scale current in A
Rm=10*10**3 #Meter resistance in ohm
Ib=0.2*10**-6 #Op-amp input current in A
E=20*10**-3 #Maximum input in V
#Calculations
I4=1000*Ib #Since I4>>Ib
Vout=Im*Rm #Ohm's Law
R3=E/I4 #Ohm's Law
R4=(Vout-E)/I4 #Ohm's Law
#Results
print "R3=",R3,"ohm"
print "R4=",round(R4*10**-3,1),"kilo ohm"
import math
#Variable Declaration
E=1.0 #in V
I=1*10**-3 #in A
Rm=100 #in ohm
R3=E/I #Ohm's Law
Vo=I*(R3+Rm) #Maximum Output voltage
print "R3=",R3/1000,"kilo Ohm"
print "Maximum voltage at output terminal=",round(Vo,1),"V"
import math
#Variable Declaration
Iav=1*10**-3 #in A
Rm=1.2*10**3 #in ohm
E=100*10**-3 #in V
#With half wave rectifiers,
Ip=2*Iav/0.637 #Using relation between Ip and Iav for HWR
#Peak value of Er3=input peak voltage
Ep=E/0.707 #Relation between peak voltage and rms
R3=Ep/Ip #in ohm
print "R3=",round(R3),"ohm"
#When E=50mV
E=50*10**-3 #in V
Ep=E/0.707 #Peak Voltage in V
Ip=Ep/R3 #Peak current in A
Iav=0.637*Ip/2 #Average Current in A
print "When input is 50mV, meter deflection is",round(Iav*10**3,1),"mA(half scale)"