示例#1
0
	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)
示例#2
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]))
示例#3
0
	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]))
示例#4
0
	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.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.assertEqual(type(result),np.ndarray)
示例#5
0
	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.setQ_BI(qBI)
		sat.setPos(value)
		sat.setVel(v_vel_i)
		dist.ggTorqueb(sat)
		result = sat.getggDisturbance_b()
		self.assertTrue(np.allclose(result,[0.,0.,0.]))      
示例#6
0
	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)