source: issm/trunk/src/m/utils/Qmu/lrel_mmf.m@ 4736

Last change on this file since 4736 was 4736, checked in by Eric.Larour, 15 years ago

new enum based naming

File size: 4.1 KB
Line 
1% set up a local reliability study, like might be done in Pig.par
2
3%% a variety of variables
4
5% seems to be a Matlab bug here (on Linux, not WinXP) -- unless
6% the class has been called, "empty" method can not be found
7normal_uncertain;
8continuous_design;
9continuous_state;
10linear_inequality_constraint;
11linear_equality_constraint;
12response_function;
13objective_function;
14least_squares_term;
15nonlinear_inequality_constraint;
16nonlinear_equality_constraint;
17
18md.variables=struct();
19md.variables.nuv=normal_uncertain.empty();
20%md.variables.nuv(end+1)=normal_uncertain('RhoIce',917,45.85);
21%md.variables.nuv(end+1)=normal_uncertain('RhoWater',1023,51.15);
22%md.variables.nuv(end+1)=normal_uncertain('HeatCapacity',2009,100.45);
23%md.variables.nuv(end+1)=normal_uncertain('ThermalConductivity',2.2,0.11);
24%md.variables.nuv(end+1)=normal_uncertain('Gravity',9.8,0.49);
25md.variables.nuv(end+1)=normal_uncertain('Thickness',1,0.05);
26%md.variables.nuv(end+1)=normal_uncertain('Drag',1,0.05);
27
28%% a variety of responses
29
30md.responses=struct();
31md.responses.rf =response_function.empty();
32md.responses.rf (end+1)=response_function('min_vx',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
33md.responses.rf (end+1)=response_function('max_vx',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
34md.responses.rf (end+1)=response_function('max_abs_vx',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
35md.responses.rf (end+1)=response_function('min_vy',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
36md.responses.rf (end+1)=response_function('max_vy',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
37md.responses.rf (end+1)=response_function('max_abs_vy',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
38md.responses.rf (end+1)=response_function('min_vel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
39md.responses.rf (end+1)=response_function('max_vel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
40md.responses.rf (end+1)=response_function('mass_flux1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
41md.responses.rf (end+1)=response_function('mass_flux_2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
42md.responses.rf (end+1)=response_function('mass_flux(3)',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
43md.responses.rf (end+1)=response_function('mass_flux4 (repeat)',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
44md.responses.rf (end+1)=response_function('mass_flux-5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
45md.responses.rf (end+1)=response_function('mass_flux^6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
46md.responses.rf (end+1)=response_function('mass_flux[7]',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
47
48%% create mass flux profile
49
50%plotmodel(md,'data','mesh')
51%expcreateprofile('mass_flux.exp')
52%expdisp('mass_flux.exp')
53%md.qmu_mass_flux_profile='mass_flux.exp';
54%md.qmu_mass_flux_profile={'mass_flux.exp','mass_flux2.exp','mass_flux3.exp'};
55md.qmu_mass_flux_profile={'mass_flux.exp','mass_flux2.exp','mass_flux3.exp','mass_flux.exp','mass_flux5.exp','mass_flux6.exp','mass_flux7.exp'};
56
57%% nond_local_reliability study
58
59md.qmu_method =dakota_method('nond_l');
60
61%% a variety of parameters
62
63%md.qmu_params.evaluation_concurrency=4;
64md.qmu_params.evaluation_concurrency=1;
65md.qmu_params.analysis_driver='';
66md.qmu_params.analysis_components='';
67md.qmu_params.interval_type='forward';
68md.qmu_params.fd_gradient_step_size=0.01;
69
70md.qmu_analysis=1;
71md.npart=10;
72if isempty(md.adjacency)
73 md=adjacency(md);
74end
75if isempty(md.part)
76% md.part=partitioner(md,'package','metis','npart',md.npart);
77 md.part=partitioner(md,'package','chaco','npart',md.npart,'weighting','on');
78% SpawnCore.m assumes partition vector starting at zero
79 md.part=md.part-1;
80end
81md.eps_rel=1.e-5;
82md.verbose=1;
83md.cluster='none';
84
85md.qmu
86
87%% sample analysis
88
89%md=solve(md,'analysis_type','diagnostic');
90
91%plotmodel(md,'data','mesh')
92%plotmodel(md,'data',md.part)
93%plotmodel(md,'data','mesh','partitionedges','on','linewidth',2)
94%part_hist(md.part,md.vwgt)
95%plotmodel(md,'data',log10(md.results.dakota.dresp_out(9).impfac(md.part+1)))
96
Note: See TracBrowser for help on using the repository browser.