In [5]:
import numpy as np
%pylab


Using matplotlib backend: MacOSX
Populating the interactive namespace from numpy and matplotlib

In [42]:
n = 100
t = np.linspace(0,10e-3,n)
G0 = 40e-3
Tmax = 10e-3
N = 32
gamma_bar = 43e6
Gx = G0*t/Tmax*np.cos(2*np.pi*N*t/Tmax)
kx = gamma_bar*np.cumsum(Gx)/n
Gy = G0*t/Tmax*np.sin(2*np.pi*N*t/Tmax)
ky = gamma_bar*np.cumsum(Gy)/n

In [43]:
plt.plot(kx, ky, 'o')
xlabel('$kx[m^{-1}]$')
ylabel('$ky[m^{-1}]$')


Out[43]:
<matplotlib.text.Text at 0x10ea5b950>

In [18]:
np.cos(np.pi)


Out[18]:
-1.0

In [34]:
kx


Out[34]:
array([    0.        ,   -77.15096704,  -287.58504015,   224.20809903,
          39.02225679,  -608.37918434,   359.37405493,   262.99329931,
        -929.51698009,   385.89763488,   578.46501249, -1217.39199613,
         291.48381665,   962.10397749, -1439.66657193,    71.99688937,
        1384.81506894, -1567.23330472,  -268.11726406,  1813.3434592 ,
       -1576.02872957,  -715.86582547,  2212.12626823, -1448.60611319,
       -1250.20394296,  2545.30345239, -1175.38510534, -1842.97107397,
        2778.78903011,  -755.51070714, -2460.22857655,  2882.29976892,
        -197.27198009, -3063.93864676,  2831.23921588,   481.94865358,
       -3613.90757328,  2608.34044257,  1256.20268249, -4069.90252916,
        2204.98088843,  2091.963942  , -4393.84139243,  1622.09681434,
        2949.5406614 , -4551.94985959,   870.64252853,  3784.85284706,
       -4516.77967088,   -28.44003348,  4551.49837202, -4268.98617829,
       -1044.75348545,  5203.01600522, -3798.77261997, -2139.46781115,
        5695.24241162, -3106.92197082, -3266.79960235,  5988.65343859,
       -2205.35457933, -4375.89150998,  6050.57813819, -1117.17025881,
       -5413.01585844,  5857.17711425,   123.84378091, -6324.00956857,
        5395.08486665,  1474.233767  , -7056.8345643 ,  4662.62855677,
        2882.39930709, -7564.14933577,  3670.55255448,  4290.55933642,
       -7805.77374999,  2442.19857795,  5637.08936462, -7750.93078104,
        1013.11436955,  6859.13655252, -7380.15560281,  -569.91129629,
        7895.40408703, -6686.77424877, -2250.36395397,  8688.98568866,
       -5677.87038024, -3964.02071955,  9190.12543017, -4374.67899806,
       -5641.39750039,  9358.77770822, -2812.36938507, -7210.5331383 ,
        9166.84731544, -1039.20523022, -8600.        ,  8600.        ])

In [27]:
ky


Out[27]:
array([   0.        ,   15.56676052,  -12.08395394,  -21.94795819,
         45.03420394,  -12.88714358,  -51.63013895,   69.60351259,
         -1.79245618,  -86.32902037,   86.33786437,   20.97401475,
       -122.8970034 ,   92.77586649,   54.34481987, -157.93861006,
         87.08761784,   96.45857517, -188.00815792,   68.19857393,
        144.75092067, -209.81305759,   35.874651  ,  196.08487303,
       -220.4125387 ,   -9.23617858,  246.91449932, -217.40174069,
        -65.60850084,  293.47417864, -199.07170263, -130.89079733,
        331.98440266, -164.53682884, -202.00178664,  358.86415786,
       -113.82284865, -275.26787798,  370.93947439,  -47.910069  ,
       -346.59582609,  365.63774445,   31.27124011, -411.67290568,
        341.15790996,  120.89427461, -466.18548285,  296.60757799,
        217.33659885, -506.04581768,  232.09950531,  316.32492065,
       -527.61633816,  148.80164327,  413.11800568, -527.92051386,
         48.93697833,  502.72009136, -504.8298377 ,  -64.26834599,
        580.11556691, -457.2172882 , -186.68777959,  640.5144818 ,
       -385.06895957, -313.44477555,  679.59768745, -289.54726253,
       -439.10537738,  693.75014954, -173.00114575, -557.9054325 ,
        680.27120752,  -38.92108042, -664.00310639,  637.55130527,
        108.1610064 , -751.74597367,  565.20594558,  262.82417594,
       -815.9410108 ,  464.15928812,  418.95819983, -852.1153574 ,
        336.6718502 ,  570.00320466, -856.75578074,  186.30910086,
        709.21989777, -827.51537637,   17.85026547,  829.9794102 ,
       -763.37715289, -162.86072453,  926.06060883, -664.76574176,
       -349.11760571,  991.94204554, -533.60048571, -533.60048571])

In [28]:
1/140.


Out[28]:
0.007142857142857143

In [29]:
1/130.


Out[29]:
0.007692307692307693

In [37]:
1/1500.


Out[37]:
0.0006666666666666666

In [39]:
np.exp(-50/780.)


Out[39]:
0.93790879882320588

In [41]:
1-np.exp(-1)


Out[41]:
0.63212055882855767

In [ ]: