def test_aero(self): sat = Satellite( np.array([np.sqrt(0.5), -np.sqrt(0.5), 0., 0., 0.1, 0.23, 0.]), 13.) sat.setPos(np.array([0., 0., 7e6])) sat.setVel(np.array([0, 2e3, 6e3])) result = dist.aero_torque(sat) print result
def test_solar_torque_type(self): sat = Satellite(np.array([1., 0., 0., 0., 0., 0., 0.]), 13.) sat.setPos(np.array([7070e3, 0., 0.])) v_sv_i = np.array([1.0, 0.0, 0.0]) sat.setSun_i(v_sv_i) sat.setLight(0) result = dist.vTSdB(sat) self.assertEqual(type(result), np.ndarray)
def test_inertia_eigenvec(self, value): state = np.array([1., 0., 0., 0., 0.1, -0.02, -0.2]) mySat = Satellite(state, 128.05) mySat.setPos(value) mySat.setVel(np.array([5.60, -5.0, 0.0])) result = dist.gg_torque(mySat) self.assertTrue(np.allclose(result, [0., 0., 0.]))
def test_aero_type(self): sat = Satellite( np.array([np.sqrt(0.5), -np.sqrt(0.5), 0., 0., 0.1, 0.23, 0.]), 13.) sat.setPos(np.array([0., 0., 7e6])) sat.setVel(np.array([0, 2e3, 6e3])) result = dist.aero_torque(sat) self.assertEqual(type(result), np.ndarray)
def test_aero_value(self): sat = Satellite( np.array([np.sqrt(0.5), -np.sqrt(0.5), 0., 0., 0.1, 0.23, 0.]), 13.) sat.setPos(np.array([0., 0., 7e6])) sat.setVel(np.array([0, 2e3, 6e3])) result = dist.aero_torque(sat) print result self.assertTrue( np.allclose(result, [2.99654080e-10, -2.57065600e-11, -7.71196800e-11]))
def test_gg_data_type(self): qBI = np.array([0.,0.,0.,1.]) wBIb = np.array([0.,0.,0.]) v_pos_i = np.array([7070e3,0.,0.]) v_vel_i = np.array([2.0e3,2.8,-73.2]) qBO = fs.qBI2qBO(qBI,v_pos_i,v_vel_i) wBOB = fs.wBIb2wBOb(wBIb,qBO,v_w_IO_o) sat = Satellite(np.hstack((qBO,wBOB)),13.) sat.setPos(np.array([7070e3,0.,0.])) sat.setQ_BI(qBI) dist.ggTorqueb(sat) result = sat.getggDisturbance_b() self.assertEqual(type(result),np.ndarray)
def test_aero_type(self): qBI = np.array([-np.sqrt(0.5), 0., 0., np.sqrt(0.5)]) wBIb = np.array([0.1, 0.23, 0.]) v_pos_i = np.array([0., 0., 7e6]) v_vel_i = np.array([0, 2e3, 6e3]) qBO = fs.qBI2qBO(qBI, v_pos_i, v_vel_i) wBOB = fs.wBIb2wBOb(wBIb, qBO, v_w_IO_o) sat = Satellite(np.hstack((qBO, wBOB)), 13.) sat.setPos(np.array([0., 0., 7e6])) sat.setVel(np.array([0, 2e3, 6e3])) dist.aeroTorqueb(sat) result = sat.getaeroDisturbance_b() self.assertEqual(type(result), np.ndarray)
def test_inertia_eigenvec(self, value): qBI = np.array([0., 0., 0., 1.]) wBIb = np.array([0.1, -0.02, -0.2]) v_pos_i = value v_vel_i = np.array([5.60, -5.0, 0.0]) qBO = fs.qBI2qBO(qBI, v_pos_i, v_vel_i) wBOB = fs.wBIb2wBOb(wBIb, qBO, v_w_IO_o) sat = Satellite(np.hstack((qBO, wBOB)), 13.) sat.setPos(value) sat.setVel(v_vel_i) dist.ggTorqueb(sat) result = sat.getggDisturbance_b() self.assertTrue(np.allclose(result, [0., 0., 0.]))
def test_aero_value(self): qBI = np.array([-np.sqrt(0.5),0.,0.,np.sqrt(0.5)]) wBIb = np.array([0.1,0.23,0.]) v_pos_i = np.array([0.,0.,7e6]) v_vel_i = np.array([0,2e3,6e3]) qBO = fs.qBI2qBO(qBI,v_pos_i,v_vel_i) wBOB = fs.wBIb2wBOb(wBIb,qBO,v_w_IO_o) sat = Satellite(np.hstack((qBO,wBOB)),13.) sat.setQ_BI(qBI) sat.setPos(np.array([0.,0.,7e6])) sat.setVel(np.array([0,2e3,6e3])) dist.aeroTorqueb(sat) result = sat.getaeroDisturbance_b() self.assertTrue(np.allclose(result, [2.99654080e-10,-2.57065600e-11,-7.71196800e-11]))
def test_solar_torque_type(self): qBI = np.array([0.,0.,0.,1.]) wBIb = np.array([0.,0.,0.]) v_pos_i = np.array([7070e3,0.,0.]) v_vel_i = np.array([0,2e3,6e3]) qBO = fs.qBI2qBO(qBI,v_pos_i,v_vel_i) wBOB = fs.wBIb2wBOb(wBIb,qBO,v_w_IO_o) sat = Satellite(np.hstack((qBO,wBOB)),13.) sat.setQ_BI(qBI) sat.setPos(np.array([7070e3,0.,0.])) v_sv_i=np.array([1.0,0.0,0.0]) sat.setSun_i(v_sv_i) sat.setLight(1) dist.solarTorqueb(sat) result = sat.getsolarDisturbance_b() self.assertEqual(type(result),np.ndarray)
def test_solar_torque_value(self): qBI = np.array([0., 0., 0., 1.]) wBIb = np.array([0.1, -0.02, -0.2]) v_pos_i = np.array([7070e3, 0., 0.]) v_vel_i = np.array([0, 2e3, 6e3]) qBO = fs.qBI2qBO(qBI, v_pos_i, v_vel_i) wBOB = fs.wBIb2wBOb(wBIb, qBO, v_w_IO_o) sat = Satellite(np.hstack((qBO, wBOB)), 13.) v_sv_i = np.array([1.0, 0.0, 0.0]) #sun vector in eci frame sat.setSun_i(v_sv_i) sat.setLight(1) sat.setPos(v_pos_i) sat.setVel(v_vel_i) dist.solarTorqueb(sat) result = sat.getsolarDisturbance_b() self.assertTrue( np.allclose(result, [0.00000000e+00, -3.66624000e-11, 3.17376000e-10]))
def test_gg_data_type(self): sat = Satellite(np.array([1., 0., 0., 0., 0., 0., 0.]), 13.) sat.setPos(np.array([7070e3, 0., 0.])) result = dist.gg_torque(sat) self.assertEqual(type(result), np.ndarray)