- Timestamp:
- 12/21/12 05:33:02 (3 years ago)
- Location:
- branches
- Files:
-
- 1 added
- 8 edited
- 1 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/UQ/math/legacy/envelope/Looper_BoLiSurr_Cy.py
r601 r621 31 31 # the model function 32 32 ####################################################################### 33 #from otm_hvi import eureka as model 34 from otm_hvi_new import eureka as model 33 from otm_hvi import eureka as model 35 34 36 35 -
branches/UQ/math/legacy/envelope/hausdorff.py
r592 r621 11 11 y_mean = 12.0; y_mean_error = 0.0 12 12 13 from otm_hvi _newimport eureka as model13 from otm_hvi import eureka as model 14 14 15 15 """ -
branches/UQ/math/legacy/envelope/memoize.py
r601 r621 162 162 if deep: rounded = deep_round 163 163 else: rounded = simple_round 164 #else: rounded = shallow_round 164 #else: rounded = shallow_round #FIXME: slow 165 165 166 166 @rounded(tol) … … 194 194 if deep: rounded = deep_round 195 195 else: rounded = simple_round 196 #else: rounded = shallow_round 196 #else: rounded = shallow_round #FIXME: slow 197 197 198 198 @rounded(tol) -
branches/UQ/math/legacy/envelope/otm_hvi.py
r601 r621 6 6 # libo@caltech.edu 7 7 # 8 # Model: evaluate the function by interpolation based on the values at the grid points from a database8 # Model: evaluate the function by bilinear interpolation based on the values at the grid points from a database 9 9 # 10 import os, sys, stat, string 11 from numpy import inf 10 12 11 import os, sys, math, string 13 H = [0.5, 3.5] 14 V = [4.5, 7.0] 15 O = [0, 60] 12 16 13 # 17 #verbose = False 14 18 15 V = [4.5, 7.0]16 H = [0.5, 3.0]17 O = [0, 30]18 19 VD = V[1] - V[0]20 HD = H[1] - H[0]21 OD = O[1] - O[0]22 23 TOLERANCE = 1.0e-824 25 def regularize(x):26 if x < 1.0:27 return 0.528 elif x > 2.0:29 return 3.030 else:31 return 1.532 33 19 from memoize import memoized_nopickle_round as memoized 34 20 … … 37 23 """ Notes for now, will be fixed in the future!!! 38 24 Assumption: (1) thickness can only be 0.5, 1.5 or 3.0 39 (2) obliquity must be zero 40 (3) linear interpolation 25 (2) bilinear interpolation on a regular grid 41 26 """ 42 43 # if verbose: 44 # print "input is:", x 45 46 """thickness regularization will be removed in the future""" 47 thickness = regularize(float(x[0])) 27 thickness = float(x[0]) 48 28 velocity = float(x[1]) 49 29 obliquity = float(x[2]) 50 30 51 if thickness < H[0] or thickness > H[1] \ 52 or velocity < V[0] or velocity > V[1] \ 53 or obliquity < O[0] or obliquity > O[1]: 54 #raise IOError, "input is out of the range of investigation" 55 from numpy import inf 56 return inf # "input is out of the range of investigation" 31 if thickness < H[0] or thickness > H[1] \ 32 or velocity < V[0] or velocity > V[1] \ 33 or obliquity < O[0] or obliquity > O[1]: 34 error_msg = "(" + str(thickness) + "," + str(velocity) + "," \ 35 + str(obliquity) + ") is out of the range of investigation" 36 return inf # error_msg 37 57 38 58 39 if root_path == ".": … … 62 43 63 44 foundFromDB = False 64 db_ file = baseDir + "//otm_hvi_db.py"65 kd_tree = baseDir + "//kdtree.py"45 db_name = 'otm_hvi_db' 46 exec 'db_file = baseDir + "//%s.py"' % db_name 66 47 67 48 # evaluate the function by interpolation based on grid points in the database 68 if True: #os.path.exists(db_file) and os.path.exists(kd_tree): 69 from otm_hvi_db import otm_hvi_tests as db_points 70 from otm_hvi_db import otm_hvi_perforation as db_values 49 if True: #os.path.exists(db_file): 50 if thickness < 1.0: 51 exec 'from %s import thin_plate as perforation_area' % db_name 52 elif thickness > 2.0: 53 exec 'from %s import thick_plate as perforation_area' % db_name 54 else: 55 exec 'from %s import medium_plate as perforation_area' % db_name 56 57 from operator import itemgetter 58 sorted_db = sorted(perforation_area.items(), key=itemgetter(0)) 71 59 72 # normalize 73 data=[] 74 indices=[] 75 counter=0 76 for var in db_points: 77 if math.fabs(var[0] - thickness) < TOLERANCE: # will be removed as the regularization is gone 78 htemp = (var[0]-H[0])/HD 79 vtemp = (var[1]-V[0])/VD 80 otemp = (var[2]-O[0])/OD 81 data.append( (htemp, vtemp, otemp) ) 82 indices.append(counter) 83 counter += 1 84 85 thickness = (thickness - H[0]) / HD 86 velocity = (velocity - V[0]) / VD 87 obliquity = (obliquity - O[0]) / OD 88 89 # build a kdtree of the grid points and query for the nearest neighbors 90 from kdtree import KDTree 91 tree = KDTree.construct_from_data(data) 92 nearest = tree.query(query_point=(thickness, velocity, obliquity), t=2) 93 94 gridpoints = [] 95 for var in nearest: 96 gridpoints.append( indices[data.index(var)] ) 60 isLess = False 61 isGreat = False 62 63 v0 = velocity 64 v1 = velocity 65 a0 = obliquity 66 a1 = obliquity 67 68 for v in sorted_db: 69 if len(v[0]) <> 2: 70 return inf # "dimension of the variable is incorrect" 71 72 if velocity <= v[0][0] and obliquity <= v[0][1]: 73 isLess = True 74 v1 = v[0][0] 75 a1 = v[0][1] 76 break 77 elif velocity >= v[0][0] and obliquity >= v[0][1]: 78 isGreat = True 79 v0 = v[0][0] 80 a0 = v[0][1] 97 81 98 82 # if verbose: 99 # print "nearest neighbors are" 100 # print db_points[gridpoints[0]], ":", db_values[gridpoints[0]] 101 # print db_points[gridpoints[1]], ":", db_values[gridpoints[1]] 83 # print "Neighbors of (", thickness, velocity, obliquity,") are:" 84 # print "(",v0,",", a0,"):", perforation_area[(v0, a0)] 85 # print "(",v0,",", a1,"):", perforation_area[(v0, a1)] 86 # print "(",v1,",", a0,"):", perforation_area[(v1, a0)] 87 # print "(",v1,",", a1,"):", perforation_area[(v1, a1)] 88 89 if not isLess or not isGreat: 90 print "Warning: extrapolation from the database grid points will be used" 102 91 103 # linear interpolation 104 v0 = nearest[0][1] 105 v1 = nearest[1][1] 92 # bilinear interpolation 93 if v0 == v1: 94 if a0 == a1: 95 Perf = perforation_area[(v0, a0)] 96 else: 97 Perf = (a1 - obliquity) * perforation_area[(v0, a0)] / (a1 - a0) + \ 98 (obliquity - a0) * perforation_area[(v0, a1)] / (a1 - a0) 99 elif a0 == a1: 100 Perf = (v1 - velocity) * perforation_area[(v0, a0)] / (v1 - v0) + \ 101 (velocity - v0) * perforation_area[(v1, a0)] / (v1 - v0) 102 else: 103 P0 = (v1 - velocity) * perforation_area[(v0, a0)] / (v1 - v0) + \ 104 (velocity - v0) * perforation_area[(v1, a0)] / (v1 - v0) 106 105 107 if math.fabs(v0 - v1) < TOLERANCE:108 raise IOError, "warning: duplicated record found in the database"106 P1 = (v1 - velocity) * perforation_area[(v0, a1)] / (v1 - v0) + \ 107 (velocity - v0) * perforation_area[(v1, a1)] / (v1 - v0) 109 108 110 Perf = (v1 - velocity) * db_values[gridpoints[0]] / (v1 - v0) + \ 111 (velocity - v0) * db_values[gridpoints[1]] / (v1 - v0) 109 Perf = (a1 - obliquity) * P0 / (a1 - a0) + \ 110 (obliquity - a0) * P1 / (a1 - a0) 111 112 112 113 113 # if verbose: -
branches/UQ/math/legacy/envelope/otm_hvi_db.py
r592 r621 1 1 # 2 # Database of OTM simulations of hypervelocity impact tests2 # perforation area database 3 3 # 4 # otm_hvi_tests: coordinates of the test points are (thickness[mm], impact speed[km/s], obliquity[degrees]) 5 # otm_hvi_perforation: performance measurement, the perforation area 4 # {(Velocity, Obliquity) : Area} 6 5 # 7 6 8 otm_hvi_tests = [(0.5, 4.5, 0.0), \ 9 (0.5, 4.6, 0.0), \ 10 (0.5, 4.7, 0.0), \ 11 (0.5, 4.8, 0.0), \ 12 (0.5, 4.9, 0.0), \ 13 (0.5, 5.0, 0.0), \ 14 (0.5, 5.1, 0.0), \ 15 (0.5, 5.2, 0.0), \ 16 (0.5, 5.3, 0.0), \ 17 (0.5, 5.4, 0.0), \ 18 (0.5, 5.5, 0.0), \ 19 (0.5, 5.6, 0.0), \ 20 (0.5, 5.7, 0.0), \ 21 (0.5, 5.8, 0.0), \ 22 (0.5, 5.9, 0.0), \ 23 (0.5, 6.0, 0.0), \ 24 (0.5, 6.1, 0.0), \ 25 (0.5, 6.2, 0.0), \ 26 (0.5, 6.3, 0.0), \ 27 (0.5, 6.4, 0.0), \ 28 (0.5, 6.5, 0.0), \ 29 (1.5, 4.5, 0.0), \ 30 (1.5, 4.6, 0.0), \ 31 (1.5, 4.7, 0.0), \ 32 (1.5, 4.8, 0.0), \ 33 (1.5, 4.9, 0.0), \ 34 (1.5, 5.0, 0.0), \ 35 (1.5, 5.1, 0.0), \ 36 (1.5, 5.2, 0.0), \ 37 (1.5, 5.3, 0.0), \ 38 (1.5, 5.4, 0.0), \ 39 (1.5, 5.5, 0.0), \ 40 (1.5, 5.6, 0.0), \ 41 (1.5, 5.7, 0.0), \ 42 (1.5, 5.8, 0.0), \ 43 (1.5, 5.9, 0.0), \ 44 (1.5, 6.0, 0.0), \ 45 (1.5, 6.1, 0.0), \ 46 (1.5, 6.2, 0.0), \ 47 (1.5, 6.3, 0.0), \ 48 (1.5, 6.4, 0.0), \ 49 (0.5, 5.44, 0.0), \ 50 (0.5, 4.71, 0.0), \ 51 (0.5, 5.74, 0.0), \ 52 (0.5, 6.31, 0.0), \ 53 (0.5, 5.49, 0.0), \ 54 (1.5, 5.59, 0.0), \ 55 (1.5, 5.45, 0.0), \ 56 (1.5, 5.41, 0.0), \ 57 (1.5, 5.54, 0.0), \ 58 (1.5, 4.91, 0.0), \ 59 (3.0, 5.4, 0.0), \ 60 (3.0, 5.6, 0.0), \ 61 (3.0, 5.8, 0.0), \ 62 (3.0, 5.9, 0.0), \ 63 (3.0, 6.0, 0.0), \ 64 (3.0, 6.1, 0.0), \ 65 (3.0, 6.2, 0.0), \ 66 (3.0, 6.4, 0.0), \ 67 (3.0, 4.5, 0.0) 68 ] 7 # perforation area for plates with thickness equal to 0.508mm 8 thin_plate = { 9 ( 4.5, 0 ): 12.3 , 10 ( 4.6, 0 ): 12.5 , 11 ( 4.7, 0 ): 12.3 , 12 ( 4.8, 0 ): 13.3 , 13 ( 4.9, 0 ): 12.7 , 14 ( 5.0, 0 ): 12.8 , 15 ( 5.1, 0 ): 12.3 , 16 ( 5.2, 0 ): 12.8 , 17 ( 5.3, 0 ): 13.3 , 18 ( 5.4, 0 ): 13.3 , 19 ( 5.5, 0 ): 13.8 , 20 ( 5.6, 0 ): 12.7 , 21 ( 5.7, 0 ): 12.1 , 22 ( 5.8, 0 ): 11.5 , 23 ( 5.9, 0 ): 11.2 , 24 ( 6.0 , 0 ): 11.5535654 , 25 ( 6.1 , 0 ): 11.3421896111 , 26 ( 6.2 , 0 ): 11.4162807857 , 27 ( 6.3 , 0 ): 11.4594314375 , 28 ( 6.4 , 0 ): 11.412626 , 29 ( 6.5 , 0 ): 11.4911285 , 30 ( 6.6 , 0 ): 11.2062635833 , 31 ( 6.7 , 0 ): 11.27686625 , 32 ( 6.8 , 0 ): 11.4230734167 , 33 ( 6.9 , 0 ): 10.9008768 , 34 ( 7.0 , 0 ): 11.8460239167 , 35 ( 4.5 , 45 ): 9.25105066677 , 36 ( 4.5 , 60 ): 9.6061145 , 37 ( 4.6 , 45 ): 9.1585505 , 38 ( 4.6 , 60 ): 9.664932 , 39 ( 4.7 , 45 ): 9.11351266667 , 40 ( 4.7 , 60 ): 10.2398305 , 41 ( 4.8 , 45 ): 9.26738016667 , 42 ( 4.8 , 60 ): 9.17675033333 , 43 ( 4.9 , 45 ): 9.07589466667 , 44 ( 4.9 , 60 ): 10.33518533333 , 45 ( 5.0 , 45 ): 9.57027866667 , 46 ( 5.0 , 60 ): 9.64322533333 , 47 ( 5.1 , 45 ): 9.61081283333 , 48 ( 5.1 , 60 ): 10.91953416667 , 49 ( 5.2 , 45 ): 9.05105016667 , 50 ( 5.2 , 60 ): 10.06503166667 , 51 ( 5.3 , 45 ): 9.55746883333 , 52 ( 5.3 , 60 ): 10.55018633333 , 53 ( 5.4 , 45 ): 9.086453 , 54 ( 5.4 , 60 ): 9.77605016667 , 55 ( 5.5 , 45 ): 9.9410665 , 56 ( 5.5 , 60 ): 10.75905916667 , 57 ( 5.6 , 45 ): 9.21876133333 , 58 ( 5.6 , 60 ): 11.0683073333 , 59 ( 5.7 , 45 ): 9.1762705 , 60 ( 5.7 , 60 ): 11.283345 , 61 ( 5.8 , 45 ): 9.19642683333 , 62 ( 5.8 , 60 ): 9.76204183333 , 63 ( 5.9 , 45 ): 9.51047433333 , 64 ( 5.9 , 60 ): 9.64434283333 , 65 ( 6.0 , 45 ): 9.590029 , 66 ( 6.0 , 60 ): 11.6629458333 , 67 ( 6.1 , 45 ): 9.663271 , 68 ( 6.1 , 60 ): 11.0696635 , 69 ( 6.2 , 45 ): 9.134481 , 70 ( 6.2 , 60 ): 11.9275625 , 71 ( 6.3 , 45 ): 9.18908033333 , 72 ( 6.3 , 60 ): 11.8987673333 , 73 ( 6.4 , 45 ): 9.27823366667 , 74 ( 6.4 , 60 ): 11.6334128333 , 75 ( 6.5 , 45 ): 9.22175133333 , 76 ( 6.5 , 60 ): 11.7217905 , 77 ( 6.6 , 45 ): 9.50741016667 , 78 ( 6.6 , 60 ): 12.5000611667 , 79 ( 6.7 , 45 ): 9.59947933333 , 80 ( 6.7 , 60 ): 12.045104 , 81 ( 6.8 , 45 ): 9.2221205 , 82 ( 6.8 , 60 ): 12.0937598333 , 83 ( 6.9 , 45 ): 9.20919983333 , 84 ( 6.9 , 60 ): 12.3922655 , 85 ( 7.0 , 45 ): 9.42257633333, 86 ( 7.0 , 60 ): 12.4942725333 87 } 69 88 70 otm_hvi_perforation = [12.3, \ 71 12.5, \ 72 12.3, \ 73 13.3, \ 74 12.7, \ 75 12.8, \ 76 12.3, \ 77 12.8, \ 78 13.3, \ 79 13.3, \ 80 13.8, \ 81 12.7, \ 82 12.1, \ 83 11.5, \ 84 11.2, \ 85 11.6, \ 86 11.5, \ 87 11.9, \ 88 11.5, \ 89 11.4, \ 90 11.3, \ 91 22.5, \ 92 23.6, \ 93 23.3, \ 94 24.6, \ 95 24.1, \ 96 25.0, \ 97 25.9, \ 98 26.4, \ 99 25.0, \ 100 23.8, \ 101 22.4, \ 102 21.5, \ 103 26.1, \ 104 26.7, \ 105 25.8, \ 106 26.3, \ 107 24.7, \ 108 22.4, \ 109 19.9, \ 110 18.9, \ 111 13.2, \ 112 12.7, \ 113 13.2, \ 114 14.0, \ 115 12.9, \ 116 24.2, \ 117 17.2, \ 118 22.1, \ 119 24.3, \ 120 21.3, \ 121 6.06, \ 122 9.04, \ 123 10.7, \ 124 13.1, \ 125 16.0, \ 126 17.0, \ 127 21.3, \ 128 18.4, \ 129 0.0 130 ] 89 # perforation area for plates with thickness equal to 1.52mm 90 medium_plate = { 91 ( 4.5, 0 ): 18.9 , 92 ( 4.6, 0 ): 18.8 , 93 ( 4.7, 0 ): 19.0 , 94 ( 4.8, 0 ): 19.7 , 95 ( 4.9, 0 ): 20.7 , 96 ( 5.0, 0 ): 19.5 , 97 ( 5.1, 0 ): 19.7 , 98 ( 5.2, 0 ): 21.3 , 99 ( 5.3, 0 ): 21.1 , 100 ( 5.4, 0 ): 20.4 , 101 ( 5.5, 0 ): 21.2 , 102 ( 5.6, 0 ): 21.9 , 103 ( 5.7, 0 ): 22.1 , 104 ( 5.8, 0 ): 22.4 , 105 ( 5.9, 0 ): 22.3 , 106 ( 6.0 , 0 ): 23.2 , 107 ( 6.1 , 0 ): 23.3 , 108 ( 6.2 , 0 ): 22.8 , 109 ( 6.3 , 0 ): 22.8 , 110 ( 6.4 , 0 ): 24.2 , 111 ( 6.5 , 0 ): 23.9 , 112 ( 6.6 , 0 ): 23.1 , 113 ( 6.7 , 0 ): 24.1 , 114 ( 6.8 , 0 ): 24.0 , 115 ( 6.9 , 0 ): 24.7 , 116 ( 7.0 , 0 ): 24.4 , 117 ( 4.5 , 15 ): 11.9758614444 , 118 ( 4.5 , 45 ): 11.1415517778 , 119 ( 4.5 , 60 ): 11.4755954444 , 120 ( 4.6 , 15 ): 13.8261825556 , 121 ( 4.6 , 45 ): 12.2640794444 , 122 ( 4.6 , 60 ): 10.313887 , 123 ( 4.7 , 15 ): 13.7398968889 , 124 ( 4.7 , 45 ): 12.5483601111 , 125 ( 4.7 , 60 ): 16.0970304444 , 126 ( 4.8 , 15 ): 13.446018 , 127 ( 4.8 , 45 ): 12.5877005 , 128 ( 4.8 , 60 ): 21.9546464444 , 129 ( 4.9 , 15 ): 14.1198644444 , 130 ( 4.9 , 45 ): 11.7116386667 , 131 ( 4.9 , 60 ): 12.8032797778 , 132 ( 5.0 , 15 ): 14.3409686667 , 133 ( 5.0 , 45 ): 14.2095835 , 134 ( 5.0 , 60 ): 13.1176347778 , 135 ( 5.1 , 15 ): 15.275986 , 136 ( 5.1 , 45 ): 13.6035278889 , 137 ( 5.1 , 60 ): 14.5010872222 , 138 ( 5.2 , 15 ): 15.2714577778 , 139 ( 5.2 , 45 ): 13.7330303333 , 140 ( 5.2 , 60 ): 23.1748794444 , 141 ( 5.3 , 15 ): 16.1144058889 , 142 ( 5.3 , 45 ): 14.3487458889 , 143 ( 5.3 , 60 ): 13.4906375556 , 144 ( 5.4 , 15 ): 15.1590597778 , 145 ( 5.4 , 45 ): 14.3762362222 , 146 ( 5.4 , 60 ): 16.0228041111 , 147 ( 5.5 , 15 ): 16.0015894444 , 148 ( 5.5 , 45 ): 14.9338207778 , 149 ( 5.5 , 60 ): 16.0445106667 , 150 ( 5.6 , 15 ): 15.6245255556 , 151 ( 5.6 , 45 ): 15.8129466667 , 152 ( 5.6 , 60 ): 18.1305554444 , 153 ( 5.7 , 15 ): 16.371196 , 154 ( 5.7 , 45 ): 16.2530391111 , 155 ( 5.7 , 60 ): 22.1308112222 , 156 ( 5.8 , 15 ): 17.6019132222 , 157 ( 5.8 , 45 ): 16.2494211111 , 158 ( 5.8 , 60 ): 17.9118135556 , 159 ( 5.9 , 15 ): 17.1156016667 , 160 ( 5.9 , 45 ): 16.383846 , 161 ( 5.9 , 60 ): 19.0622746667 , 162 ( 6.0 , 15 ): 18.1810260833 , 163 ( 6.0 , 45 ): 14.6120332222 , 164 ( 6.0 , 60 ): 25.3964807778 , 165 ( 6.1 , 15 ): 18.4554193333 , 166 ( 6.1 , 45 ): 16.029892 , 167 ( 6.1 , 60 ): 18.9705008667 , 168 ( 6.2 , 15 ): 18.581181 , 169 ( 6.2 , 45 ): 15.2187657778 , 170 ( 6.2 , 60 ): 22.0153122222 , 171 ( 6.3 , 15 ): 18.7592407778 , 172 ( 6.3 , 45 ): 14.8438187778 , 173 ( 6.3 , 60 ): 24.678064 , 174 ( 6.4 , 15 ): 18.545077 , 175 ( 6.4 , 45 ): 15.5203723333 , 176 ( 6.4 , 60 ): 22.1058065833 , 177 ( 6.5 , 15 ): 18.1750272222 , 178 ( 6.5 , 45 ): 16.8821674444 , 179 ( 6.5 , 60 ): 24.6437564444 , 180 ( 6.6 , 15 ): 20.357719 , 181 ( 6.6 , 45 ): 16.4267426667 , 182 ( 6.6 , 60 ): 21.6557961667 , 183 ( 6.7 , 15 ): 20.1706266667 , 184 ( 6.7 , 45 ): 16.3197836667 , 185 ( 6.7 , 60 ): 19.066668 , 186 ( 6.8 , 15 ): 18.3587475556 , 187 ( 6.8 , 45 ): 17.3180018889 , 188 ( 6.8 , 60 ): 24.0496985556 , 189 ( 6.9 , 15 ): 17.6267947778 , 190 ( 6.9 , 45 ): 17.2380164444 , 191 ( 6.9 , 60 ): 28.3457403333 , 192 ( 7.0 , 15 ): 17.2169987778 , 193 ( 7.0 , 45 ): 18.2761042222 , 194 ( 7.0 , 60 ): 26.1195984444 195 } 196 197 # perforation area for plates with thickness equal to 3.048mm 198 thick_plate = { 199 ( 4.5, 0 ): 2.5 , 200 ( 4.6, 0 ): 3.9 , 201 ( 4.7, 0 ): 5.1 , 202 ( 4.8, 0 ): 8.6 , 203 ( 4.9, 0 ): 9.4 , 204 ( 5.0, 0 ): 9.1 , 205 ( 5.1, 0 ): 10.2 , 206 ( 5.2, 0 ): 9.5 , 207 ( 5.3, 0 ): 9.9 , 208 ( 5.4, 0 ): 10.0 , 209 ( 5.5, 0 ): 11.1 , 210 ( 5.6, 0 ): 10.9 , 211 ( 5.7, 0 ): 10.8 , 212 ( 5.8, 0 ): 12.7 , 213 ( 5.9, 0 ): 11.4 , 214 ( 6.0 , 0 ): 11.6 , 215 ( 6.1 , 0 ): 12.2 , 216 ( 6.2 , 0 ): 12.7 , 217 ( 6.3 , 0 ): 12.6 , 218 ( 6.4 , 0 ): 12.5 , 219 ( 6.5 , 0 ): 12.9 , 220 ( 6.6 , 0 ): 13.3 , 221 ( 6.7 , 0 ): 12.5 , 222 ( 6.8 , 0 ): 13.2 , 223 ( 6.9 , 0 ): 13.2 , 224 ( 7.0 , 0 ): 13.5 , 225 ( 4.5 , 15 ): 2.75862593333 , 226 ( 4.5 , 45 ): 2.8480891 , 227 ( 4.5 , 60 ): 0., 228 ( 4.6 , 15 ): 2.98923496667 , 229 ( 4.6 , 45 ): 3.27783415 , 230 ( 4.6 , 60 ): 0., 231 ( 4.7 , 15 ): 3.3070479 , 232 ( 4.7 , 45 ): 3.85758515 , 233 ( 4.7 , 60 ): 0., 234 ( 4.8 , 15 ): 4.14662906667 , 235 ( 4.8 , 45 ): 4.46099408333 , 236 ( 4.8 , 60 ): 0., 237 ( 4.9 , 15 ): 3.7108611 , 238 ( 4.9 , 45 ): 3.85146668 , 239 ( 4.9 , 60 ): 0., 240 ( 5.0 , 15 ): 3.81428586667 , 241 ( 5.0 , 45 ): 3.85597195 , 242 ( 5.0 , 60 ): 0., 243 ( 5.1 , 15 ): 4.35555343333 , 244 ( 5.1 , 45 ): 5.43402572857 , 245 ( 5.1 , 60 ): 0., 246 ( 5.2 , 15 ): 4.19131263333 , 247 ( 5.2 , 45 ): 5.101126 , 248 ( 5.2 , 60 ): 0., 249 ( 5.3 , 15 ): 4.36693856667 , 250 ( 5.3 , 45 ): 6.18458898333 , 251 ( 5.3 , 60 ): 0., 252 ( 5.4 , 15 ): 4.33538973333 , 253 ( 5.4 , 45 ): 6.94201655 , 254 ( 5.4 , 60 ): 0., 255 ( 5.5 , 15 ): 4.9048023 , 256 ( 5.5 , 45 ): 9.52444816667 , 257 ( 5.5 , 60 ): 0., 258 ( 5.6 , 15 ): 5.3208275 , 259 ( 5.6 , 45 ): 7.46289146667 , 260 ( 5.6 , 60 ): 0., 261 ( 5.7 , 15 ): 6.13779616667 , 262 ( 5.7 , 45 ): 7.6791622 , 263 ( 5.7 , 60 ): 1.16938453333 , 264 ( 5.8 , 15 ): 6.90682286667 , 265 ( 5.8 , 45 ): 8.16314296667 , 266 ( 5.8 , 60 ): 1.22292553333 , 267 ( 5.9 , 15 ): 5.59048173333 , 268 ( 5.9 , 45 ): 8.99577646667 , 269 ( 5.9 , 60 ): 1.57136666667 , 270 ( 6.0 , 15 ): 7.59415366667 , 271 ( 6.0 , 45 ): 9.1000947 , 272 ( 6.0 , 60 ): 1.04320443333 , 273 ( 6.1 , 15 ): 7.9807712 , 274 ( 6.1 , 45 ): 8.91958856667 , 275 ( 6.1 , 60 ): 1.71702376667 , 276 ( 6.2 , 15 ): 8.7644119 , 277 ( 6.2 , 45 ): 9.4844235 , 278 ( 6.2 , 60 ): 2.20418855 , 279 ( 6.3 , 15 ): 9.2787699 , 280 ( 6.3 , 45 ): 9.1834445 , 281 ( 6.3 , 60 ): 2.34744582 , 282 ( 6.4 , 15 ): 10.0351047 , 283 ( 6.4 , 45 ): 9.49863623333 , 284 ( 6.4 , 60 ): 1.9724625 , 285 ( 6.5 , 15 ): 9.89446076667 , 286 ( 6.5 , 45 ): 10.4168566333 , 287 ( 6.5 , 60 ): 2.8868218 , 288 ( 6.6 , 15 ): 10.0107694 , 289 ( 6.6 , 45 ): 10.8874958 , 290 ( 6.6 , 60 ): 4.0237494 , 291 ( 6.7 , 15 ): 10.4600414667 , 292 ( 6.7 , 45 ): 9.8382372 , 293 ( 6.7 , 60 ): 4.17190325 , 294 ( 6.8 , 15 ): 10.5117021333 , 295 ( 6.8 , 45 ): 11.1037666 , 296 ( 6.8 , 60 ): 4.88727453333 , 297 ( 6.9 , 15 ): 10.6708929 , 298 ( 6.9 , 45 ): 10.7069675 , 299 ( 6.9 , 60 ): 4.7445608 , 300 ( 7.0 , 15 ): 9.6625781 , 301 ( 7.0 , 45 ): 11.3924820333 , 302 ( 7.0 , 60 ): 4.6869812 303 } -
branches/UQ/math/legacy/envelope/otm_hvi_old.py
r601 r621 62 62 63 63 foundFromDB = False 64 db_file = baseDir + "//otm_hvi_db.py" 64 db_name = 'otm_hvi_db_old' 65 exec 'db_file = baseDir + "//%s.py"' % db_name 65 66 kd_tree = baseDir + "//kdtree.py" 66 67 67 68 # evaluate the function by interpolation based on grid points in the database 68 69 if True: #os.path.exists(db_file) and os.path.exists(kd_tree): 69 from otm_hvi_db import otm_hvi_tests as db_points70 from otm_hvi_db import otm_hvi_perforation as db_values70 exec 'from %s import otm_hvi_tests as db_points' % db_name 71 exec 'from %s import otm_hvi_perforation as db_values' % db_name 71 72 72 73 # normalize -
branches/UQ/math/legacy/envelope/plot_bo0.py
r592 r621 1 from otm_hvi _newimport eureka as eureka_new2 from otm_hvi import eureka as eureka_old1 from otm_hvi import eureka as eureka_new 2 from otm_hvi_old import eureka as eureka_old 3 3 def new_model(h,v): 4 4 return eureka_new([h,v,0.0]) -
branches/UQ/math/legacy/envelope/plot_bo2.py
r592 r621 1 from otm_hvi _newimport eureka as eureka_new2 from otm_hvi import eureka as eureka_old1 from otm_hvi import eureka as eureka_new 2 from otm_hvi_old import eureka as eureka_old 3 3 def model_factory(h, a, model): 4 4 def _model(v): -
branches/UQ/math/legacy/envelope/runinfo.py
r592 r621 23 23 settings.update({'maxiter': maxiter, 'npop':npop, 'imax':imax, 'ipop':ipop}) 24 24 25 from otm_hvi _newimport eureka as model25 from otm_hvi import eureka as model 26 26 27 27 # bounds -
branches/decorate/memoize.py
r601 r621 162 162 if deep: rounded = deep_round 163 163 else: rounded = simple_round 164 #else: rounded = shallow_round 164 #else: rounded = shallow_round #FIXME: slow 165 165 166 166 @rounded(tol) … … 194 194 if deep: rounded = deep_round 195 195 else: rounded = simple_round 196 #else: rounded = shallow_round 196 #else: rounded = shallow_round #FIXME: slow 197 197 198 198 @rounded(tol)
Note: See TracChangeset
for help on using the changeset viewer.