File g_models.py changed (mode: 100644) (index b3bd1d0..a0b9c09) |
... |
... |
class FourBranch2D: |
954 |
954 |
return (Ingot(bound_R),) |
return (Ingot(bound_R),) |
955 |
955 |
|
|
956 |
956 |
|
|
|
957 |
|
|
|
958 |
|
class PassiveVehicleSuspension: |
|
959 |
|
""" |
|
960 |
|
""" |
|
961 |
|
def __init__(self, V=10, A=1.0, b_0=0.27, m=0.8158, M=3.2633, g=981): |
|
962 |
|
#self.constants = [V, A, b_0, m, M, g] |
|
963 |
|
self.constants = [V, A/2/np.pi, b_0, m, M, g] |
|
964 |
|
|
|
965 |
|
# sign |
|
966 |
|
def __repr__(self): |
|
967 |
|
return 'PassiveVehicleSuspension(*%s)' % (self.constants) |
|
968 |
|
|
|
969 |
|
def __call__(self, input_sample): |
|
970 |
|
V, A, b_0, m, M, g = self.constants |
|
971 |
|
# očekávam, že get_R_coordinates mně vrátí 2D pole |
|
972 |
|
sample = get_R_coordinates(input_sample, 3) |
|
973 |
|
c, c_k, k = sample[:,0], sample[:,1], sample[:,2] |
|
974 |
|
K1 = (np.pi * m * V * A) / (b_0 * k * g**2) |
|
975 |
|
C1 = c_k / (m + M) |
|
976 |
|
C2 = c / M |
|
977 |
|
C3 = c**2 / (m * M) |
|
978 |
|
C4 = c_k * k**2 /(m * M**2) |
|
979 |
|
G1 = 1 - K1 * ((C1-C2)**2 + C3 + C4) |
|
980 |
|
G2 = 1 - 7.6394 / (4000 * (M*g)**(-1.5) * c - 1) |
|
981 |
|
G3 = 1 - 0.5 / np.sqrt(M * g) / np.sqrt(k**2 * c_k / c / (M + m) + c) |
|
982 |
|
G4 = 1 - (g * (M + m))**0.877 / c_k |
|
983 |
|
print(G1, G2, G3, G4) |
|
984 |
|
return SampleBox(input_sample, np.min((G1, G2, G3, G4), axis=0), repr(self)) |
|
985 |
|
|
|
986 |
|
|
|
987 |
|
|
957 |
988 |
# |
# |
958 |
989 |
# Free functions |
# Free functions |
959 |
990 |
# |
# |
File testcases/testcases_2D_papers.py changed (mode: 100644) (index eeb3598..92d1e57) |
... |
... |
import scipy.stats as stats |
14 |
14 |
from scipy import integrate # for Pareto tail |
from scipy import integrate # for Pareto tail |
15 |
15 |
|
|
16 |
16 |
__all__ = [ |
__all__ = [ |
17 |
|
'uniform_branin_2D', |
|
18 |
|
'snorm_four_branch_2D', |
|
19 |
|
'snorm_four_branch_2D_2', |
|
20 |
|
'snorm_piecewise_2D_linear', |
|
21 |
|
'piecewise_pareto_tail', |
|
22 |
|
'snorm_min_2D_linear', |
|
23 |
|
'snorm_min_2D_logistic', |
|
24 |
|
] |
|
|
17 |
|
'uniform_branin_2D', |
|
18 |
|
'snorm_four_branch_2D', |
|
19 |
|
'snorm_four_branch_2D_2', |
|
20 |
|
'snorm_piecewise_2D_linear', |
|
21 |
|
'piecewise_pareto_tail', |
|
22 |
|
'snorm_min_2D_linear', |
|
23 |
|
'snorm_min_2D_logistic', |
|
24 |
|
'passive_vehicle_suspension_3D', |
|
25 |
|
] |
25 |
26 |
|
|
26 |
27 |
f = f_models.SNorm(2) |
f = f_models.SNorm(2) |
27 |
28 |
# Uniform-uniform |
# Uniform-uniform |
|
... |
... |
def snorm_min_2D_logistic(): |
119 |
120 |
return wt |
return wt |
120 |
121 |
|
|
121 |
122 |
|
|
|
123 |
|
def passive_vehicle_suspension_3D(): |
|
124 |
|
f3 = f_models.UnCorD(( |
|
125 |
|
stats.norm(431.7221, 10), |
|
126 |
|
stats.norm(1475.5503, 10), |
|
127 |
|
stats.norm(55.0406, 10), |
|
128 |
|
)) |
|
129 |
|
# f3 = f_models.UnCorD(( |
|
130 |
|
# stats.norm(424, 10), |
|
131 |
|
# stats.norm(1480, 10), |
|
132 |
|
# stats.norm(47, 10), |
|
133 |
|
# )) |
|
134 |
|
wt = WhiteBox(f3, gm.PassiveVehicleSuspension()) |
|
135 |
|
#wt.pf_exact = 1.87e-06 |
|
136 |
|
#wt.pf_exact_method = 'FORM-type thought-three beta points' |
|
137 |
|
#wt.description = "Breitung. Pareto tail" |
|
138 |
|
return wt |
122 |
139 |
|
|
123 |
140 |
|
|