Changeset 2869


Ignore:
Timestamp:
May 15, 2006, 5:34:11 PM (18 years ago)
Author:
sexton
Message:

updates to slump/slide formulation and document

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • documentation/experimentation/smf.tex

    r2865 r2869  
    120120formulation, the values of interest shown in Figure 2 of [3] would
    121121be ($\kappa', \Delta x) = (1,2), (1,4), (1.2, 13.48)$ and shown in
    122 Figure \ref{fig:eta_vary}.
     122Figure \ref{fig:eta_vary}. Note, this has not been scaled by $\eta_{\rm min}$.
    123123
    124124
  • inundation/pyvolution/smf.py

    r2393 r2869  
    184184                  gravity=9.8, gamma=1.85, \
    185185                  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, \
    187187                  domain=None,
    188188                  verbose=False):
     
    248248        print '\t2D amplitude: ', a2D
    249249        print '\t3D amplitude: ', a3D
     250        print '\tDelta x ', dx
     251        print '\tsmall ', zsmall
     252        print '\tKappa d ', kappad
    250253
    251254    #keep an eye on some of the assumptions built into the maths
     
    343346        kappa = self.kappa
    344347        kappad = self.kappad
     348        amin = self.find_min(x0,wa,kappad,kappa)
    345349
    346350        #double Gaussian calculation assumes water displacement is oriented
     
    355359
    356360        z = zeros(N, Float)
    357 
     361        maxz = 0.0
     362        print 'here i am about to calculate z with dx = ', dx
    358363        for i in range(N):
    359364            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) \
    361366                            * (exp(-((xr[i]-x0)/wa)**2) - \
    362367                                kappad*exp(-((xr[i]-dx-x0)/wa)**2))
     368                if z[i] > maxz: maxz = z[i]
    363369            except OverflowError:
    364370                pass
    365 
     371       
     372        print 'maximum of Double Gaussian function', maxz
    366373        return z
    367374
     
    386393
    387394        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  
    4949\begin{figure}[hbt]
    5050
    51   \centerline{ \includegraphics[width=75mm, height=75mm]{onslow_data_extent.png}}
     51  \centerline{ \includegraphics[width=100mm, height=75mm]{onslow_data_extent.png}}
    5252
    5353  \caption{Data extent for Onslow scenario. Offshore data shown in blue and onshore data
  • production/pt_hedland_2006/data.tex

    r2860 r2869  
    5555\begin{figure}[hbt]
    5656
    57   \centerline{ \includegraphics[width=75mm, height=75mm]{pt_hedland_data_extent.png}}
     57  \centerline{ \includegraphics[width=100mm, height=75mm]{pt_hedland_data_extent.png}}
    5858
    5959  \caption{Data extent for Pt Hedland scenario. Offshore data shown in blue and onshore data
  • production/sydney_2006/find_max.py

    r2862 r2869  
    55
    66from math import exp, cosh
     7import Numeric
    78
    89# Grilli and Watts 2005 example
     
    1920   
    2021def 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
    2324    return -numerator/denominator
    2425
    2526def 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)
    2728    return dfdx
    2829
     
    3435direction = 'positive'
    3536while c < 100000 and deriv > 0:
    36     deriv = dfuncdx(x,0.83)
     37    deriv = dfuncdx(x,1.0)
    3738    if deriv < 0: xstar = x
    3839    if direction == 'positive': x += step
     
    4041    c += 1
    4142
    42 print 'location of maximum of surface elevation function: xstar = %f' % (xstar)
     43print 'location of maximum of surface elevation function: xstar = %f' % (xstar/lam0)
    4344const = 1.0 #a3D = ? #sydney = 86? and kappad=1
    44 print 'eta(xstar): %f' % (const*func(xstar,y0,0.83))
    4545
     46x = arange(-20,25,0.001)
     47y = arange(-10,10,0.1)
     48X,Y = meshgrid(x,y)
    4649
    47 
    48 
     50test = 0.0
     51for 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   
     62print 'check: xstar = %f and eta(xstar) = %f' %(xstar/lam0, test)
Note: See TracChangeset for help on using the changeset viewer.