def test_firesat_system(self): # Test Fire Satellite System n = int(1e5) usehifi = False sat_params = system.setup() input_vars = sat_params['rand_inputs'] x = utils.mvn(input_vars, n) qoi = system.run(x, var_info=sat_params) self.assertTrue(True)
def test_firesat_power_lowfidelity(self): # Test power model, low fidelity n = int(1e3) fidelity = 0 sat_params = system.setup() input_vars = ['Po', 'F_s'] x = utils.mvn(input_vars, n) cpl_vars = ['PACS', 'dt_orbit', 'dt_eclipse'] y = utils.uniform(cpl_vars, n) qoi = power(x, y, var_info=sat_params, fidelity=fidelity) self.assertTrue(True)
def test_orbit_lowfidelity(self): np.random.seed(1234) sat_params = system.setup() n = 10000 x = utils.mvn(['H', 'phi'], n) qoi = orbit(x, sat_params, fidelity=0) qoi_means_true = np.array( [4045.81892, 37913.0974, 3191.54502, 1.30984041e-5]) qoi_means = np.mean(qoi, axis=1) for i, q in enumerate(qoi_means): npt.assert_approx_equal(q, qoi_means_true[i])
def test_orbit_medfidelity(self): np.random.seed(1234) sat_params = system.setup() n = 10 x = utils.mvn(['H', 'phi'], n) qoi = orbit(x, sat_params, fidelity=1) qoi_means = np.mean(qoi, axis=1) qoi_means_true = np.array( [3999.73915, 39189.6937, 6291.00484, 1.23764331e-5]) for i, q in enumerate(qoi_means): npt.assert_approx_equal(q, qoi_means_true[i])
np.random.seed(1234) sat_params = system.setup() n = 10 x = utils.mvn(['H', 'phi'], n) qoi = orbit(x, sat_params, fidelity=1) qoi_means = np.mean(qoi, axis=1) qoi_means_true = np.array( [3999.73915, 39189.6937, 6291.00484, 1.23764331e-5]) for i, q in enumerate(qoi_means): npt.assert_approx_equal(q, qoi_means_true[i]) np.random.seed(1234) sat_params = system.setup() n = 10 x = utils.mvn(['H', 'phi'], n) def prof_orbit(): orbit(x, sat_params) if __name__ == "__main__": import cProfile np.random.seed(1234) sat_params = system.setup() n = 100 x = utils.mvn(['H', 'phi'], n) # print(x)