Hi everyone,
I am implementing a station-keeping program that applies thrust every 5 days (as an example) using a low-thrust model, stopping when a predefined altitude is reached. I am encountering an error with the date detector, which serves as my starting detector for the maneuvers. When I check the number of dates in the detector, I see 32 dates, but the thrust is only triggered 16 times (as shown in the graph). A part of the script is available below, along with the graph of the results. Essentially, the maneuver is triggered every 10 days instead of every 5.
Let me know if you’d like further assistance with the technical aspects!
def getSMABasedManeuverTriggers():
date_list=[]
current_date=initial_date
sma_start_detector=DateDetector(current_date).withHandler(ContinueOnEvent())
while current_date.compareTo(Mission_End_Date)<0:
current_date=current_date.shiftedBy(86400*time)
sma_start_detector.addEventDate(current_date)
date_list.append(current_date)
print(sma_start_detector.getDates().size())
print(len(date_list)+1)
eventsLogger_begin = EventsLogger()
ev_logs_begin = eventsLogger_begin.monitorDetector(sma_start_detector)
sma_stop_detector = SMA_f_Detector(sma_threshold_finite_burns).withMaxCheck(float(600))
eventsLogger_end = EventsLogger()
ev_logs_end = eventsLogger_end.monitorDetector(sma_stop_detector)
ev_logs_end = EventSlopeFilter(ev_logs_end, FilterType.TRIGGER_ONLY_DECREASING_EVENTS)
# Define mission duration detector
mission_duration_detector = BooleanDetector.notCombine(MissionDurationDetector(Mission_End_Date).withMaxCheck(float(100)))
mission_duration_detector = AbstractDetector.cast_(mission_duration_detector)
# Combine detectors: Only execute SMA maneuvers if within mission duration
#combined_start_detector = BooleanDetector.andCombine([NegateDetector(sma_start_detector), mission_duration_detector])
return sma_start_detector,sma_stop_detector,ev_logs_begin, ev_logs_end,eventsLogger_begin,eventsLogger_end, ActualStartStopTriggerEvents(AbstractDetector.cast_(sma_start_detector), AbstractDetector.cast_(sma_stop_detector))