Changeset 2878 for production/sydney_2006/find_max.py
- Timestamp:
- May 16, 2006, 2:06:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
production/sydney_2006/find_max.py
r2869 r2878 6 6 from math import exp, cosh 7 7 import Numeric 8 8 9 9 10 # Grilli and Watts 2005 example … … 33 34 tol = 0.001 34 35 c = 0 35 direction = ' positive'36 direction = 'negative' 36 37 while c < 100000 and deriv > 0: 37 deriv = dfuncdx(x, 1.0)38 deriv = dfuncdx(x,0.83) 38 39 if deriv < 0: xstar = x 39 40 if direction == 'positive': x += step … … 50 51 test = 0.0 51 52 for xi in x: 52 testi = func(xi,0.0, 1.0)53 testi = func(xi,0.0,0.83) 53 54 if direction == 'positive': 54 55 if testi > test:
Note: See TracChangeset
for help on using the changeset viewer.