コード例 #1
0
    def apply(self, satellite: Satellite) -> ManeuverCost:
        cur_theta = satellite.true_anomaly()

        if satellite.orbit.is_open and cur_theta >= 0:
            raise ValueError("Periapsis is in the past on an open orbit")

        delta_theta = 2 * math.pi - cur_theta
        return WaitAngle(delta_theta).apply(satellite)
コード例 #2
0
    def apply(self, satellite: Satellite) -> ManeuverCost:
        orbit = satellite.orbit
        cur_theta = satellite.true_anomaly()
        new_theta = cur_theta + self.delta_theta

        # Find the difference in s and wait by that much
        cur_s = satellite.true_to_universal_anomaly(cur_theta)
        new_s = satellite.true_to_universal_anomaly(new_theta)

        delta_s = new_s - cur_s
        satellite.wait_s(delta_s)
        return ManeuverCost(delta_t=satellite.delta_s_to_t(delta_s))
コード例 #3
0
    def apply(self, satellite: Satellite) -> ManeuverCost:
        cur_theta = satellite.true_anomaly()

        # TODO: should i also block nearly-parabolic?
        if satellite.orbit.is_open:
            raise ValueError("No apoapsis on an open orbit")

        if cur_theta <= math.pi:
            # next apoapsis is coming up soon
            delta_theta = math.pi - cur_theta
        else:
            # we just passed it, pass through the periapsis first
            delta_theta = 3 * math.pi - cur_theta

        return WaitAngle(delta_theta).apply(satellite)