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
|
---|
7 | normal_uncertain;
|
---|
8 | continuous_design;
|
---|
9 | continuous_state;
|
---|
10 | linear_inequality_constraint;
|
---|
11 | linear_equality_constraint;
|
---|
12 | response_function;
|
---|
13 | objective_function;
|
---|
14 | least_squares_term;
|
---|
15 | nonlinear_inequality_constraint;
|
---|
16 | nonlinear_equality_constraint;
|
---|
17 |
|
---|
18 | md.variables=struct();
|
---|
19 | md.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);
|
---|
25 | md.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 |
|
---|
30 | md.responses=struct();
|
---|
31 | md.responses.rf =response_function.empty();
|
---|
32 | md.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]);
|
---|
33 | md.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]);
|
---|
34 | md.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]);
|
---|
35 | md.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]);
|
---|
36 | md.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]);
|
---|
37 | md.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]);
|
---|
38 | md.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]);
|
---|
39 | md.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]);
|
---|
40 | md.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]);
|
---|
41 | md.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]);
|
---|
42 | md.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]);
|
---|
43 | md.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]);
|
---|
44 | md.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]);
|
---|
45 | md.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]);
|
---|
46 | md.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'};
|
---|
55 | md.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 |
|
---|
59 | md.qmu_method =dakota_method('nond_l');
|
---|
60 |
|
---|
61 | %% a variety of parameters
|
---|
62 |
|
---|
63 | %md.qmu_params.evaluation_concurrency=4;
|
---|
64 | md.qmu_params.evaluation_concurrency=1;
|
---|
65 | md.qmu_params.analysis_driver='';
|
---|
66 | md.qmu_params.analysis_components='';
|
---|
67 | md.qmu_params.interval_type='forward';
|
---|
68 | md.qmu_params.fd_gradient_step_size=0.01;
|
---|
69 |
|
---|
70 | md.qmu_analysis=1;
|
---|
71 | md.npart=10;
|
---|
72 | if isempty(md.adjacency)
|
---|
73 | md=adjacency(md);
|
---|
74 | end
|
---|
75 | if 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;
|
---|
80 | end
|
---|
81 | md.eps_rel=1.e-5;
|
---|
82 | md.verbose=1;
|
---|
83 | md.cluster='none';
|
---|
84 |
|
---|
85 | md.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 |
|
---|