Skip to content

Commit eab4483

Browse files
authored
Merge pull request NHERI-SimCenter#100 from yisangriB/master
sy - updating documentation example
2 parents 3042428 + 732c517 commit eab4483

18 files changed

+177
-108
lines changed

EVENTS/EarthquakeEventSelection.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ EarthquakeEventSelection::EarthquakeEventSelection(RandomVariablesContainer *the
8080
//
8181

8282
QHBoxLayout *theSelectionLayout = new QHBoxLayout();
83-
// QLabel *label = new QLabel();
8483
SectionTitle *label=new SectionTitle();
8584
label->setMinimumWidth(250);
8685
label->setText(QString("Load Generator"));
@@ -94,17 +93,20 @@ EarthquakeEventSelection::EarthquakeEventSelection(RandomVariablesContainer *the
9493
eventSelection->addItem(tr("Multiple PEER"));
9594
eventSelection->addItem(tr("Multiple SimCenter"));
9695
eventSelection->addItem(tr("User Specified Database"));
97-
// eventSelection->addItem(tr("Hazard Based Event"));
96+
// eventSelection->addItem(tr("Hazard Based Event"));
9897
// eventSelection->addItem(tr("User Application"));
9998
eventSelection->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
10099
eventSelection->setItemData(1, "A Seismic event using Seismic Hazard Analysis and Record Selection/Scaling", Qt::ToolTipRole);
101100

101+
eventSelection->setMinimumWidth(250);
102+
eventSelection->setMaximumHeight(25);
103+
102104
theSelectionLayout->addWidget(label);
103-
QSpacerItem *spacer = new QSpacerItem(50,10);
104-
theSelectionLayout->addItem(spacer);
105+
//QSpacerItem *spacer = new QSpacerItem(50,1);
106+
//theSelectionLayout->addItem(spacer);
105107
theSelectionLayout->addWidget(eventSelection);
106108
theSelectionLayout->addStretch();
107-
layout->addLayout(theSelectionLayout,0,1,1,1);
109+
layout->addLayout(theSelectionLayout,0,1);
108110

109111
//
110112
// create the stacked widget
@@ -162,7 +164,7 @@ EarthquakeEventSelection::EarthquakeEventSelection(RandomVariablesContainer *the
162164

163165
//layout->addWidget(theStackedWidget);
164166
//layout->addWidget(sa);
165-
layout->setMargin(0);
167+
//layout->setMargin(0);
166168

167169
// add Intensity Widget
168170
//theSCIMWidget = new SimCenterIntensityMeasureWidget();
@@ -185,6 +187,11 @@ EarthquakeEventSelection::EarthquakeEventSelection(RandomVariablesContainer *the
185187

186188
connect(eventSelection, SIGNAL(currentIndexChanged(QString)), this, SLOT(eventSelectionChanged(QString)));
187189

190+
global_layout->setSpacing(0);
191+
layout->setSpacing(0);
192+
global_layout->setContentsMargins(0,0,0,0);
193+
layout->setContentsMargins(0,0,0,0);
194+
188195
}
189196

190197
EarthquakeEventSelection::~EarthquakeEventSelection()

Examples/eeuq-0010/README.rst

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Define Target Structure
5656
Select Ground Motions
5757
^^^^^^^^^^^^^^^^^^^^^^
5858

59-
4. In **EVT tab**, **PEER NGA ground motion records** is selected. Let us consider the site of interest located at (37.8715, -122.273), Hard Rock (A) site class. From ASCE 7-16, the design spectrum for risk category I (low hazard) can be obtained. Let us select 30 ground motion time histories that match this spectrum by clicking **Select records**button. The target response spectrum curve and the selected ground motions will be displayed in the right-hand side panel as shown below.
59+
4. In **EVT tab**, **PEER NGA ground motion records** option is selected. Let us consider the site of interest located at (37.8715, -122.273), of which we would like to select ground motions that follows USGS Uniform Hazard Spectrum (2014 v4.2.0) with return period 2475. Vs30 is assumed 760 m/s. Let us select 30 ground motion time histories that match this spectrum by clicking **Select records** button. The target response spectrum curve and the selected ground motions will be displayed on the right-hand side panel as shown below.
6060

6161
.. figure:: figures/EE10_EVT1.png
6262
:name: UQ inputs
@@ -175,23 +175,35 @@ Run the Analysis and Process Results
175175
* The term "90% prediction interval" is the interval in which the exact "response", i.e. dynamic simulation output, will fall with 90% probability.
176176
* The term "90% confidence interval" is the estimated range of the "mean response". Therefore, the confidence interval is always tighter than the prediction interval.
177177

178-
11. **[Verification]** Only for verification purposes, an additional forward propagation is performed using the exact simulation model instead of the surrogate model, using the exact same ground motion/structural parameters. For this, UQ, GI, EVT, RV tabs are kept unchanged, and SIM, FEM, EDP tabs are modified to replace the surrogate with the original model, i.e. for SIM, FEM, EDP tabs, the exact same configuration used in :ref:`example 09<eeuq-0009>` was used. Below is a comparison of the obtained median (and log-mean) and log-standard deviation of the EDPs from 30 samples:
178+
11. **[Verification]** Only for verification purposes, an additional forward propagation is performed using the exact simulation model instead of the surrogate model, using the exact same ground motion/structural parameters. For this, UQ, GI, EVT, RV tabs are kept unchanged, and SIM, FEM, EDP tabs are modified to replace the surrogate with the original model, i.e. for SIM, FEM, EDP tabs, the exact same configuration used in :ref:`example 09<eeuq-0009>` was used. Below is a comparison of the obtained mean log-EDPs from 30 samples:
179179

180180

181181
.. figure:: figures/EE10_RES4_1.png
182182
:name: UQ inputs
183183
:align: center
184-
:width: 900
184+
:width: 700
185185
:figclass: align-center
186186

187-
Comparison of median
187+
Comparing median of log-EDP
188+
189+
The same comparison in the original scale shown below.
188190

189191
.. figure:: figures/EE10_RES4_2.png
190192
:name: UQ inputs
191193
:align: center
192-
:width: 400
194+
:width: 700
193195
:figclass: align-center
194196

195197
Comparison of log-standard deviation
196198

199+
On the other hand, log-standard deviation of the EDPs from 30 samples are obtained as below.
200+
201+
.. figure:: figures/EE10_RES4_3.png
202+
:name: UQ inputs
203+
:align: center
204+
:width: 700
205+
:figclass: align-center
206+
207+
Comparing standard deviation of log-EDP
208+
197209
The estimated medians of EDPs from the surrogate and the original model show in general good agreement. The standard deviation of the surrogate model is larger partly because of the added uncertainty in surrogate model approximation. The difference in the statistics may also attribute to the small sample size of 30.
-12.3 KB
Loading
-30.4 KB
Loading
30.5 KB
Loading
-117 KB
Binary file not shown.
10.6 KB
Loading
-18 KB
Loading
-4.87 KB
Loading
-101 KB
Loading
11.6 KB
Loading
50.4 KB
Loading
199 KB
Loading
-54.2 KB
Binary file not shown.
-130 KB
Binary file not shown.
Lines changed: 87 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1+
figid = 200;
2+
13

24
names = {"1-PFA-0-1", "1-PFA-0-2", "1-PFA-1-1", "1-PFA-1-2", "1-PFD-1-1", "1-PFD-1-2", "1-PID-1-1", "1-PFA-2-1", "1-PFA-2-2", "1-PFD-2-1", "1-PFD-2-2", "1-PID-2-1", "1-PFA-3-1", "1-PFA-3-2", "1-PFD-3-1", "1-PFD-3-2", "1-PID-3-1", "1-PRD-1-1"}
35
idPSA = [1,2,3,4,8,9,13,14];
46
idPFD = [5,6,10,11,15,16];
7+
idPID = [7,12,17];
58

69

710
sur = readmatrix("sur.csv",'NumHeaderLines',1);
8-
sim = readmatrix("sim.csv",'NumHeaderLines',1);
9-
mediansur = (mean(log(sur(:,9:9+17))));
10-
mediansim = (mean(log(sim(:,4:4+17))));
11+
sim = readmatrix("sim2.csv",'NumHeaderLines',1);
12+
13+
sur_res =sur(:,9:9+17);
14+
sim_res =sim(:,4:4+17);
15+
1116

12-
figure(1)
13-
t = tiledlayout('flow');
17+
mediansur = (mean(log(sur_res)));
18+
mediansim = (mean(log(sim_res)));
19+
stdsur = (std(log(sur_res)));
20+
stdsim = (std(log(sim_res)));
21+
22+
figure(figid+1)
23+
% t = tiledlayout('flow');
1424

1525
% Team 1
16-
nexttile([2 5])
26+
% nexttile([2 5])
1727
bar([mediansim;mediansur]')
1828
ylabel("Mean of log EDP")
1929
grid on;
@@ -22,52 +32,92 @@
2232
xticks(1:length(names))
2333
xticklabels(names);
2434
legend('original','surrogate');
25-
title('Log-scale')
26-
set(gca,'fontsize',15)
27-
fontname("times new roman")
35+
title('Mean of log EDP')
36+
% title('Log-scale')
2837

29-
nexttile([2 3])
30-
bar(exp([mediansim(idPSA);mediansur(idPSA)]'))
31-
% ylabel("Median PSA")
32-
ylabel("median PSA")
33-
grid on;
34-
set(gcf,'color','w')
35-
set(gca,'XTickLabel',{names{idPSA}});
36-
% legend('original','surrogate')
37-
title("Original scale (PSA)")
38-
set(gca,'fontsize',15)
39-
fontname("times new roman")
40-
41-
nexttile([2 2])
42-
bar(exp([mediansim(idPFD);mediansur(idPFD)]'))
43-
% ylabel("Median PID")
44-
ylabel("median PID")
45-
grid on;
46-
set(gcf,'color','w')
47-
set(gca,'XTickLabel',{names{idPFD}});
48-
% legend('original','surrogate')
49-
ylabel("median PID")
50-
title("Original scale (PFD)")
51-
% ylim([0 6e-3])
5238
set(gca,'fontsize',15)
5339
fontname("times new roman")
40+
%
41+
% nexttile([2 3])
42+
% bar(exp([mediansim(idPSA);mediansur(idPSA)]'))
43+
% % ylabel("Median PSA")
44+
% ylabel("median PSA")
45+
% grid on;
46+
% set(gcf,'color','w')
47+
% set(gca,'XTickLabel',{names{idPSA}});
48+
% % legend('original','surrogate')
49+
% title("Original scale (PSA)")
50+
% set(gca,'fontsize',15)
51+
% fontname("times new roman")
52+
%
53+
% nexttile([2 2])
54+
% bar(exp([mediansim(idPFD);mediansur(idPFD)]'))
55+
% % ylabel("Median PID")
56+
% ylabel("median PID")
57+
% grid on;
58+
% set(gcf,'color','w')
59+
% set(gca,'XTickLabel',{names{idPFD}});
60+
% % legend('original','surrogate')
61+
% ylabel("median PID")
62+
% title("Original scale (PFD)")
63+
% % ylim([0 6e-3])
64+
% set(gca,'fontsize',15)
65+
% fontname("times new roman")
5466
%%
5567

56-
stdsim = (std(log(sim(:,4:4+7))));
57-
stdsur = (std(log(sur(:,9:9+7))));
5868
set(gca,'fontsize',15)
5969
fontname("times new roman")
6070

61-
figure(2);
71+
figure(figid+2);
6272
bar([stdsim;stdsur]')
6373
ylabel("std[logEDP]")
6474
grid on;
6575
set(gcf,'color','w')
66-
set(gca,'XTickLabel',{"1-PFA-0-1", "1-PFA-0-2", "1-PFA-1-1", "1-PFA-1-2", "1-PFD-1-1", "1-PFD-1-2", "1-PID-1-1", "1-PRD-1-1"});
76+
xticks(1:length(names))
77+
xticklabels(names);
6778
legend('original','surrogate')
6879
title('Std. of log EDP')
69-
ylim([0 1.5])
7080

7181
set(gca,'fontsize',15)
7282
fontname("times new roman")
7383

84+
%%
85+
86+
% figure(4)
87+
% bar(exp([mediansim(idPID);mediansur(idPID)]'))
88+
% % ylabel("Median PID")
89+
% ylabel("median PID")
90+
% grid on;
91+
% set(gcf,'color','w')
92+
% set(gca,'XTickLabel',{names{idPID}});
93+
% % legend('original','surrogate')
94+
% ylabel("median PID")
95+
% title("Original scale (PFD)")
96+
% % ylim([0 6e-3])
97+
% set(gca,'fontsize',15)
98+
% fontname("times new roman")
99+
100+
%
101+
%
102+
% b = bar([nonlinearPID, linearPID],'FaceColor','flat');
103+
% % ylabel("Median PID")
104+
% ylabel("median PID")
105+
% grid on;
106+
% set(gcf,'color','w')
107+
% set(gca,'XTickLabel',{names{idPID}});
108+
% % legend('original','surrogate')
109+
% ylabel("median PID")
110+
% title("Original scale (PFD)")
111+
% % ylim([0 6e-3])
112+
% set(gca,'fontsize',15)
113+
% fontname("times new roman")
114+
%
115+
%
116+
%
117+
% b(1).CData = [0.8 0 0.2];
118+
% b(2).CData = [0.6 0 0.2];
119+
% b(3).CData = [0 0.8 0.2];
120+
% b(4).CData = [0 0.6 0.2];
121+
% legend('linear-original','linear-surrogate','nonlinear-original','nonlinear-surrogate')
122+
%
123+

0 commit comments

Comments
 (0)