import math
R1=100.0*10**3 #non-inverting input resistance wiper R1(Ohm)
R2=1.0*10**3 #non-inverting input resistance R2(Ohm)
C=0.01*10**-6 #capacitance at non-inverting input(F)
R=R1+R2 #max. total resistance(Ohm)
fr1=(2*math.pi*R*C)**-1 #minimum frequency(Hz)
R=R2 #min. total resistance(Ohm)
fr2=(2*math.pi*R*C)**-1 #maximum frequency(Hz)
print 'minimum frequency fr = ',round(fr1,2),'Hz'
print 'maximum frequency fr = ',round((fr2/1000),2),'KHz'
Rf=2 #feedback resistance(KOhm)
Rl=1 #lamp resistance(KOhm)
Vl=2 #lamp voltage(V)
Il=Vl/Rl #lamp current(mA)
Vout=Il*(Rf+Rl) #output voltage of oscillator(V)
print 'Lamp current = ',Il,'mA'
print 'output voltage of oscillator = ',Vout,'Vrms'
C1=0.001*10**-6 #capacitance in oscillator(F)
C2=0.01*10**-6 #capacitance in oscillator(F)
L=15*10**-6 #inductance(H)
C=C1*C2/(C1+C2) #equivalent capacitance(F)
fr=(2*math.pi*((L*C)**0.5))**-1 #oscillation frequency(Hz)
B=C1/C2 #feedback fraction
Av_min=C2/C1 #minimum voltage gain
print 'feedback fraction B = ',B
print 'oscillation frequency fr = ',round((fr*10**-6),2),'MHz'
print 'minimum voltage gain Av(min) = ',Av_min
C1=0.001*10**-6 #capacitance in oscillator(F)
C2=0.01*10**-6 #capacitance in oscillator(F)
C3=50.0*10**-12 #capacitance in oscillator(F)
L=15*10**-6 #inductance(H)
C=(C1**-1+C2**-1+C3**-1)**-1 #equivalent capacitance(F)
fr=(2*math.pi*((L*C)**0.5))**-1 #oscillation frequency(Hz)
print 'oscillation frequency fr = ',round((fr*10**-6),2),'MHz'
import math
Cs=0.05*10**-12 #series capacitance in oscillator(F)
Cm=10.0*10**-12 #capacitance in oscillator(F)
R=2.0*10**3 #resistance in oscillator(Ohm)
L=3 #inductance(H)
fs=(2*math.pi*((L*Cs)**0.5))**-1 #series resonant frequency(Hz)
Cp=Cs*Cm/(Cs+Cm) #equvalent parallel capacitance(F)
fp=(2*math.pi*((L*Cp)**0.5))**-1 #parallel resonant frequency(Hz)
print 'series resonant frequency fs = ',math.ceil(fs*10**-3),'KHz'
print 'parallel resonant frequency fp = ',math.ceil(fp*10**-3),'KHz'
VCC=12.0 #given supply voltage(V)
R=33*10**3 #given resistance(Ohm)
C=0.47*10**-6 #given capacitance(F)
LTP=VCC/3 #trip point LTP (V)
UTP=2*LTP #trip point UTP (V)
W=1.1*R*C #pulse width of output(s)
print 'trigger voltage LTP = ',LTP,'V'
print 'trigger voltage UTP = ',UTP,'V'
print 'pulse width W = ',W*10**3,'ms'
R=10*10**6 #given resistance(Ohm)
C=470*10**-6 #given capacitance(F)
W=1.1*R*C #pulse width of output(s)
print 'pulse width W = ',W,'s = ',round((W/3600),2),'hours'
R1=75.0*10**3 #given resistance1(Ohm)
R2=30.0*10**3 #given resistance2(Ohm)
C=47.0*10**-9 #given capacitance(F)
f=1.44/((R1+(2*R2))*C) #frequency (Hz)
D=(R1+R2)/(R1+(2*R2)) #duty cycle
print 'frequency f = ',round(f,2),'Hz'
print 'duty cycle D = ',round((D*100),2),'%'
import math
VCC=12.0 #given supply voltage(V)
R1=75.0*10**3 #given resistance1(Ohm)
R2=30.0*10**3 #given resistance2(Ohm)
C=47.0*10**-9 #given capacitance(F)
Vcon1=11 #given Vcon(V)
Vcon2=1 #given Vcon(V)
W1=-(R1+R2)*C*(math.log((VCC-Vcon1)/(VCC-(0.5*Vcon1)))) #pulse width(s)
T1=W1+(0.693*R2*C) #period(s)
D1=W1/T1 #duty cycle
f1=1/T1 #frequency(Hz)
W2=-(R1+R2)*C*(math.log((VCC-Vcon2)/(VCC-(0.5*Vcon2)))) #pulse width(s)
T2=W2+(0.693*R2*C) #period(s)
D2=W2/T2 #duty cycle
f2=1/T2 #frequency(Hz)
print 'For Vcon = 11V,'
print 'frequency f = ',round(f1,2),'Hz'
print 'duty cycle D = ',round((D1*100),2),'%'
print 'For Vcon = 1V,'
print 'frequency f = ',round(f2,2),'Hz'
print 'duty cycle D = ',round((D2*100),2),'%'
VCC=12.0 #given supply voltage(V)
R=9.1*10**3 #given resistance(Ohm)
C=0.01*10**-6 #given capacitance(F)
f=2.5*10**3 #given frequency(Hz)
Vmod=2 #peak value of modulating signal(V)
T=1/f #period of output pulse(s)
W=1.1*R*C #pulse width(s)
UTP_max=(2*VCC/3)+Vmod #maximum UTP(V)
UTP_min=(2*VCC/3)-Vmod #minimum UTP(V)
Wmin=-R*C*(math.log(1-(UTP_min/VCC))) #minimum pulse width(s)
Wmax=-R*C*(math.log(1-(UTP_max/VCC))) #maximum pulse width(s)
Dmin=Wmin/T #minimum duty cycle
Dmax=Wmax/T #maximum duty cycle
print 'period of output pulse T = ',T*10**6,'us'
print 'Quiscent pulse width W = ',W*10**6,'us'
print 'minimum UTP = ',UTP_min,'V'
print 'maximum UTP = ',UTP_max,'V'
print 'minimum pulse width W(min) = ',round((Wmin*10**6),2),'us'
print 'maximum pulse width W(max) = ',round((Wmax*10**6),2),'us'
print 'minimum duty cycle D(min) = ',round((Dmin*100),2),'%'
print 'maximum duty cycle D(max) = ',round((Dmax*100),2),'%'
VCC=12.0 #given supply voltage(V)
R1=3.9*10**3 #given resistance(Ohm)
R2=3*10**3 #given resistance(Ohm)
C=0.01*10**-6 #given capacitance(F)
Vmod=1.5 #peak value of modulating signal(V)
W=0.693*(R1+R2)*C #pulse width(s)
T=0.693*(R1+(2*R2))*C #period of output pulse(s)
UTP_max=(2*VCC/3)+Vmod #maximum UTP(V)
UTP_min=(2*VCC/3)-Vmod #minimum UTP(V)
Wmin=-(R1+R2)*C*(math.log((VCC-UTP_min)/(VCC-(0.5*UTP_min)))) #minimum pulse width(s)
Wmax=-(R1+R2)*C*(math.log((VCC-UTP_max)/(VCC-(0.5*UTP_max)))) #minimum pulse width(s)
Tmin=Wmin+(0.693*R2*C) #minimum period(s)
Tmax=Wmax+(0.693*R2*C) #maximum period(s)
s=0.693*R2*C #space(s)
print 'period of output pulse T = ',T*10**6,'us'
print 'Quiscent pulse width W = ',W*10**6,'us'
print 'minimum UTP = ',UTP_min,'V'
print 'maximum UTP = ',UTP_max,'V'
print 'minimum pulse width W(min) = ',round((Wmin*10**6),2),'us'
print 'maximum pulse width W(max) = ',round((Wmax*10**6),2),'us'
print 'minimum period T(min) = ',round((Tmin*10**6),2),'us'
print 'maximum period T(max) = ',round((Tmax*10**6),2),'us'
print 'space = ',round((s*10**6),2),'us'
VCC=15.0 #given supply voltage(V)
C=100*10**-9 #given capacitance(F)
Ic=1*10**-3 #collector current (A)
S=Ic/C #slope(V/s)
V=2*VCC/3 #peak value(V)
T=V/S #duration of ramp(s)
print 'slope is ',S/1000,'V/ms'
print 'Peak value V = ',V,'V'
print 'duration of ramp = ',T*10**3,'ms'
R=10*10**3 #given resistance(Ohm)
C=0.01*10**-6 #given capacitance(F)
f0=(R*C)**-1 #output frequency(Hz)
print 'output frequency f0 = ',f0/1000,'KHz'
R1=1.0*10**3 #given resistance(Ohm)
R2=2.0*10**3 #given resistance(Ohm)
C=0.1*10**-6 #given capacitance(F)
f=(2/C)*((R1+R2)**-1) #output frequency(Hz)
D=R1/(R1+R2) #duty cycle
print 'output frequency f = ',round((f/1000),2),'KHz'
print 'duty cycle = ',round((D*100),2),'%'