Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. def ffpressure(m=0, col=0):
  2.     """
  3.    Calculates the far field pressure based on a chosen radiation mode (m,j), and directivity pattern
  4.    and then calculates the total far field pressure for all the radial mode n's in a, per
  5.    azimuthal mode m.
  6.    """
  7.     directivities = D_Pcsv()[1] # Dmn(phi) directivity list of length Ph
  8.     thetarr = np.linspace(0, 2*np.pi, D_Pcsv()[0].shape[0])
  9.     R = Rglob
  10.     a = Radiationproperties(m,col)[0] # radiation mode shape (column vector of radiation mode amplitudes)
  11.     N = Wn1n2(m)[0].shape[0]
  12.     Phis = directivities.shape[2] # total number of polar angles Ph
  13.     pressarr = np.zeros((N,Phis),'complex')
  14.     for n in range(N):
  15.         pressarr[n] = (a[n]/R)*directivities[m][n]*np.exp((1j*omegaglob*R/c0)+(1j*m*thetarr))
  16.     return np.sum(pressarr, axis=0) # sum over the n rows in pressarr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement