Пример #1
0
def test_sample():
	mean = 0
	cov = 10
	scaling = 1
	offset = 0.
	truncate = 1e-2

	dom = LogNormalDomain(mean, cov, offset, scaling, truncate)

	X = dom.sample(100)
	print(dom.isinside(X))
	assert np.all(dom.isinside(X))
Пример #2
0
def build_borehole_uncertain_domain():
    r""" Constructs an uncertain domain associated with the borehole function

	Returns
	-------
	dom: TensorProductDomain
		Uncertain domain associated with the borehole function
	"""
    return TensorProductDomain([
        NormalDomain(0.10, 0.0161812**2, names='r_w'),
        LogNormalDomain(7.71, 1.0056**2, names='r'),
        UniformDomain(63070, 115600, names='T_u'),
        UniformDomain(990, 1110, names='H_u'),
        UniformDomain(63.1, 116, names='T_l'),
        UniformDomain(700, 820, names='H_l'),
        UniformDomain(1120, 1680, names='L'),
        UniformDomain(9855, 12045, names='K_w')
    ])
Пример #3
0
def test_normalize():
	mean = 0
	cov = 10
	scaling = 1
	offset = 0.
	truncate = 1e-2

	dom = LogNormalDomain(mean, cov, offset, scaling, truncate)
	dom_norm = dom.normalized_domain()
	print(dom_norm.lb)
	print(dom_norm.ub)
	assert np.isclose(dom_norm.lb, -1)
	assert np.isclose(dom_norm.ub, 1)

	# TODO: Check densities
	X = dom.sample(100)
	X_norm = dom.normalize(X)
	p = dom.pdf(X)
	p_norm = dom_norm.pdf(X_norm)
	assert np.all(np.isclose(p, p_norm))
Пример #4
0
def buildRandomDomain(output='verbose', truncate=None):
    '''
	The standard random domain with 40 random variables.
	'''

    random_domains = [
        #			CMC_DENSITY, 1,
        LogNormalDomain(7.7803, 0.0182**2, truncate=truncate),
        #			CMC_ELASTIC_MODULUS, 1,
        LogNormalDomain(
            4.2047,
            0.0551**2,
            scaling=1e9,
            truncate=truncate,
        ),
        #			CMC_POISSON_RATIO, 1,
        UniformDomain(0.23, 0.43),
        #			 CMC_THERMAL_CONDUCTIVITY, 1,
        UniformDomain(1.37, 1.45),
        #			CMC_THERMAL_EXPANSION_COEF, 1,
        UniformDomain(0.228e-6, 0.252e-6),
        #			CMC_PRINCIPLE_FAILURE_STRAIN, 1,
        LogNormalDomain(
            -2.6694,
            0.1421**2,
            scaling=1e-2,
            truncate=truncate,
        ),
        #			CMC_MAX_SERVICE_TEMPERATURE, 1,
        UniformDomain(963, 983),
        #
        #
        #			GR-BMI_DENSITY, 1,
        UniformDomain(1563, 1573),
        #			GR-BMI_ELASTIC_MODULUS, 2,
        UniformDomain(57e9, 63e9),
        UniformDomain(57e9, 63e9),
        #			GR-BMI_SHEAR_MODULUS, 1,
        UniformDomain(22.6e9, 24.0e9),
        #			GR-BMI_POISSON_RATIO, 1,
        UniformDomain(0.334, 0.354),
        #			GR-BMI_MUTUAL_INFLUENCE_COEFS, 2,
        UniformDomain(-0.1, 0.1),
        UniformDomain(-0.1, 0.1),
        #			GR-BMI_THERMAL_CONDUCTIVITY, 3,
        UniformDomain(3.208, 3.546),
        UniformDomain(3.208, 3.546),
        UniformDomain(3.243, 3.585),
        #			GR-BMI_THERMAL_EXPANSION_COEF, 3,
        UniformDomain(1.16e-6, 1.24e-6),
        UniformDomain(1.16e-6, 1.24e-6),
        UniformDomain(-0.04e-6, 0.04e-6),
        #			GR-BMI_LOCAL_FAILURE_STRAIN, 5,
        UniformDomain(0.675e-2, 0.825e-2),  #, center = 0.75e-2),
        UniformDomain(-0.572e-2, -0.494e-2),  #, center = -0.52e-2),
        UniformDomain(0.675e-2, 0.825e-2),  #, center = 0.75e-2),
        UniformDomain(-0.572e-2, -0.494e-2),  #, center = -0.52e-2),
        UniformDomain(0.153e-2, 0.187e-2),  #, center = 0.17e-2),
        #			GR-BMI_MAX_SERVICE_TEMPERATURE, 1,
        UniformDomain(500, 510),
        #
        #
        #			TI-HC_DENSITY, 1,
        UniformDomain(177.77, 181.37),
        #			TI-HC_ELASTIC_MODULUS, 1,
        LogNormalDomain(
            0.6441,
            0.0779**2,
            scaling=1e9,
            truncate=truncate,
        ),
        #			TI-HC_POISSON_RATIO, 1,
        UniformDomain(0.160, 0.196),
        #			TI-HC_THERMAL_CONDUCTIVITY, 1,
        UniformDomain(0.680, 0.736),
        #			TI-HC_THERMAL_EXPANSION_COEF, 1,
        UniformDomain(2.88e-6, 3.06e-6),
        #			TI-HC_YIELD_STRESS, 1,
        LogNormalDomain(
            2.5500,
            0.1205**2,
            scaling=1e6,
            truncate=truncate,
        ),
        #			TI-HC_MAX_SERVICE_TEMPERATURE, 1,
        UniformDomain(745, 765),
        #
        #
        #			AIR_THERMAL_CONDUCTIVITY, 1,
        UniformDomain(0.0320, 0.0530),
        #			PANEL_YIELD_STRESS, 1,
        LogNormalDomain(
            4.3191,
            0.1196**2,
            scaling=1e6,
            truncate=truncate,
        ),
        #			INLET_PSTAG, 1,
        LogNormalDomain(
            11.5010,
            0.0579**2,
            truncate=truncate,
        ),
        #			INLET_TSTAG, 1,
        LogNormalDomain(
            6.8615,
            0.0119**2,
            truncate=truncate,
        ),
        #			ATM_PRES, 1,
        LogNormalDomain(
            9.8386,
            0.0323**2,
            truncate=truncate,
        ),
        #			ATM_TEMP, 1,
        LogNormalDomain(
            5.3781,
            0.0282**2,
            truncate=truncate,
        ),
        #			HEAT_XFER_COEF_TO_ENV, 1
        LogNormalDomain(
            2.5090,
            0.2285,
            truncate=truncate,
        ),
    ]

    return TensorProductDomain(random_domains)
Пример #5
0
def buildRandomDomain(output='verbose', truncate=None):
    '''
	The standard random domain with 40 random variables.
	'''

    random_domains = [
        #			CMC_DENSITY, 1,
        LogNormalDomain(7.7803,
                        0.0182**2,
                        truncate=truncate,
                        names=['CMC density (kg/m^3)']),
        #			CMC_ELASTIC_MODULUS, 1,
        LogNormalDomain(4.2047,
                        0.0551**2,
                        scaling=1e9,
                        truncate=truncate,
                        names=['CMC elastic modulus (Pa)']),
        #			CMC_POISSON_RATIO, 1,
        UniformDomain(0.23, 0.43, names=['CMC Poisson ratio']),
        #			 CMC_THERMAL_CONDUCTIVITY, 1,
        UniformDomain(1.37, 1.45, names=['CMC thermal conductivity (W/m-K)']),
        #			CMC_THERMAL_EXPANSION_COEF, 1,
        UniformDomain(0.228e-6,
                      0.252e-6,
                      names=['CMC thermal expansion coef. (1/K)']),
        #			CMC_PRINCIPLE_FAILURE_STRAIN, 1,
        LogNormalDomain(-2.6694,
                        0.1421**2,
                        scaling=1e-2,
                        truncate=truncate,
                        names=['CMC principle failure strain']),
        #			CMC_MAX_SERVICE_TEMPERATURE, 1,
        UniformDomain(963, 983, names=['CMC max service temperature (K)']),
        #
        #
        #			GR-BMI_DENSITY, 1,
        UniformDomain(1563, 1573, names=['GR-BMI density (kg/m^3)']),
        #			GR-BMI_ELASTIC_MODULUS, 2,
        UniformDomain(57e9, 63e9, names=['GR-BMI elastic modulus 1 (Pa)']),
        UniformDomain(57e9, 63e9, names=['GR-BMI elastic modulus 2 (Pa)']),
        #			GR-BMI_SHEAR_MODULUS, 1,
        UniformDomain(22.6e9, 24.0e9, names=['GR-BMI shear modulus (Pa)']),
        #			GR-BMI_POISSON_RATIO, 1,
        UniformDomain(0.334, 0.354, names=['GR-BMI Poisson ratio']),
        #			GR-BMI_MUTUAL_INFLUENCE_COEFS, 2,
        UniformDomain(-0.1, 0.1, names=['GR-BMI mutual influence coef 1']),
        UniformDomain(-0.1, 0.1, names=['GR-BMI mutual influence coef 2']),
        #			GR-BMI_THERMAL_CONDUCTIVITY, 3,
        UniformDomain(3.208,
                      3.546,
                      names=['GR-BMI thermal conductivity 1 (W/m-K)']),
        UniformDomain(3.208,
                      3.546,
                      names=['GR-BMI thermal conductivity 2 (W/m-K)']),
        UniformDomain(3.243,
                      3.585,
                      names=['GR-BMI thermal conductivity 3 (W/m-K)']),
        #			GR-BMI_THERMAL_EXPANSION_COEF, 3,
        UniformDomain(1.16e-6,
                      1.24e-6,
                      names=['GR-BMI thermal expansion coef. 1 (1/K)']),
        UniformDomain(1.16e-6,
                      1.24e-6,
                      names=['GR-BMI thermal expansion coef. 2 (1/K)']),
        UniformDomain(-0.04e-6,
                      0.04e-6,
                      names=['GR-BMI thermal expansion coef. 3 (1/K)']),
        #			GR-BMI_LOCAL_FAILURE_STRAIN, 5,
        UniformDomain(0.675e-2,
                      0.825e-2,
                      names=['GR-BMI local failure strain 1'
                             ]),  #, center = 0.75e-2),
        UniformDomain(-0.572e-2,
                      -0.494e-2,
                      names=['GR-BMI local failure strain 2'
                             ]),  #, center = -0.52e-2),
        UniformDomain(0.675e-2,
                      0.825e-2,
                      names=['GR-BMI local failure strain 3'
                             ]),  #, center = 0.75e-2),
        UniformDomain(-0.572e-2,
                      -0.494e-2,
                      names=['GR-BMI local failure strain 4'
                             ]),  #, center = -0.52e-2),
        UniformDomain(0.153e-2,
                      0.187e-2,
                      names=['GR-BMI local failure strain 5'
                             ]),  #, center = 0.17e-2),
        #			GR-BMI_MAX_SERVICE_TEMPERATURE, 1,
        UniformDomain(500, 510, names=['GR-BMI max service temperature (K)']),
        #
        #
        #			TI-HC_DENSITY, 1,
        UniformDomain(177.77, 181.37, names=['Ti-HC density (kg/m^3)']),
        #			TI-HC_ELASTIC_MODULUS, 1,
        LogNormalDomain(0.6441,
                        0.0779**2,
                        scaling=1e9,
                        truncate=truncate,
                        names=['Ti-HC elastic modulus (Pa)']),
        #			TI-HC_POISSON_RATIO, 1,
        UniformDomain(0.160, 0.196, names=['Ti-HC Poisson ratio']),
        #			TI-HC_THERMAL_CONDUCTIVITY, 1,
        UniformDomain(0.680,
                      0.736,
                      names=['Ti-HC thermal conductivity (W/m-K)']),
        #			TI-HC_THERMAL_EXPANSION_COEF, 1,
        UniformDomain(2.88e-6,
                      3.06e-6,
                      names=['Ti-HC thermal expansion coef. (1/K)']),
        #			TI-HC_YIELD_STRESS, 1,
        LogNormalDomain(2.5500,
                        0.1205**2,
                        scaling=1e6,
                        truncate=truncate,
                        names=['Ti-HC yield stress (Pa)']),
        #			TI-HC_MAX_SERVICE_TEMPERATURE, 1,
        UniformDomain(745, 765, names=['Ti-HC max service temperature (K)']),
        #
        #
        #			AIR_THERMAL_CONDUCTIVITY, 1,
        UniformDomain(0.0320,
                      0.0530,
                      names=['Air thermal conductivity (W/m-K)']),
        #			PANEL_YIELD_STRESS, 1,
        LogNormalDomain(4.3191,
                        0.1196**2,
                        scaling=1e6,
                        truncate=truncate,
                        names=['Panel yield stress (Pa)']),
        #			INLET_PSTAG, 1,
        LogNormalDomain(11.5010,
                        0.0579**2,
                        truncate=truncate,
                        names=['Inlet stagnation pressure (Pa)']),
        #			INLET_TSTAG, 1,
        LogNormalDomain(6.8615,
                        0.0119**2,
                        truncate=truncate,
                        names=['Inlet stagnation temperature (K)']),
        #			ATM_PRES, 1,
        LogNormalDomain(9.8386,
                        0.0323**2,
                        truncate=truncate,
                        names=['Atmospheric pressure (Pa)']),
        #			ATM_TEMP, 1,
        LogNormalDomain(5.3781,
                        0.0282**2,
                        truncate=truncate,
                        names=['Atmospheric temperature (K)']),
        #			HEAT_XFER_COEF_TO_ENV, 1
        LogNormalDomain(2.5090,
                        0.2285,
                        truncate=truncate,
                        names=['Heat transfer coef. to environment (W/m^2-K)'
                               ]),
    ]

    return TensorProductDomain(random_domains)