import matplotlib.pyplot as plt
%matplotlib inline
#for the given Astable multivibrator:
Ra=7.5*(10**3) #Resistance in ohm
Rb=Ra
C=0.1*(10**-6) #capacitance in F
Th=0.7*C*(Ra+Rb) #in ms
Tl=0.7*C*Rb #in ms
#calculating total period T:
T=Th+Tl
#calcualting frequency of output waveform
f=1/T
print "frequency of output waveform=",round(f,1),"Hz"
print "The output waveform is :"
y=[0,5,5,1,1,5,5,1,1,5,5]
x=[0,0,1.05,1.05,1.575,1.575,2.625,2.625,3.15,3.15,3.5]
plt.plot(x,y,'m')
plt.xlabel('Time(ms)---->')
plt.ylabel('Vo---->')
plt.xlim(0.0,3.5)
plt.ylim(0.0,5.5)
plt.show()