#Given
Ei = 0.5 #Input voltage
Ri = 1*10**3 #Input resistance in ohm
#Calculation
Im = Ei / Ri #Meter Current
#Result
print"Meter Current = ", Im*1000,"mA"
#Given
Efs = 5.0 #Full scale Voltage
Ifs = 50*10**-6 #Full scale Meter Current
#Calculation
Ri = Efs / Ifs # Input Resistance
#Result
print" Input Resistance =", Ri/1000,"Kohm"
#Given
Edc = 5.0
Erms = 5.0
Epeak = 5.0
Eptop = 5.0 # Voltages of meters
Ifs = 50*10**-6 # Full scale Meter Current
#Calculation
Ri1 = Edc / Ifs # DC Voltmeter
Ri2 = 0.90 * (Erms / Ifs ) # Rms ac voltmeter ( math.sine wave only )
Ri3 = 0.636 * (Epeak / Ifs ) #Peak Reading Voltmeter ( math.sine wave only )
Ri4 = 0.318 * (Eptop / Ifs ) #Peak-to-Peak ac Voltmeter(math.sine wave only)
#Result
print" Ri1 ", Ri1/1000,"kohm"
print" Ri2 =",Ri2/1000 ,"kohm"
print" Ri3 = ", Ri3/1000,"kohm"
print" Ri4 = ", Ri4/1000,"kohm"
#Given
Vo = 10.3 #Voltage across the load resistor
Ei = 5.0 #Input voltage
Ri = 1*10**3 #Input Resistance
#calculation
I = Ei / Ri #Zener Current
Vt = Vo - Ei #Zener Voltage
#Result
print" Zener Current = ", I,"A"
print" Zener Voltage = ", Vt ,"V"
#Given
Ei = 1.0 #Reference voltage
Ri = 1*10**3 #Input Resistance
Vo = 0.6 #Outpur Voltage
#Calculation
I = Ei / Ri #Diode Current
Vdiode = Vo
#Result
print" Diode Current = ", I*1000 ,"mA"
print" Voltage drop across the diode = ", Vdiode,"V"
#Given
R = 10*10**3 #Resistance
E2 = 0 #Source across negative terminal
Rl = 5*10**3 # Load Resistance
E1 = 5.0 # source across positive terminal
#calculation
Il = (E1 - E2)/R #Load Current
Vl = Il * Rl # Voltage across Rl
Vo = (2*Vl)-E2 #Output voltage
#Result
print"(a) Load current across Rl = " , Il*1000 ,"mA"
print"(b) Voltage across load resistance = " , Vl,"V"
print"(c) Output Voltage = ", Vo ,"V"
#Given
R = 10*10**3 #Resistance
E2 = 5.0 #Source across negative terminal
Rl = 5*10**3 # Load Resistance
E1 = 0 # source across positive terminal
#Calculation
Il = (E1 - E2)/R #Load Current
Vl = Il * Rl # Voltage across Rl
Vo = (2*Vl)-E2 #Output voltage
#Result
print"(a) Load current across Rl = " , Il*1000,"mA"
print"(b) Voltage across load resistance = " , Vl,"V"
print "(c) Output Voltage = ", Vo ,"V"
#Given
Vo = 5.0 #Output Voltage
Rf = 100*10**3 #Feedback Resistance
#calculation
Isc = Vo / Rf #Short Circuit Current
#Result
print" Short Circuit Current = " , Isc*10**6,"microA"
#Given
Rf = 10*10**3 #Feedback Resistance
I = 10*10**-6 #Current through Photo Detector
#calculation
Vo = Rf * I #Vo for Dark Condition
I1 = 1*10**-3 #Current in presence of sunlight
Vo1 = Rf * I1 #output voltage in light condition
#Result
print"(a)Output Voltage for dark Condition = ", Vo,"V"
print"(b) Output voltage in light condition = ", Vo1,"V"
#Given
Rf = 100*10**3 #Feedback Resistance
Il1 = 1*10**-6 #Load current 1
#calculation
Vo1 = Rf * Il1 #Output voltage in photo detector
Il2 = 50*10**-6 # Load current 2
Vo2 = Rf * Il2 #Output Voltage in photo detector
#Result
print" (a)Output Voltage in photo detector for Il1 = ",Vo1 ,"V"
print " (b)Output Voltage in photo detector for Il2 = ",Vo2 ,"V"
#Given
R = 1*10**3
R1 = 99*10**3
#calculation
m = R1 / R #multiplier
Isc = 10*10**-6 #Current on short-circuit condition
Il = (1 + m)*Isc
#result
print" Load current = ", Il*1000,"mA"
#Given
Im = 100*10**-6 #Meter current
Isc = 0.5 # Current in short-circuit condition
Rf = 20 # Feedback resistance
Rm = 0.8*10**3 #Meter resistance
#calculation
d = Isc / Im #Current divider
R1 = d * Rf
Rscale = R1 - Rm
#Result
print" Resistance dRf = ", R1/1000 ,"kohm"
print" Rscale = ", Rscale/1000,"kohm"
#Given
f = 10**3 #Frequency of Ei in Hz
Ci = 0.01*10**-6
#Calculation
import math
m = math.tan(math.pi/4)
Ri = m / (2*math.pi*f*Ci)
#result
print" Value of Ri = ",round(Ri/1000,1),"kohm"
#Given
f = 10**3
Ri = 100*10**3
Ci = 0.01*10**-6
#calculation
import math
phaseangle = 2*math.atan(2*math.pi*f*Ri*Ci)
#result
print" Phase angle =", round(phaseangle*180/3.14,2),"degree"
#Given
#From fig 5-14(a) and b
Ei=2 #V, voltage
Vf=4 #Vf force
#Calculation
Vo=-2*Ei #Vo forces
Vcap=3*Ei
#Result
print"Vo is",Vo,"V"
print"Vcap is",Vcap,"V"
#Given
Ei=4 #V
Vo=8 #V
#Calculation
Vr=-Vo
Vcap=Ei+Vo
#Result
print"Vcap is",Vcap,"V"
#Given
Ri=1*10**5
C=10**-6
#Calculation
T=3*Ri*C
Et=5*T
#Result
print"Equilibrium Time is",Et,"s"
#given
Ci=0.1*10**-6 #capacitance, farady
Ci_=0.1 #microF
f=1000 #frequency
#Calculation
import math
Ri=1/(2*math.pi*f*Ci)
Rf=20/(2*math.pi*f*Ci)
Cf=1/(2*math.pi*f*Rf)
#a=0.4*math.sin(2*math.pi*1000*t)
#Vo=-Cf*Ci*a
from sympy import *
import numpy as np
t = Symbol('t')
y = -Rf*Ci_/10**6*0.4*sin(2*math.pi*1000*t)
y_ = y.diff(t)
#Reslt
print Ci_
print"a)Rf is ",round(Rf/1000,1),"kohm"
print"Cf is ",round(Cf*10**6,9),"microF"
print"(b)Output voltage is ",y_,"V"
#NOTE: Answer is same .In the book it is written 2*math.pi*1000 .