コード例 #1
0
 def maneuver_list(self):
     if lsu.altitude(self.telemetry.position) > 30000:
         self.vehicle.pitch = m.radians(0)
     elif lsu.altitude((self.telemetry.position)) <= 30000:
         self.vehicle.pitch = m.radians(90)
     frame_angle = m.atan(self.vehicle.position[0] /
                          self.vehicle.position[1])
     theta = self.vehicle.pitch - frame_angle
     return np.array([m.cos(theta), -m.sin(theta)])
コード例 #2
0
def maneuver_list(vehicle):
    if lsu.altitude(vehicle.position) > 25000:
        vehicle.pitch = m.radians(0)
    elif lsu.altitude(vehicle.position) <= 25000:
        vehicle.pitch = m.radians(90)
    try:
        frame_angle = m.atan(vehicle.position[0] / vehicle.position[1])
    except RuntimeWarning:  # TODO hack on this...
        frame_angle = 0
    theta = vehicle.pitch - frame_angle
    return np.array([m.cos(theta), -m.sin(theta)])
コード例 #3
0
 def drag(self, R, V):
     '''returns the drag force exerted on a certain stage.'''
     if lsu.altitude(R) > 200000:
         return 0
     else:
         if np.linalg.norm(V) == 0:
             return 0
         else:
             vhat = V / np.linalg.norm(
                 V
             )  # reduce the velocity vector to its components to accurately point the drag vector
             V = np.linalg.norm(V)
             return (-0.5 * lsu.density(R) * (V**2) * self.dragCoefficient *
                     self.crossSection) * vhat
コード例 #4
0
    def drag(
        self, R, V
    ):  # TODO: remove the portion of drag from theta velocity corresponding to earthly rotation
        """returns the drag force exerted on a certain stage."""

        if lsu.altitude(R) > 200000:
            return np.array([0, 0])
        else:
            if np.linalg.norm(V) == 0:
                return np.array([0, 0])
            else:
                vhat = V / np.linalg.norm(
                    V)  # correct for speed of rotation of Earth
                V = np.linalg.norm(V)
                return (-0.5 * lsu.density(R) * (V**2) *
                        self.drag_coefficient * self.cross_section) * vhat
コード例 #5
0
 def Isp(self, R):
     if lsu.altitude(R) < 80000:
         return self.Isp_sea + (1 / lsu.pressure(0)) * (lsu.pressure(
             0) - lsu.pressure(R)) * (self.Isp_vac - self.Isp_sea)
     else:
         return self.Isp_vac