Changeset 2869
- Timestamp:
- May 15, 2006, 5:34:11 PM (18 years ago)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/experimentation/smf.tex
r2865 r2869 120 120 formulation, the values of interest shown in Figure 2 of [3] would 121 121 be ($\kappa', \Delta x) = (1,2), (1,4), (1.2, 13.48)$ and shown in 122 Figure \ref{fig:eta_vary}. 122 Figure \ref{fig:eta_vary}. Note, this has not been scaled by $\eta_{\rm min}$. 123 123 124 124 -
inundation/pyvolution/smf.py
r2393 r2869 184 184 gravity=9.8, gamma=1.85, \ 185 185 massco=1, dragco=1, frictionco=0, \ 186 dx=None, kappa=3.0, kappad= 0.8, zsmall=0.01, \186 dx=None, kappa=3.0, kappad=1.0, zsmall=0.01, \ 187 187 domain=None, 188 188 verbose=False): … … 248 248 print '\t2D amplitude: ', a2D 249 249 print '\t3D amplitude: ', a3D 250 print '\tDelta x ', dx 251 print '\tsmall ', zsmall 252 print '\tKappa d ', kappad 250 253 251 254 #keep an eye on some of the assumptions built into the maths … … 343 346 kappa = self.kappa 344 347 kappad = self.kappad 348 amin = self.find_min(x0,wa,kappad,kappa) 345 349 346 350 #double Gaussian calculation assumes water displacement is oriented … … 355 359 356 360 z = zeros(N, Float) 357 361 maxz = 0.0 362 print 'here i am about to calculate z with dx = ', dx 358 363 for i in range(N): 359 364 try: 360 z[i] = -am / ( (cosh(kappa*(yr[i]-y0)/(wi+wa)))**2) \365 z[i] = -am / (amin*(cosh(kappa*(yr[i]-y0)/(wi+wa)))**2) \ 361 366 * (exp(-((xr[i]-x0)/wa)**2) - \ 362 367 kappad*exp(-((xr[i]-dx-x0)/wa)**2)) 368 if z[i] > maxz: maxz = z[i] 363 369 except OverflowError: 364 370 pass 365 371 372 print 'maximum of Double Gaussian function', maxz 366 373 return z 367 374 … … 386 393 387 394 self.dx = 2.0 * (c * sqrt(-log((zsmall/a),e))) / 5.0 395 396 def find_min(self, x0, wa, kappad, kappa): 397 """Determine eta_min to scale eta(x,y) 398 """ 399 400 from math import exp, cosh 401 402 step = 0.001 403 x = x0 404 deriv = 10.0 405 tol = 0.001 406 count_max = 100000 407 c = 0 408 409 while c < count_max and deriv > 0: 410 deriv = (x-x0)*exp(-((x-x0)/wa)**2.0) - \ 411 kappad*(x-dx-x0)*exp(-((x-dx-x0)/wa)**2.0) 412 if deriv < 0: xstar = x 413 x -= step 414 c += 1 415 416 etastar = -am * (exp(-((xstar-x0)/wa)**2) - \ 417 kappad*exp(-((xstar-dx-x0)/wa)**2)) 418 419 return etastar -
production/onslow_2006/data.tex
r2860 r2869 49 49 \begin{figure}[hbt] 50 50 51 \centerline{ \includegraphics[width= 75mm, height=75mm]{onslow_data_extent.png}}51 \centerline{ \includegraphics[width=100mm, height=75mm]{onslow_data_extent.png}} 52 52 53 53 \caption{Data extent for Onslow scenario. Offshore data shown in blue and onshore data -
production/pt_hedland_2006/data.tex
r2860 r2869 55 55 \begin{figure}[hbt] 56 56 57 \centerline{ \includegraphics[width= 75mm, height=75mm]{pt_hedland_data_extent.png}}57 \centerline{ \includegraphics[width=100mm, height=75mm]{pt_hedland_data_extent.png}} 58 58 59 59 \caption{Data extent for Pt Hedland scenario. Offshore data shown in blue and onshore data -
production/sydney_2006/find_max.py
r2862 r2869 5 5 6 6 from math import exp, cosh 7 import Numeric 7 8 8 9 # Grilli and Watts 2005 example … … 19 20 20 21 def func(x,y,kappad): 21 numerator = exp(-((x-x0)/lam0)**2 ) - kappad*exp(-((x-dx-x0)/lam0)**2)22 denominator = cosh(kappa*(y-y0)/(w+lam0))**2 22 numerator = exp(-((x-x0)/lam0)**2.0) - kappad*exp(-((x-dx-x0)/lam0)**2.0) 23 denominator = cosh(kappa*(y-y0)/(w+lam0))**2.0 23 24 return -numerator/denominator 24 25 25 26 def dfuncdx(x,kappad): 26 dfdx = (x-x0)* *3.0*exp(-(x-x0)**2.0/lam0)-kappad*(x-dx-x0)**3.0*exp(-(x-dx-x0)**2.0/lam0)27 dfdx = (x-x0)*exp(-((x-x0)/lam0)**2.0)-kappad*(x-dx-x0)*exp(-((x-dx-x0)/lam0)**2.0) 27 28 return dfdx 28 29 … … 34 35 direction = 'positive' 35 36 while c < 100000 and deriv > 0: 36 deriv = dfuncdx(x, 0.83)37 deriv = dfuncdx(x,1.0) 37 38 if deriv < 0: xstar = x 38 39 if direction == 'positive': x += step … … 40 41 c += 1 41 42 42 print 'location of maximum of surface elevation function: xstar = %f' % (xstar )43 print 'location of maximum of surface elevation function: xstar = %f' % (xstar/lam0) 43 44 const = 1.0 #a3D = ? #sydney = 86? and kappad=1 44 print 'eta(xstar): %f' % (const*func(xstar,y0,0.83))45 45 46 x = arange(-20,25,0.001) 47 y = arange(-10,10,0.1) 48 X,Y = meshgrid(x,y) 46 49 47 48 50 test = 0.0 51 for xi in x: 52 testi = func(xi,0.0,1.0) 53 if direction == 'positive': 54 if testi > test: 55 test = testi 56 xstar = xi 57 else: 58 if testi < test: 59 test = testi 60 xstar = xi 61 62 print 'check: xstar = %f and eta(xstar) = %f' %(xstar/lam0, test)
Note: See TracChangeset
for help on using the changeset viewer.