5 Return spectrum value as a function of freq and peak freq 10 return alpha*g**2/(omega**5)*exp(-(5.0/4.0)*(omega_p/omega)**4)
20 omegas = linspace(omega_p*.25,omega_p*4,100)
23 s.append(
pm(o,omega_p))
24 plot(omegas,s, label=
'$\\bar{T}=T_p$ = %.2f s, $\omega_p$=%.2f rad/s'%(Tp,omega_p))
27 omegas = [omega_p/scale, omega_p, omega_p*scale]
28 delos = [omega_p*(1-1/scale), omega_p*(scale-1/scale)/2.0, omega_p*(scale-1)]
31 for o,d
in zip(omegas,delos):
32 s.append(
pm(o,omega_p))
33 a.append(sqrt(2*
pm(o,omega_p)*d))
35 print 2*pi/array(omegas)
37 plot(omegas,s,
'o',label=
'Samples for s = %.2f'%scale)
41 xlabel(
'$\omega \,\, [rad/s]$')
42 ylabel(
'$S(\omega) \,\, [m^2/(rad/s)]$')