def propagate_state(r, v, t0, tf, bstar=0.21109E-4): """Propagates a state vector Args: r(1x3 numpy array): the position vector at epoch v(1x3 numpy array): the velocity vector at epoch t0(float): initial time (epoch) tf(float): final time Returns: pos(1x3 numpy array): the position at tf vel(1x3 numpy array): the velocity at tf """ kep = state_kep(r, v) return propagate_kep(kep, t0, tf, bstar)
elif (ch == '6'): custom(initial, ch, initial_state, time, f_time) elif (ch == '7'): custom(initial, ch, initial_state, time, f_time) elif (ch == '8'): #kep=[x0[0],x0[4],x0[5],x0[1],x0[3],mean_anomaly] #kep=np.asarray(kep) time = time.tt.datetime f_time = f_time.tt.datetime time = time.timestamp() f_time = f_time.timestamp() kep = state_kep(np.asarray(initial_state_r), np.asarray(initial_state_v)) f_r, f_v = propagate_state(np.asarray(initial_state_r), np.asarray(initial_state_v), time, f_time, bstar=0.21109E-4) #r= [float(f_v[0]),float(initial_state[1, 0]),float(initial_state[2, 0])] f_r = np.asarray(f_r) f_v = np.asarray(f_v) #f_orbit= Orbit.from_vectors(Earth, r, v) #f_orbit.plot() print("Orbital elements:") print(state_kep(f_r, f_v)) print("")