Autonomous optimal deorbit guidance