iam-git / WellMet (public) (License: MIT) (since 2021-08-31) (hash sha1)
WellMet is pure Python framework for spatial structural reliability analysis. Or, more specifically, for "failure probability estimation and detection of failure surfaces by adaptive sequential decomposition of the design domain".
List of commits:
Subject Hash Author Date (UTC)
IS_stat: add IS_norm() method 6d1d11c4591143a26c92551ec3f722ea642711ae Alex 2021-01-07 05:33:21
misc: add comment 3d735585d49ac9d5f831b860cf95d3f41fd0d93e I am 2021-01-04 10:29:24
stm_df added (as is for now) 55402101bfabf4b9fe7d70fbd8f1469aea401bc7 Alex 2020-12-26 01:26:17
qt_plot.Isocurves: Isocurves-isolevels reworked 330b3387cfe46f75be6bf70f41c3f289303bdba2 I am 2020-12-23 02:36:39
qt_plot.Isocurves: infs issue fix 276a727723579be523e43b9748b7d36f6d151b0d I am 2020-12-18 00:14:14
qt_plot.Isocurves: extendEdge fix (there was an issue in P and U) 6a836879cc5d280862f4534dc824be86d34bfb4c I am 2020-12-17 23:49:44
qt_plot.Isocurves: bias fix 7c13581235e8e1bac726381b22db46057d1ac188 I am 2020-12-17 14:42:39
qt_plot: Isocurves nan check added + simplex error graph committed (as is) 3b2882661f7af4bb51e518bcd3a37dba6c67f7b2 I am 2020-12-17 03:55:44
f_models.Nataf: little clean up d2b0bba458847b7ef42cf68174311847d438bc84 I am 2020-12-17 03:19:35
qt_plot.Isocurves: dal jsem ty isočáry do pořádku b7ef4ed093c25f84e581000878d9f2d1b8d686c5 I am 2020-12-17 02:16:18
qt_plot: Isocurves added (with issues) b35517b3372f77a6efbeb1a10d6b0e994c7d0082 Alex 2020-12-16 10:13:07
f_models: .alpha init fix 5b5a518be135627bc70354be287f0a36c84cb088 Alex 2020-12-15 20:55:43
f_models.Nataf: prevent from nans in pdfs a4119069f7fdaf11b794f0623daff3dba8997b82 Alex 2020-12-15 08:03:00
f_model.Nataf: fixes 53912fc25e9d048f1ee32039dce32f0b011e470f Alex 2020-12-15 06:55:47
f_models.Nataf: fixes 1bc1d5128d60016be0f29e7c18a818c5a5a243af Alex 2020-12-15 03:56:15
f_models: Nataf model added 914dc13921a65c4bd197c106e57f430b8adca66d Alex 2020-12-15 03:20:47
Juniorstav related commit 31fc92d38d41b7256ba000114237421201af12b9 Aleksei Gerasimov 2020-11-27 21:57:44
gl_plot: allow grid in any space 4c66ae078ad1360198738d0c5ea034d56ee1f6d6 Aleksei Gerasimov 2020-11-14 13:50:09
qt_plot.SimpleSimplexEstimationGraph: zero pf_exact crashfix 7c1e8b475fea406e1bae16f7a5927fc4633bebda Aleksei Gerasimov 2020-11-14 13:35:36
qt_plot.SimpleSimplexEstimationGraph: show labels option added to contex menu d47279afa1e8557f565de75fc6d96fbad60f9e85 Aleksei Gerasimov 2020-11-14 11:49:30
Commit 6d1d11c4591143a26c92551ec3f722ea642711ae - IS_stat: add IS_norm() method
Author: Alex
Author date (UTC): 2021-01-07 05:33
Committer name: Alex
Committer date (UTC): 2021-01-07 05:33
Parent(s): 3d735585d49ac9d5f831b860cf95d3f41fd0d93e
Signer:
Signing key:
Signing status: N
Tree: a337ab858ffbd78e3ef0d1f74627a021430e13a4
File Lines added Lines deleted
IS_stat.py 44 47
File IS_stat.py changed (mode: 100644) (index dbc921a..25af2b8)
... ... def bisect(f, target, low, high):
29 29 return low return low
30 30
31 31
32 # нам позарез нужен ещё один, свой собственный словник
33 # ten, na rozdil od defaultdict'a, neuklada chybejicí složky do slovníku
32 #ё нам позарез нужен ещё один, свой собственный словник
33 #č ten, na rozdil od defaultdict'a, neuklada chybejicí složky do slovníku
34 34 class DefaultDict(dict): class DefaultDict(dict):
35 35 def __init__(self, default_value=None): def __init__(self, default_value=None):
36 36 self.default_value = default_value self.default_value = default_value
 
