In [99]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np

USR1


In [100]:
def USR1(t):
    if t<=0:
        return 0
    elif t<=2:
        return 10*t
    elif t<=17:
        return 20
    elif t<=21:
        return 20-10*(t-17)
    elif t<=66:
        return -20
    elif t<=68:
        return -20 + 10*(t-66)
    else:
        return 0

In [101]:
t = np.linspace(-5,75,1000)
wave1 = np.array([USR1(entry) for entry in t])

In [102]:
fig,ax = plt.subplots();
ax.plot(t,wave1);
plt.ylim(-25,25);
plt.xlim(-5,75);
ax.grid(True);
plt.tick_params(axis='x',top='off',direction='out');
plt.tick_params(axis='y',right='off',direction='out');
plt.xlabel('Time ($\mu$s)');
plt.ylabel('Voltage (V)');
plt.title('USR1 Wavefunction');
plt.text(30.5, 20.5-10, 'Rise Time = 2$\mu$s');
plt.text(30.5, 17.5-10, 'Dwell Time =15$\mu$s');
plt.text(30.5, 14.5-10, 'Fall Time = 4$\mu$s');
plt.text(30.5, 11.5-10, 'Echo Time = 45$\mu$s');
plt.savefig('USR1.png')


USR3


In [103]:
def USR3(t):
    if t<=0:
        return 0
    elif t<=3:
        return 10*(2/3)*t
    elif t<=33:
        return 20
    elif t>=33 and t<=36:
        return 20-10*(2/3)*(t-33)
    else:
        return 0

In [104]:
wave3 = wave4 = np.array([USR3(entry) for entry in t])

In [105]:
fig,ax = plt.subplots();
ax.plot(t,wave3);
plt.ylim(-5,25);
plt.xlim(-5,41);
ax.grid(True);
plt.tick_params(axis='x',top='off',direction='out');
plt.tick_params(axis='y',right='off',direction='out');
plt.xlabel('Time ($\mu$s)');
plt.ylabel('Voltage (V)');
plt.title('USR3 Wavefunction');
plt.text(10.5, 15.5, 'Rise Time = 3$\mu$s');
plt.text(10.5, 13.5, 'Dwell Time =30$\mu$s');
plt.text(10.5, 11.5, 'Fall Time = 3$\mu$s');
plt.savefig('USR3.png')


USR4


In [106]:
def USR4(t):
    if t<=0:
        return 0
    elif t<=3:
        return 10*(2/3)*t
    elif t<=48:
        return 20
    elif t>=48 and t<=51:
        return 20-10*(2/3)*(t-48)
    else:
        return 0

In [107]:
wave4 = np.array([USR4(entry) for entry in t])

In [108]:
fig,ax = plt.subplots();
ax.plot(t,wave4);
plt.ylim(-5,25);
plt.xlim(-5,56);
ax.grid(True);
plt.tick_params(axis='x',top='off',direction='out');
plt.tick_params(axis='y',right='off',direction='out');
plt.xlabel('Time ($\mu$s)');
plt.ylabel('Voltage (V)');
plt.title('USR4 Wavefunction');
plt.text(20.5, 15.5, 'Rise Time = 3$\mu$s');
plt.text(20.5, 13.5, 'Dwell Time =45$\mu$s');
plt.text(20.5, 11.5, 'Fall Time = 3$\mu$s');
plt.savefig('USR4.png')



In [ ]: