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)
g_models.CosExp2D: add pf_expression() method 3ebf3098bcff1a73a649059b1539d622d58b7439 I am 2022-02-06 19:38:37
mplot.mfigs.double_diagram(): do not share x axis. User can set up limits itself after all e74145928c028479070af2fe766d55f180828cdf I am 2022-02-06 05:02:59
testcases: add reference solution bounds to the whitebox 3358b3ff7903417f6484a875abb154d3a7c04a06 I am 2022-02-06 05:00:50
mplot: we need more rasterization! 46df5af418dcab84e8e7e7e23724a74e86575806 I am 2022-02-05 02:20:22
testcases: provide more presice pf for vehicle suspension example e2c4bd1c7f2278b4d94b6f7515785528267c18bb I am 2022-02-05 02:18:45
g_models.PassiveSuspensionVehicle: reformulation and clean up 6e0f9ea7b97f12a2554d895be0b2b8a3f39a536d I am 2022-02-04 03:50:03
mplot: add beta diagram 5e346bdd2c5f06a41726e2ff264776dcc60eac19 I am 2022-02-01 04:08:34
mplot.maxes3d: rasterization of risges is absolutely needed 87c3235b8313ade07ca5b4d72b1f8fec339d621d I am 2022-01-31 03:15:31
testcases: add pf_exact for suspension example 9f903986699b97bfc0eb7c8d4bcad78d3e018450 I am 2022-01-30 23:14:42
mplot: polish 3d b78a192b0ce5c4f5f9e3a94e271bcde3f3c03fac I am 2022-01-30 23:14:16
qt_gui.gl_plot: oprašit gl_plotové prvky d4336e94b262d11db3b6a110527689a9ab101a60 Aleksei Gerasimov 2022-01-30 04:00:40
add vehicle suspension problem 1546923576c59fa15e97c082b4a9c39cdadcf690 I am 2022-01-30 10:39:08
mplot: add 3D triangulation plot addec9ba2a5a9cdfbbfea2eaf660847ea814d387 I am 2022-01-30 05:15:22
mplot: oprašit matplotlibové 3D b438c6e10bc36b6f70f54611df6c3988a7959275 I am 2022-01-30 04:28:27
qt_gui.gl_plot: dát dohromady ConvexHull třídu 19f7fc6ebf130d07897dca3496d78e3208ddfa29 Aleksei Gerasimov 2022-01-30 03:03:07
qt_gui.gl_plot: Make 3D working at least for basic box 1d285206abd77b68207fae0a771b3e69b197a5aa Aleksei Gerasimov 2022-01-30 01:15:54
qt_gui: prepare 3D view startup 21648380b72f891cd267ff57e2b9bbbb1dc1d13f I am 2022-01-30 00:24:06
mplot.maxes.convergence_legend(): úpravit jeden index 6345b5d4c70dde76102e105c1accc1ca9b3adb40 I am 2022-01-29 19:12:43
mplot.mgraph.tri_estimation_plot: adjust zorder of lines 6cf6cef6d6e19eb4cb5e8cda24f2bdc75652221d I am 2022-01-28 02:44:50
add Z_min g_model and general testcase 806fa2dfea2042cda04cff9020b891d3e033b9aa I am 2022-01-27 17:17:19
Commit 3ebf3098bcff1a73a649059b1539d622d58b7439 - g_models.CosExp2D: add pf_expression() method
Author: I am
Author date (UTC): 2022-02-06 19:38
Committer name: I am
Committer date (UTC): 2022-02-06 19:38
Parent(s): e74145928c028479070af2fe766d55f180828cdf
Signer:
Signing key:
Signing status: N
Tree: 864106779d18d243489e092b3b37bb83eee22b05
File Lines added Lines deleted
g_models.py 78 30
File g_models.py changed (mode: 100644) (index e8d9b92..3daee87)
... ... class CosExp2D:
846 846 g = np.cos( ( np.exp(-sample[:,0] - s ) )*sample[:,0]) * np.exp( -(sample[:,0] + s )/3 ) g = np.cos( ( np.exp(-sample[:,0] - s ) )*sample[:,0]) * np.exp( -(sample[:,0] + s )/3 )
847 847 return SampleBox(input_sample, g, repr(self)) return SampleBox(input_sample, g, repr(self))
848 848
849 def pf_expression(self, f):
850 xs, rad_max = self._get_x()
851 sign = np.sign(np.cos(rad_max))
852 #sign = (k_max + 1) // 2 - 1
853 xs.reverse()
854 print(xs)
855 cdfs = f.marginals[0].cdf(xs)
856 print(cdfs)
857 if sign > 0:
858 pf = 0
859 else:
860 pf = 1
861 for cdf in cdfs:
862 pf += cdf * sign
863 sign *= -1
864
865 #print(pf)
866 return pf, "series calculation"
867
868 def _get_x(self, n=10, steps=10):
869 ## log(np.pi/4) == -x - s + log(x)
870 ## log(rad) + s == -x + log(x)
871 ## x-log(x) = -log(rad) - s
872
873 #rad = exp(-x-s)*x
874 #log(rad/x) = -x -s
875 #x = -log(rad/x) - s
876
877 # d_rad/dx = -exp(-x-s)*x + exp(-x-s)
878 # d_rad/dx = exp(-x-s) * (1-x)
879
880 ## d2/dx2 = exp(-x-s) * (x-1) - exp(-x-s)
881 ## d2/dx2 = exp(-x-s) * (x-2)
882
883 rad_max = np.exp(-self._s - 1)
884 #print(rad_max)
885 k_max = np.floor(rad_max / np.pi - 1/2)
886 k = k_max
887 #x = f.marginals[0].ppf(1e-200)
888 rad = (k - n - 1 + 1/2) * np.pi
889 #x = rad / np.exp(-self._s)
890 x = -np.log(abs(rad)) - self._s
891 xs = []
892
893 for i in range(-n, 2):
894 #print(rad)
895 for __ in range(steps): # 10 out to be enough for everybody
896 x = x + (rad / np.exp(-x-self._s) - x) / (1-x)
897 #print(x)
898 xs.append(x)
899 rad = (k+i + 1/2) * np.pi
900 return xs, rad_max
901
849 902 # Fence off! # Fence off!
850 903 def get_2D_R_boundary(self, nrod=100, xlim=(-5,5), ylim=(-5,5)): def get_2D_R_boundary(self, nrod=100, xlim=(-5,5), ylim=(-5,5)):
851 904 """ """
 
... ... class CosExp2D:
853 906 nrod - number of rods in fencing nrod - number of rods in fencing
854 907 """ """
855 908
856 if self._s == 5:
857 # it is not mine
858 xa = -4.05229846333861
859 xb = -4.95067172463682
860 xc = -5.37859367619679
861 xd = -5.66345816541508
862 xe = -5.87765022259327
863 xf = -6.04950202015156
864 xg = -6.19309680892552
865
866 # ikska
867 xes = (xa, xb, xc, xd, xe, xf, xg)
868
869 boundaries = []
870 ymin, ymax = ylim
871
872 for x in xes:
873 xbound = np.full(nrod, x)
874 ybound = np.linspace(ymin, ymax, nrod, endpoint=True)
875 # sample compatible
876 # малы транспонировать кароно? Озьы кулэ!
877 bound_R = np.vstack((xbound, ybound)).T
878 boundaries.append(Ingot(bound_R))
879
880
881 return boundaries
909 # it is not mine
910 #xa = -4.05229846333861
911 #xb = -4.95067172463682
912 #xc = -5.37859367619679
913 #xd = -5.66345816541508
914 #xe = -5.87765022259327
915 #xf = -6.04950202015156
916 #xg = -6.19309680892552
917
918 # ikska
919 #xes = (xa, xb, xc, xd, xe, xf, xg)
920 xes, __rad_max = self._get_x()
921
922 boundaries = []
923 ymin, ymax = ylim
924
925 for x in xes:
926 xbound = np.full(nrod, x)
927 ybound = np.linspace(ymin, ymax, nrod, endpoint=True)
928 # sample compatible
929 # малы транспонировать кароно? Озьы кулэ!
930 bound_R = np.vstack((xbound, ybound)).T
931 boundaries.append(Ingot(bound_R))
882 932
933
934 return boundaries
883 935
884
885 else:
886 # jako kdyby .get_2D_R_boundary nebyla vůbec definována.
887 raise AttributeError("Hranice poruchy pro s!=5 není spočitana")
888 936
889 937
890 938
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