from __future__ import division
from math import pi, sin
t=range(0,5) #sec(Assumed)
Vin=5*sin(2*pi*t[0]) #V
VCC=15 #V
R2=1 #kohm
R1=6.8 #kohm
VEE=-15 #V
Vsat=13 #V
Vref=R2*VCC/(R1+R2) #V
print "Reference Voltage = %0.2f V " %Vref
print "If Vin>Vref , Vout = %0.2f V " %Vsat
print "If Vin<Vref , Vout = %0.2f V " %-Vsat
from __future__ import division
Vsat=7 #V
R1=68 #kohm
R2=82 #kohm
VUTP=R2*Vsat/(R1+R2) #V
VLTP=R2*-Vsat/(R1+R2) #V
print "Upper trip point = %0.2f V " %VUTP
print "Lower trip point = %0.2f V " %VLTP
from __future__ import division
from numpy import arcsin, pi
#Vin=5*sin(omega*t)
Vm=5 #V
Vsat=7 #V
R1=68 #kohm
R2=82 #kohm
VUTP=R2*Vsat/(R1+R2) #V
fi=arcsin(VUTP/Vm)*180/pi #degree
print "Phase shift = %0.2f degree " %fi
from __future__ import division
VZ1=4.7 #V
VZ2=4.7 #V
R1=68 #kohm
R2=15 #kohm
Vout=VZ1+0.7 #V(As one zener diode is always forward biased)
VR1=Vout #V
IR1=VR1/R1*1000 #micro A
IR2=IR1 #micro A
VR2=IR2*10**-3*R2 #V
Vout=VR1+VR2 #V
VUTP=(R2/(R1+R2))*Vout #V
VLTP=(R2/(R1+R2))*(-Vout) #V
print "VUTP = %0.2f V " %VUTP
print "VLTP = %0.2f V " %VLTP
from __future__ import division
Vsat=12.5 #V
Vref=-12.5 #V
R1=80 #kohm
R2=20 #kohm
Beta=R2/(R1+R2) #unitless
UTP=Beta*Vsat+(1-Beta)*Vref #V
LTP=-Beta*Vsat+(1-Beta)*Vref #V
VH=UTP-LTP #V
R3=R1*R2/(R1+R2) #kohm
print "UTP = %0.2f V " %UTP
print "LTP = %0.2f V " %LTP
print "Hysteresis Voltage, VH = %0.2f V " %VH
print "Use R3 = %0.2f kohm " %R3