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_solar_torque_value(self): state = np.array([1., 0., 0., 0., 0.1, -0.02, -0.2]) mySat = Satellite(state, 128.05) v_sv_i = np.array([1.0, 0.0, 0.0]) #sun vector in eci frame mySat.setSun_i(v_sv_i) mySat.setLight(0) result = dist.vTSdB(mySat) print result self.assertTrue( np.allclose(result, [0.00000000e+00, -3.66624000e-11, 3.17376000e-10]))
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.) sat.setQ_BI(qBI) 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) dist.solarTorqueb(sat) result = sat.getsolarDisturbance_b() self.assertTrue(np.allclose(result,[ 0.00000000e+00,-3.66624000e-11,3.17376000e-10]))
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)