from math import sqrt
from __future__ import division
#Given data
l=25 # in mm
l=l*10**-3 # in meter
d=5 # in mm
d=d*10**-3 # in meter
S= 20 # in cm
S= S*10**-2 # in meter
Va= 3000 # in volts
TraceLength= 10 # in cm
TraceLength=TraceLength*10**-2 # in meter
y=TraceLength/2
Vd= 2*d*Va*y/(l*S) # in volts
Vrms= Vd/sqrt(2) # in volts
Vrms= int(Vrms)
print "RMS value of the sinusoidal voltage applied to the X-deflecting plates = %0.f volts" %Vrms
DeflectionSensitivity= l*S/(2*d*Va) # in m/V
print "Deflection Sensitivity = %0.3f mm/V" %(DeflectionSensitivity*10**3)
from math import sqrt
#Given data
Va= 1000 # in volts
e= 1.6*10**-19 # in C
m= 9.1*10**-31 # in kg
MaxVel= sqrt(2*Va*e/m) # maximum velocity of electrons in m/s
print "Maximum velocity of electrons = %0.3e m/s" %MaxVel
#Given data
l=20 # in mm
l=l*10**-3 # in meter
d=5 # in mm
d=d*10**-3 # in meter
S= 0.20 # in meter
Va= 2500 # in volts
DeflectionSensitivity= l*S/(2*d*Va) # in m/V
print "Deflection Sensitivity = %0.2f mm/V" %(DeflectionSensitivity*10**3)
from math import tan, pi
#Given data
l=2.5 # in cm
l=l*10**-2 # in meter
d=1 # in cm
d=d*10**-2 # in meter
Va= 1000 # in volts
theta= 1 # in degree
# Formula tand(theta) = l*Vd/(2*d*Va)
Vd= 2*d*Va/l*tan(theta*pi/180) # in volts
print "Voltage required across the deflection plates = %0.2f volts" %Vd
#Given data
l=2.5 # in cm
l=l*10**-2 # in meter
d=.5 # in cm
d=d*10**-2 # in meter
S= 20 # in cm
S= S*10**-2 # in meter
Va= 2500 # in volts
# Formula y = OC*AB/OB = (S*d/2)/(l/2)
y = (S*d/2)/(l/2) # in meter
print "The value of deflection = %0.f cm" %(y*10**2)
#Given data
R_E1= 5.6 # in kohm
C1= 0.2 # in micro F
V_B1= 6.3 # in volt
V_BE= 0.7 # in volt
TL= 2.5 # trigger level for the Schmitt trigger (UTP,LTP) in volt
del_V1= 2*TL # in volt
I_C1= (V_B1-V_BE)/R_E1 # in mA
print "Charging current = %0.f mA" %I_C1
toh= del_V1*C1/I_C1 # in ms
print "Time period = %0.f ms" %toh
#Given data
L=10 # trace length in cm
DS= 5 # deflection sensitivity in V/cm
V_peakTOpeak= L*DS # in volt
V_peak= V_peakTOpeak/2 # in volt
RMS= V_peak/sqrt(2) # RMS value of unknown as voltage in volt
print "The value of AC voltage = %0.3f volts" %RMS
from fractions import Fraction
#Given data
Y= 3 # Positive Y-peaks in pattern
X= 2 # Positive X-peaks in pattern
# Ratio of frequencies of vertical and horizontal signals
# f_y/f_x= omega_y/omega_x = Y/X
R= Y/X #Ratio of frequencies
print "Ratio of frequencies of vertical and horizontal signals = ",Fraction(R).limit_denominator(10)
#Given data
Y= 2+1/2 # Positive Y-peaks in pattern
X= 1/2+1/2 # Positive X-peaks in pattern
f_h= 3# frequency of horizontal voltage signal in kHz
f_yBYf_x= Y/X
# frequency of vertical voltage signal= f_yBYf_x * f_h
f_v= f_yBYf_x * f_h # frequency of vertical voltage signal in kHz
print "frequency of vertical voltage signal = %0.1f kHz" %f_v
#Given data
f_x= 1000 # in Hz
Y= 2 # points of tangency to vertical line
X= 5 # points of tangency to horizontal line
f_y= f_x*X/Y # in Hz
print "Frequency of vertical input = %0.f Hz" %f_y
from fractions import Fraction
#Given data
# Taking 1div= 1 cm for CRO wave displays
Mark= 0.4 # cm
Space= 1.6 # cm
SAC= 0.2 # signal amplitude control in V/div
TBS= 10 # time base control in micro/div
Amplitude= 2.15 # in cm
M_S_ratio= Mark/Space # Mark to Space raio
print "Mark to Space ratio = ",Fraction(M_S_ratio).limit_denominator(20)
T= (Mark+Space)*TBS # in micro sec
T=T*10**-6 # in sec
f=1/T # in Hz
print "Pulse frequency = %0.f kHz" %(f*10**-3)
Mag= Amplitude*SAC # Magnitude of pulse voltage in volt
print "Magnitude of pulse voltage = %0.2f volts" %Mag
from math import asin
from __future__ import division
#Given data
# Part (a)
d_v0= 0
Dv=6
fie= asin(d_v0/Dv)
print "Phase angle of first figure = %0.f degree" %fie
# Part (b)
d_v0= 3
Dv=6
fie= asin(d_v0/Dv)*180/pi
print "Phase angle of second figure = %0.f degree" %fie,"or %0.f" %(180-fie)
# Part (c)
d_v0= 5
Dv=5
fie= asin(d_v0/Dv)*180/pi
print "Phase angle of third figure = %0.f degree" %fie
# Part (d)
d_v0= 3
Dv=5
fie= asin(d_v0/Dv)*180/pi
# since ellipse is in 2nd and fourth quartes so the valid value of phase angle
fie= 180-fie
print "Phase angle of fourth figure = %0.1f degree" %fie,"or %0.1f" %(180-fie)
#Given data
f=2000 # in Hz
T=1/f # in sec
D=0.2
PulseDuration= D*T # in sec
print "The value of pulse duration = %0.1f ms" %(PulseDuration*10**3)
#Given data
vertical_attenuation= 0.5 # in V/Div
TPD= 2 # time/Div control in micro sec
P= 4*vertical_attenuation # peak-to-peak amplitude of the signal in V
print "Peak-to-Peak amplitude of the signal = %0.f V" %P
T= 4*TPD # in micro sec
T=T*10**-6 # in sec
f=1/T # in Hz
print "The value of frequency = %0.f kHz" %(f*10**-3)
#Given data
C_1N= 36 # in pF
C_2= 150 # in pF
R_1N= 1 # in M ohm
R_1= 10 # in M ohm
# R_1/(omega*(C_2+C_1N)) = R_1N/(omega*C_1)
C_1= R_1N*(C_2+C_1N)/R_1 # in pF
print "Value of C_1 = %0.1f pF" %C_1
C_T= 1/(1/C_1+1/(C_2+C_1N)) # in pF
print "Value of C_T = %0.2f pF" %C_T
#Given data
C_1N= 36 # in pF
C_2= 150 # in pF
R_1N= 1 # in M ohm
R_1= 10 # in M ohm
R_source= 500 # in ohm
# R_1/(omega*(C_2+C_1N)) = R_1N/(omega*C_1)
C_1= R_1N*(C_2+C_1N)/R_1 # in pF
C_T= 1/(1/C_1+1/(C_2+C_1N)) # in pF
C_T= C_T*10**-12 # in F
f= 1/(2*pi*C_T*R_source)
print "Signal Frequency = %0.2f MHz" %(f*10**-6)
#Given data
f= 20 # in MHz
f=f*10**6 # in Hz
toh= 1/f # in sec
toh=toh*10**9 # in ns
# For one cycle occupying 4 horizontal divisions,
MTD= toh/4 # Minimum time/division in ns/division
# Using the 10 times magnifier to provide MTD
MTD_setting= 10*MTD # minimum time/division setting in ns/division
print "Minimum time/division setting = %0.f ns/division" %MTD_setting