Changeset 4537 for anuga_work
- Timestamp:
- Jun 7, 2007, 8:56:23 AM (17 years ago)
- Location:
- anuga_work/development/alpha_validation
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/alpha_validation/find_alpha.py
r4457 r4537 7 7 from anuga.shallow_water import Reflective_boundary 8 8 from anuga.utilities.numerical_tools import cov 9 from Numeric import array, resize,shape,Float,zeros 9 from Numeric import array, resize,shape,Float,zeros,take,argsort 10 from pylab import plot, ion, hold,savefig,semilogx,plotting 10 11 11 12 … … 17 18 boundary_tags={'back': [2], 'side': [1,3], 18 19 'ocean': [0]}, 19 maximum_triangle_area=100 000,20 maximum_triangle_area=100, 20 21 filename=mesh_dir_name, 21 22 use_cache=True, … … 29 30 G = Geospatial_data(file_name = topo_dir_name) 30 31 print 'start split' 31 G_small, G_other = G.split(0.1,True) 32 33 G_sample,G_loss= G.split(0.1, True) 34 35 G_small, G_other = G_sample.split(0.1,True) 32 36 33 37 34 38 35 #alphas = [0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0,1000.0,10000.0]36 alphas = [0.001,1,100]39 alphas = [0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0,1000.0,10000.0] 40 #alphas = [0.001,1,100] 37 41 domains = {} 38 42 #domains = [] … … 66 70 normal_cov=array(zeros([len(alphas),2]),typecode=Float) 67 71 i=0 68 #print 'domains',domains.keys() 69 #keys_list=domains.keys() 70 #print 'domains',keys_list.sort() 72 71 73 for domain in domains: 72 74 # print'domain',domain … … 82 84 sample_cov= cov(elevation_sample) 83 85 84 ele_cov= cov(elevation_sample ,elevation_predicted)86 ele_cov= cov(elevation_sample-elevation_predicted) 85 87 normal_cov[i,:]= [domain,ele_cov/sample_cov] 86 88 … … 91 93 print'data',data[100:200] 92 94 print'normal cov',normal_cov 95 normal_cov0=normal_cov[:,0] 96 normal_cov_new=take(normal_cov,argsort(normal_cov0)) 97 semilogx(normal_cov_new[:,0],normal_cov_new[:,1]) 98 savefig("alphas",dpi=300) 93 99 94 95 # from file load x,y,z data96 # use file xy data to find predicted z data from domain97 # determine error and repeat
Note: See TracChangeset
for help on using the changeset viewer.