def kepler_state(self, dt): sma, ecc, inc, node, peri, true_ano = self.elements mean_ano = kepler.true_to_mean(true_ano, ecc) mean_ano1 = dt*self.mean_motion + mean_ano true_ano1 = kepler.mean_to_true(mean_ano1, ecc) rv = kepler.cartesian(self.body.mu, sma, ecc, inc, node, peri, true_ano1) return State(rv[:3]*self.r.unit, rv[3:]*self.v.unit, self.t+TimeDelta(dt, format='sec'), self.frame, self.body)
def kepler_state(self, dt): sma, ecc, inc, node, peri, true_ano = self.elements mean_ano = kepler.true_to_mean(true_ano, ecc) mean_ano1 = dt * self.mean_motion + mean_ano true_ano1 = kepler.mean_to_true(mean_ano1, ecc) rv = kepler.cartesian(self.body.mu, sma, ecc, inc, node, peri, true_ano1) return State(rv[:3] * self.r.unit, rv[3:] * self.v.unit, self.t + TimeDelta(dt, format='sec'), self.frame, self.body)
def kepler_orbit(self, n=100): dt = np.linspace(0, self.period, n) sma, ecc, inc, node, peri, ano1 = self.elements mean_ano = kepler.true_to_mean(ano1, ecc) mean_ano1 = dt*self.mean_motion + mean_ano ano = units.Quantity([kepler.mean_to_true(m, ecc) for m in mean_ano1]) sma = np.repeat(sma, n) ecc = np.repeat(ecc, n) inc = np.repeat(inc, n) node = np.repeat(node, n) peri = np.repeat(peri, n) epochs = self.t + TimeDelta(dt, format='sec') states = kepler.cartesian(self.body.mu, sma, ecc, inc, node, peri, ano) return Orbit( deepcopy(self), dt, epochs, states, elements=[sma, ecc, inc, node, peri, ano] )
def kepler_orbit(self, n=100): dt = np.linspace(0, self.period, n) sma, ecc, inc, node, peri, ano1 = self.elements mean_ano = kepler.true_to_mean(ano1, ecc) mean_ano1 = dt * self.mean_motion + mean_ano ano = units.Quantity([kepler.mean_to_true(m, ecc) for m in mean_ano1]) sma = np.repeat(sma, n) ecc = np.repeat(ecc, n) inc = np.repeat(inc, n) node = np.repeat(node, n) peri = np.repeat(peri, n) epochs = self.t + TimeDelta(dt, format='sec') states = kepler.cartesian(self.body.mu, sma, ecc, inc, node, peri, ano) return Orbit(deepcopy(self), dt, epochs, states, elements=[sma, ecc, inc, node, peri, ano])