Changeset 172 for branches/UQ/TEST.py
- Timestamp:
- 08/07/09 11:28:29 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UQ/TEST.py
r157 r172 9 9 #XXX: <mpi config goes here> 10 10 11 npop = 100 12 maxiter = 2 #XXX: maxiter too small? 13 maxfun = 10 #XXX: maxfun too small? 14 convergence_tol = 0.05 15 crossover = 0.5 16 percent_change = 1.0 #XXX: is 0.9 better? 17 11 npop = 20 12 maxiter = 500 13 maxfun = 1e+6 14 convergence_tol = 1e-4 15 crossover = 0.9 16 percent_change = 0.9 18 17 19 18 ####################################################################### … … 28 27 def model(t): 29 28 """a simple time-dependent model function 30 f(t) = x1*x2 + x3 + 2.0 [yes, it's actually time-independent...]29 f(t) = x1*x2 + x3 + 2.0 31 30 32 31 Input: … … 84 83 def dakota(cost,lb,ub): 85 84 from mystic.differential_evolution import DifferentialEvolutionSolver2 86 from mystic.termination import VTR85 from mystic.termination import CandidateRelativeTolerance as CRT 87 86 from mystic.strategy import Best1Exp 88 87 from mystic import getch, random_seed, VerboseSow, Sow … … 90 89 random_seed(123) 91 90 92 stepmon = VerboseSow() 91 #stepmon = VerboseSow(100) 92 stepmon = Sow() 93 93 evalmon = Sow() 94 94 … … 100 100 solver.SetEvaluationLimits(maxiter,maxfun) 101 101 102 solver.Solve(cost,termination=VTR(convergence_tol),strategy=Best1Exp, \ 102 tol = convergence_tol 103 solver.Solve(cost,termination=CRT(tol,tol),strategy=Best1Exp, \ 103 104 CrossProbability=crossover,ScalingFactor=percent_change, \ 104 105 StepMonitor=stepmon, EvaluationMonitor=evalmon) 105 106 107 print solver.Solution() 106 108 diameter = -solver.bestEnergy / scale 107 109 func_evals = len(evalmon.y) … … 152 154 print " model: f(t) = x1*x2 + x3 + 2.0" 153 155 print " parameters: ['x1', 'x2', 'x3']" 156 print " lower bounds: %s" % lower_bounds 157 print " upper bounds: %s" % upper_bounds 154 158 print " ..." 155 159
Note: See TracChangeset
for help on using the changeset viewer.