... ... class DefaultDict(dict):
39 39 return self.default_value return self.default_value
40 40
41 41
42 #
43 # deme na to, koťě!
44 #
42 #
43 #č deme na to, koťě!
44 #
45 45
46 # IS, (n-2)-krátá realizace, n>>2, n→∞
46 #č IS, (n-2)-krátá realizace, n>>2, n→∞
47 47 def IS(f, h_model, space_from_h='R', space_to_f='G', Nsim=int(1e4)): def IS(f, h_model, space_from_h='R', space_to_f='G', Nsim=int(1e4)):
48 48 """ """
49 49 space_from_h space_from_h
 
... ... def IS(f, h_model, space_from_h='R', space_to_f='G', Nsim=int(1e4)):
68 68 return CandyBox(to_sample, w=w) return CandyBox(to_sample, w=w)
69 69
70 70
71 def IS_norm(f, mean=0, std=1, sampling_space='G', nis=1000, design=None):
72 """
73 mean: [0.05, 2, 100500]
74 std: [0.05, 2, 100500]
75
76 design(nis, nvar) should return sampling plan in standard Gaussian space!
77 """
78
79 if design is None:
80 sampling_plan_G = np.random.randn(nis, f.nvar)
81 else:
82 sampling_plan_G = design(nis, f.nvar)
83
84
85 #č pdf spočteme na původním Gaussovském designu
86 # sample_pdf(sample / alpha) / np.prod(alpha)
87
88 ## desired: pdf = np.prod(stats.norm.pdf(sampling_plan_G) / std, axis=1)
89 pdf = stats.norm.pdf(sampling_plan_G)
90 pdf = np.divide(pdf, std, out=pdf)
91 pdf = np.prod(pdf, axis=1)
92
93
94 #č a teď pustíme se do výpočtu souřadnic
95 ## desired: sampling_plan_N = (sampling_plan_G * std) + mean
96 sampling_plan_N = sampling_plan_G; del(sampling_plan_G)
97 sampling_plan_N = np.multiply(sampling_plan_N, std, out=sampling_plan_N)
98 sampling_plan_N = np.add(sampling_plan_N, mean, out=sampling_plan_N)
99
100 # tady musíme provést jeden trik
101 # totež jako v IS_like - ve výsledku dycky dostaneme f_model
102 to_sample = f.new_sample(sampling_plan_N, sampling_space) #č naše N-ko smerdžíme ako G-čko
103 w = to_sample.pdf(sampling_space) / pdf # snad je to správně
104
105 # vahy máme
106 # zabalme do boxu
107 # zbytek už nejsou naši starosti
108 return CandyBox(to_sample, w=w)
71 109
72 110
73 111
 
... ... def IS_like(f_plan, sampling_space='G', weights=None, nis=1000, d=1):
117 155 return CandyBox(h_plan, w=w) return CandyBox(h_plan, w=w)
118 156
119 157
120
121
122
123
124
125
126
127 # for simplex: d = nvar+2
128 # for cell: d = base_r**2
129 #def sample_like(plan, weights=None, nis=1000, d=1):
130 # """
131 # takes coordinates and returns coordinates of the same cov sampling plan
132 # covariance matrix we'll divide by d
133 # """
134 #
135 #
136 # S_bc = np.cov(plan, rowvar=False, bias=True, aweights=weights)
137 # barycenter = np.average(plan, axis=0, weights=weights)
138 #
139 #
140 # # matika
141 # w, v = np.linalg.eig(S_bc)
142 #
143 # # use IS sampling density with center equal to the simplex's barycenter
144 # # set the minimum distance as the standard deviation of IS densisty
145 # # u stats.norm zadáváme směrodatnou odchylku, to je asi správné
146 # sigmas = np.sqrt(w/d)
147 # h_i = [stats.norm(0, sigma) for sigma in sigmas]
148 # # rozdělení ve vlastním prostoru
149 # # select nis = 100 points from IS density
150 # h_L = f_models.UnCorD(h_i)(nis)
151 #
152 # # здесь уже так легко не отделаемся. Трансформовать кароно.
153 # h_plan_bc = (v @ h_L.R.T).T
154 # h_plan_sing = h_plan_bc + barycenter
155 #
156 #
157 # return h_plan_sing
158
159
160
161 158
162 159
163 160
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/iam-git/WellMet

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/iam-git/WellMet

Clone this repository using git:
git clone git://git.rocketgit.com/user/iam-git/WellMet

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main