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.sample_alike: use any possible fallback options to sample 80fb6d086e9f17350a1725a319e40bf29591869e I am 2022-10-20 08:56:42
voronoi: WIP ba912d406de12142f2e15a73090118184a0166a4 I am 2022-10-20 02:43:12
IS_stat: add sample_alike() function 2e5394d264b7aaaf5f2486c736ed8cc37afbd030 I am 2022-10-19 13:00:17
voronoi: WIP c3bfa60b6db2042df11528fe95a51d7cc88d3c6b I am 2022-10-19 11:18:13
voronoi: WIP baff3c5ccaf857f60194917fe5d6e33c40b01265 I am 2022-10-19 09:28:33
voronoi.ConvexSpline: little fix of np.sign() for better sleep 968f649e54d97abd596cd60749872fa3ef788c06 I am 2022-10-19 06:28:46
implement even more optimized Convex.. now ConvexSpline class c08511aecb32b880e73c9f10d07feff4dc588e8b I am 2022-10-19 04:11:13
voronoi: WIP cbb61d4544367a67c9a5c3fe6d64a9dc284eb364 I am 2022-10-18 05:05:44
voronoi: WIP e9c247fef30cfb678bad9b955d6f6a94a0ff61e7 I am 2022-10-18 01:02:30
candynodex: hotfix to support numpy masking indexing f359123b72a3d998d5eed4b9e611a5e402a18c8d I am 2022-10-17 09:02:33
add new lightweight candynodes module to replace old heavy ugly candybox ca97509f47c100df90e1e06d82ed7c759627bfd0 I am 2022-10-17 06:31:33
qt_gui: move CandyBox creating to the individual DiceBox widgets 29253625129219b5e550f82cae3da0e53ef5bd47 I am 2022-10-16 03:17:55
voronoi: WIP 4855190869e06df740cc05c64e8b27b2c3c5a88d I am 2022-10-15 22:46:51
voronoi: WIP 0298b3a0563587ea4fc24fa99b51d2e01d517203 I am 2022-10-15 20:00:25
voronoi: WIP 4b80757fa26e3d40dceac888480ec3d814f6abc9 I am 2022-10-15 17:30:11
voronoi: WIP 7cadd1d01d7f4bc3f51e785fe6ebf8cae6ff839a I am 2022-10-15 03:12:54
voronoi: clean up and comment out ContactSolver 543f8482a925ff6cf8485b9be616b5bd3c714d13 I am 2022-10-14 04:24:40
qt_gui.qt_gui: use ConvexSolver instead of ContactSolver (which did not work correctly) c1e49a9b2c3cc13886d317b460d7598f661cf216 I am 2022-10-14 04:01:06
voronoi: add fantastic ConvexSolver 2853826e5ef1abc79d3ac2fb8289b13c45211a31 I am 2022-10-14 04:00:14
qt_gui.qt_plot: add (finally!) Numbers class 4cdc658c0fcc857c23c0e39e91e7a1ce5e1b30a1 I am 2022-10-13 06:23:46
Commit 80fb6d086e9f17350a1725a319e40bf29591869e - IS_stat.sample_alike: use any possible fallback options to sample
Author: I am
Author date (UTC): 2022-10-20 08:56
Committer name: I am
Committer date (UTC): 2022-10-20 08:56
Parent(s): ba912d406de12142f2e15a73090118184a0166a4
Signer:
Signing key:
Signing status: N
Tree: bd5c1159f0eb58412e6ab389405b17d4d94249f7
File Lines added Lines deleted
wellmet/IS_stat.py 29 11
File wellmet/IS_stat.py changed (mode: 100644) (index 789008d..5e55e0e)
... ... def IS_like(f_plan, sampling_space='G', weights=None, nis=1000, d=1, design=None
366 366
367 367
368 368
369
370 369 # for simplex: d = nvar+2 # for simplex: d = nvar+2
371 370 # for cell: it's not so easy # for cell: it's not so easy
372 371 def sample_alike(plan, weights=None, nis=1000, d=1, design=None): def sample_alike(plan, weights=None, nis=1000, d=1, design=None):
373 372 """ """
374 373 takes sample and returns sampling plan with the same cov (in case d=1) takes sample and returns sampling plan with the same cov (in case d=1)
375 374 covariance matrix we'll divide by d covariance matrix we'll divide by d
376 """
377 375
376 Returns: sampling_plan, h_pdfs
377 """
378 378 nsim, ndim = plan.shape nsim, ndim = plan.shape
379 379
380 #ё зрада отменяется!
381 #č Tahle funkce se pokusí aspoň něco nejak navzorkovat,
382 #č ale musí být aspoň-alespoň dva vzorky.
383 #č nechvám zodpovědnost za to na volajícím kódě!
384 assert nsim > 1
385
386 S_bc = np.cov(plan, rowvar=False, bias=True, aweights=weights)
387 barycenter = np.average(plan, axis=0, weights=weights)
388
389
390
380 391 if nsim < ndim + 1: if nsim < ndim + 1:
381 return False, None, None
392 S2 = np.diag(S_bc)
393 if not np.all(S2 > 0):
394 std = np.sqrt(np.sum(S2) / ndim / d)
395 else:
396 std = np.sqrt(S2 / d)
397 return get_norm_plan(nis, ndim, mean=barycenter, \
398 std=std, design=design)
382 399
383 S_bc = np.cov(plan, rowvar=False, bias=True, aweights=weights)
400
384 401 #č matika #č matika
385 402 w, v = np.linalg.eig(S_bc) w, v = np.linalg.eig(S_bc)
386 403
387 404 if not np.all(w > 0): if not np.all(w > 0):
388 return False, None, None
389
390 barycenter = np.average(plan, axis=0, weights=weights)
391
405 S2 = np.diag(S_bc)
406 if not np.all(S2 > 0):
407 std = np.sqrt(np.sum(w) / ndim / d)
408 else:
409 std = np.sqrt(S2 / d)
410 return get_norm_plan(nis, ndim, mean=barycenter, \
411 std=std, design=design)
392 412
393 413 # use IS sampling density with center equal to the simplex's barycenter # use IS sampling density with center equal to the simplex's barycenter
394 414 # set the minimum distance as the standard deviation of IS densisty # set the minimum distance as the standard deviation of IS densisty
 
... ... def sample_alike(plan, weights=None, nis=1000, d=1, design=None):
401 421 h_plan_bc = (v @ h_plan_N.T).T h_plan_bc = (v @ h_plan_N.T).T
402 422 h_plan_sing = h_plan_bc + barycenter h_plan_sing = h_plan_bc + barycenter
403 423
404 return True, h_plan_sing, pdf_N
405
406
424 return h_plan_sing, pdf_N
407 425
408 426
409 427
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