def updateState(self, vessel, connection):
# self.altitude = numpy.linalg.norm(vessel.position(vessel.orbit.body.reference_frame)) # from center of body, not SL
# self.velocity = vessel.flight(vessel.orbit.body.non_rotating_reference_frame).horizontal_speed
# # self.velocity = math.sqrt(square(vessel.flight(vessel.orbit.body.non_rotating_reference_frame).speed) - square(vessel.flight(vessel.orbit.body.non_rotating_reference_frame).vertical_speed))
# self.verticalVelocity = vessel.flight(vessel.orbit.body.non_rotating_reference_frame).vertical_speed
self.angle = numpy.arctan2(self.velocity(), self.verticalVelocity())
self.thrust = 0.0
for engine in self.engineList:
self.thrust = self.thrust + engine.engine.max_thrust
self.acceleration = self.thrust / vessel.mass
if self.isp <= 0:
self.isp = self.StageVacuumSpecificImpulse(self.insertionStage)
if self.thrust > 0:
self.exhaustVelocity = self.isp * 9.80665# / self.thrust
else:
self.exhaustVelocity = 0.01
if self.mu <= 0.0:
self.mu = vessel.orbit.body.gravitational_parameter
评论列表
文章目录