#Caption:Determine the errors due to Rs and Rd
#Ex15.1
Vs=1.#Source voltage(in volts)
Rs=100.#Source resistance(in ohm)
Rl=10.#Load resistance(in kilo ohm)
Rd=30.#Drain resistance(in ohm)
Vgs=10.#Gate source voltage(in volts)
V1=-(Vs+Vgs+1.)
Id=Vs/(Rs+Rd+Rl)
e1=(Id*Rs)*100./(Vs)
e2=(Id*Rd)*100./(Vs)
print '%s %.2f' %('Errors due to Rs(in %)=',e1)
print '%s %.2f' %('Errors due to Rd(in %)=',e2)
#Calclation error in textbook
#Caption:Determine capacitance and minimum acquisition time
#Ex15.2
Vs=1.#Supply voltage(in volts)
a=0.25#Accuracy(in %)
t=500.#Holding time(in micro sec)
Ib=500.#Maximum base current(in nA)
Rd=30.#Drain Resistance(in ohm)
v=Vs*0.1/100.
C=Ib*t*10.**(-9.)/v
T=7.*C*Rd
print '%s %.2f' %('Required capacitance(in micro farad)=',C,)
print '%s %.1f' %('Required acquisition time(in micro sec)=',T)
#Caption:Determine the error due to capacitance
#Ex15.3
Vgs=10.#Gate source voltage(in volts)
C=10.5#Capacitance(in pF)
Vs=1.#Supply voltage(in volts)
C1=0.25#Capacitance(in micro farad)
V1=-(Vs+Vgs+1.)
Vgsm=Vs-(V1)
Q=C*Vgsm
Vo=Q/C1
e=Vo*10.**(-6.)*100./Vs
print '%s %.2f' %('Error due to capacitance(in %)=',e)
#caption:Calculate the output voltage
#Ex15.4
Vie=1.#Input voltage for resistor Re(in volts)
Vid=0#Input voltage for resistor Rd(in volts)
Vic=1.#Input voltage for resistor Rc(in volts)
Vib=1.#Input voltag for resistor Rb(in volts)
Via=0#Input voltage for resistor Ra(in volts)
R=16.#Input Resistor(in kilo ohm)
re=1.#Resistor(in kilo ohm)
rd=2.#Resistor(in kilo ohm)
rc=4.#Resistor(in kilo ohm)
rb=8.#Resistor(in kilo ohm)
ra=16.#Resistor(in kilo ohm)
Vo=R*((Vie/re)+(Vid/rd)+(Vic/rc)+(Vib/rb)+(Via/ra))
print '%s %.f' %('Output voltage(in volts)=',Vo)