Ignore:
Timestamp:
Jun 21, 2006, 9:31:57 AM (18 years ago)
Author:
sexton
Message:

MOST and ANUGA comparisons and updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/sydney_2006/find_max.py

    r2878 r3190  
    3535c = 0
    3636direction = 'negative'
     37xstar = x0
     38print 'start of loop', deriv
    3739while c < 100000 and deriv > 0:
    3840    deriv = dfuncdx(x,0.83)
    39     if deriv < 0: xstar = x
     41    if deriv < 0:
     42        xstar = x
     43        print 'hello', deriv, xstar/lam0, c
    4044    if direction == 'positive': x += step
    4145    if direction == 'negative': x -= step
    4246    c += 1
     47   
    4348
    4449print 'location of maximum of surface elevation function: xstar = %f' % (xstar/lam0)
    4550const = 1.0 #a3D = ? #sydney = 86? and kappad=1
    4651
    47 x = arange(-20,25,0.001)
    48 y = arange(-10,10,0.1)
    49 X,Y = meshgrid(x,y)
     52#x = arange(-20,25,0.001)
     53#y = arange(-10,10,0.1)
     54#X,Y = meshgrid(x,y)
    5055
    51 test = 0.0
    52 for xi in x:
    53     testi = func(xi,0.0,0.83)
    54     if direction == 'positive':
    55         if testi > test:
    56             test = testi
    57             xstar = xi
    58     else:
    59         if testi < test:
    60             test = testi
    61             xstar = xi
     56#test = 0.0
     57#for xi in x:
     58#    testi = func(xi,0.0,0.83)
     59#    if direction == 'positive':
     60#        if testi > test:
     61#            test = testi
     62#            xstar = xi
     63#    else:
     64#        if testi < test:
     65#            test = testi
     66#            xstar = xi
    6267   
    63 print 'check: xstar = %f and eta(xstar) = %f' %(xstar/lam0, test)
     68#print 'check: xstar = %f and eta(xstar) = %f' %(xstar/lam0, test)
Note: See TracChangeset for help on using the changeset viewer.