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)
testcases: add gaussian_2D module c5e279c08bba39bdd82c79d15d00241c786c795d I am 2022-01-18 00:06:36
qt_gui.qt_testcases: simplify code for the unparametrized testcases 60b7678186738107b3346beae7fb0744570d60fc I am 2022-01-18 00:05:34
mplot.mart: move setup_labels to mart module 9d7783a3a9905a72c51b4fec76e367dffdbc4563 I am 2022-01-17 17:33:16
mplot.__init__: set up small non zero padding (0.01) f0d23235b109c4224599eb0426ad0d9ee8b2a9b8 I am 2022-01-17 17:31:44
mplot: raster candidates, polishing 63d6d00dfe7affc8ed3d05161fd4a5b50db62207 I am 2022-01-17 16:34:05
mplot: more figures 3a7f54e09cd78a2fc2ff50d7cf5c142f04ffdc28 I am 2022-01-09 00:42:33
testcases: add proxy_prod 2D testcase edb11ab54bcf677757974f133d2d66816b701ade I am 2022-01-09 00:41:27
stm_df: fix proxy, pandas nějak nám šťourá v našich boolean maticích 1d9f360edfc03932a08dff8aad97f189b155e708 I am 2022-01-09 00:39:24
mplot.maxes: a little bit more to labels d989a2d1b69b116a14f7ff81776f5f75d80cfea0 I am 2022-01-06 17:48:57
mplot.figs: add double and triple triangulations plots 091361cc326239b552078c489f9f164ccda4f54b I am 2022-01-06 16:17:50
mplot.maxes: aspoň nějak nastavit popísky os 50e8e467c24d73d9522166183275deab547243f8 I am 2022-01-06 16:16:36
mplot.maxes: add labels to candidates plot f8aa0f271a8d30cb7d79206290409f862c406a51 I am 2022-01-06 12:14:48
mplot.maxes: add candidates sampling (rejection-like) plot 5a15e10a9a462dd409e0627528bcb8910df77c7e I am 2022-01-06 09:40:38
mplot.maxes: add candidates plot 11e156edc351ca84fde742edf7ea1d85c3b0bc38 I am 2022-01-06 08:15:43
mplot.maxes: polish tri plots a little bit 9a4e0a18061e2d9f48c0c32c200bd1a408ceb77f I am 2022-01-05 13:15:00
mplot.mart: add plot_points() function 2c799e22d9f45b825a7f8a795ce6b9fe5fbd9c76 I am 2022-01-05 13:14:12
mplot.maxes: add convergence diagrams 813b1e8e9dd9d1e51951c51234910cdf2281cde8 I am 2022-01-05 09:07:18
mplot.mgraph: hračky s legendou 198cc40947d48b2a3cde990254def7d57c1535a6 I am 2022-01-05 09:04:23
mplot: apply default settings to figures 765d830e0230b3d85f079eb26c6eddfdb624b859 I am 2022-01-05 09:03:15
simplex: try garbage collection 45148d2665eea195c05de5852b15485d83cb7223 I am 2022-01-05 06:10:46
Commit c5e279c08bba39bdd82c79d15d00241c786c795d - testcases: add gaussian_2D module
Author: I am
Author date (UTC): 2022-01-18 00:06
Committer name: I am
Committer date (UTC): 2022-01-18 00:06
Parent(s): 60b7678186738107b3346beae7fb0744570d60fc
Signer:
Signing key:
Signing status: N
Tree: 75abaee57b7e60b04bc93202947ebb969894b9ae
File Lines added Lines deleted
testcases/gaussian_2D.py 217 0
File testcases/gaussian_2D.py added (mode: 100644) (index 0000000..248a233)
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 """
5 We will prepare here WhiteBox instances
6 of different Gaussian 2D problems
7 """
8
9 import numpy as np
10 from .. import g_models as gm
11 from .. import f_models
12 from ..whitebox import WhiteBox
13
14 __all__ = []
15
16 #č zde ten __all__ těžko dohlídáme
17 #č budeme přidávat do seznamu postupně
18 def add(str): __all__.append(str)
19
20 f = f_models.SNorm(2)
21
22
23 """ FourBranch2D
24 g1 = k1 + 0.1*(x1 - x2)**2 - (x1 + x2)/np.sqrt(2)
25 g2 = k1 + 0.1*(x1 - x2)**2 + (x1 + x2)/np.sqrt(2)
26 g3 = (x1 - x2) + k2/np.sqrt(2)
27 g4 = (x2 - x1) + k2/np.sqrt(2) #č byl tu překlep v jednom članku
28 g = np.min((g1, g2, g3, g4), axis=0)"""
29 #whitebox.WhiteBox(f, gm.FourBranch2D(k1=3, k2=7))
30 #
31 # Four branch system
32 add('four_branch')
33 def four_branch():
34 wt = WhiteBox(f, gm.FourBranch2D(k1=3, k2=7))
35 wt.pf_exact = 2.34e-03
36 wt.pf_exact_method = 'known value' #"some guys said me that"
37 wt.description = "Four branch system. Structural Safety 62 (2016) 66-75"
38 return wt
39
40
41 add('four_branch_2')
42 def four_branch_2():
43 wt = WhiteBox(f, gm.FourBranch2D(k1=5.5, k2=11))
44 # TODO calculate
45 #wt.pf_exact = 0.257
46 #wt.pf_exact_method = 'known value' #"some guys said me that" it's 0.256
47 wt.description = "Four branch system from another paper"
48 return wt
49
50
51
52
53
54 # Breitung
55 # Piecewise linear function
56 add('piecewise_linear')
57 def piecewise_linear():
58 wt = WhiteBox(f, gm.piecewise_2D_linear)
59 wt.description = "Breitung. Piecewise linear function"
60 return wt
61
62
63 """ Logistic2D
64 # sebemenší parametrizace
65 y1 = self._c1 - x1
66 y2 = self._c2 + x2
67 y3 = 1.0/(1+np.exp(-2.0*y2)) - 0.5
68
69 if self.easy_version:
70 g = np.minimum(y1,y2) # easy version for SuS
71 else:
72 g = np.minimum(y1,y3) # difficult version for SuS"""
73 #whitebox.WhiteBox(f, gm.Logistic2D(c1=5, c2=4, easy_version=True))
74 # Logistic 2D function
75 add('min_linear')
76 def min_linear():
77 wt = WhiteBox(f, gm.Logistic2D())
78 wt.description = "Breitung. 2D linear (easy version for SuS)"
79 return wt
80
81 add('min_logistic')
82 def min_logistic():
83 wt = WhiteBox(f, gm.Logistic2D(easy_version=False))
84 wt.description = "Breitung. Logistic 2D function (hard version for SuS)"
85 return wt
86
87
88
89 # soucin velicin plus nějaká konstanta
90 # g= X1 * X2 * X3 * X4 + c
91 add('prod_1')
92 add('prod_5')
93 def prod_1():
94 return WhiteBox(f, gm.Z_prod(const=1))
95 def prod_5():
96 return WhiteBox(f, gm.Z_prod(const=5))
97
98 gm_z_prod = gm.Z_prod(const=5)
99
100 def proxy_prod(input_sample):
101 # očekávam, že get_R_coordinates mně vrátí 2D pole
102 sample = gm.get_R_coordinates(input_sample, 2)
103 x, y = sample.T
104
105 # osudná podmínka
106 mask = np.atleast_1d(np.sign(x)==np.sign(y)).astype(bool)
107 #č mrdáme na kontrolu. současný startup candybox vytvoří vždycky
108 input_sample.candybox.proxy = mask
109 sweet_sample = input_sample
110 #sweet_sample = CandyBox(input_sample, proxy=mask)
111
112 # zatím, pro jednoduchost, předpokladáme,
113 # že dostaváme vzorky po jednom
114 if np.all(mask):
115 # nevíme vůbec, co to je za funkci
116 # ale veříme, že víme co tam bude
117 g = np.full(len(sweet_sample), 1)
118 # s praznejm podpísem odmítá
119 return samplebox.SampleBox(sweet_sample, g, 'proxy_prod')
120
121 else: # deme počítat, bez b
122 true_sample = gm_z_prod(sweet_sample)
123 # padelame pospís
124 true_sample.gm_signature = 'proxy_prod'
125 return true_sample
126
127 # wrap
128 proxy_prod.get_2D_R_boundary = gm_z_prod.get_2D_R_boundary
129
130 add('proxy_prod_5')
131 def proxy_prod_5():
132 return WhiteBox(f, proxy_prod)
133
134
135 """
136 c = 0.5 # wave amplitude in Gaussian space
137 d = 3.0 # average of sine fiunction in Gaussian space
138 k = 6 # number of sine waves (design points)
139 """
140 add('sinball')
141 def sinball():
142 return WhiteBox(f, gm.S_ballSin2D(c=0.5, d=3.0, k=6))
143
144
145 # Fajvka
146 # člověk se tu bez půllitry nevýzná
147 # viz. conic_section_boundaries_test.py pro inspiraciju
148 add('five')
149 def five():
150 return WhiteBox(f, gm.ConicSection(l=.1, e=1.1, teta=-np.pi/4, c=(-3,1), sign=1))
151
152
153
154
155 # Sin2D
156 # g = self._kx * x + self._ky * y + np.sin(self._kxsin*x) + self._const
157 #add('sin')
158 #def sin():
159 # return whitebox.WhiteBox(f, gm.Sin2D(kx=-1/4., ky=-1, kxsin=5, const=5))
160 add('sin_shields')
161 def sin_shields():
162 return WhiteBox(f, gm.Sin2D(kx=-1/4., ky=-1, kxsin=5, const=4))
163
164
165 # Prod_FourBetas
166 # g = beta^2/2 - |x1 * x2|
167 #č Breitung má
168 # g = 15 - |x1 * x2|
169 # beta^2/2 == 15
170 # beta == sqrt(30)
171 add('prod_four_betas')
172 def prod_four_betas():
173 return WhiteBox(f, gm.Prod_FourBetas(beta=np.sqrt(30)))
174
175
176
177 """ BlackSwan2D
178 a = 2.0 # boundary for x1
179 b = 5.0 # boundary for x2
180 y = np.where(sim[:,0] <= a, sim[:,0], sim[:,1])
181 # pro x1 <= a y = x1
182 # pro x1 > a y = x2
183 g = b - y # failure for b<y"""
184 #whitebox.WhiteBox(f, gm.BlackSwan2D(a=2.0, b=5.0))
185 add('black_swan')
186 def black_swan():
187 return WhiteBox(f, gm.BlackSwan2D(a=2.0, b=5.0))
188
189
190 """ Metaballs2D
191 # sebemenší parametrizace
192 y1 = 4/9*(x1 + 2 )**2 + 1/25 * (x2 )**2
193 y2 = 1/4*(x1 - 2.5)**2 + 1/25 * (x2-0.5)**2
194 g = 30.0/( y1**2 + 1.0 ) + 20.0/( y2**2 + 1.0 ) - self._const"""
195 #whitebox.WhiteBox(f, gm.Metaballs2D(const=5))
196 #ё проклял уж всех богов с этой "себеменьшей параметризацией", блин
197 #č u Breitung'a doopravdy vidím const=5
198 add('metaball')
199 def metaball():
200 return WhiteBox(f, gm.Metaballs2D(const=5))
201
202
203
204 """ CosExp2D
205 # sebemenší parametrizace
206 s = self._s
207 # g = cos((np.exp(-xm-s ))*xm) * np.exp(-(x +s )/3)
208 g = np.cos( ( np.exp(-sample[:,0] - s ) )*sample[:,0]) * np.exp( -(sample[:,0] + s )/3 ) """
209 #whitebox.WhiteBox(f, gm.CosExp2D(s=5))
210 add('cos_exp')
211 def cos_exp():
212 return WhiteBox(f, gm.CosExp2D(s=5))
213
214
215
216
217
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