-
-
Notifications
You must be signed in to change notification settings - Fork 285
Propagation is inconsistent sometimes #901
Comments
Interestingly, this does not happen only with trail plotting. Take this snippet: from astropy import units as u
from astropy.time import Time
import matplotlib.pyplot as plt
from poliastro.bodies import Sun, Earth, Mars
from poliastro.twobody import Orbit
from poliastro.twobody.propagation import propagate
from poliastro.maneuver import Maneuver
from poliastro.plotting.static import StaticOrbitPlotter
from poliastro.util import time_range
ss = Orbit.from_vectors(
Sun,
[0.36137779, 0.84843643, 0.36772403] * u.au,
[-0.01849308, -0.00788258, -0.00339819] * (u.au / u.day)
)
coordinates = propagate(
ss,
time_range(ss.epoch, periods=200, end=ss.epoch + 10 * u.day),
)
fig, ax = plt.subplots()
op = StaticOrbitPlotter(ax=ax)
op.set_attractor(Sun)
op.set_frame(*ss.pqw())
op.plot(ss, color="r");
op.plot_trajectory(coordinates, color="k")
ax.set_xlim(-459279554.4666631, 80427317.98609273)
ax.set_ylim(-171462462.17020893, 171486927.37946865) Explanation:
...and it's not happening. There's something weird going on here. |
This can be observed in poliastro 0.13.1. |
I think this is happening because you have not propagated the |
Hi @priyanshurohilla ! I’ve recently talked with @astrojuanlu about the issue, and it seems the problem is with the transpose in the plot coordinates. |
It seems the problem comes from the propagate method as there is a discrepancy in the position values. As you may notice from the example below:
Output
|
Thanks @Meuge! This has nothing to do with plotting then, so changing the title accordingly. |
Another way to reproduce this issue: from astropy import units as u
from astropy.time import Time
import matplotlib.pyplot as plt
from poliastro.bodies import Sun
from poliastro.twobody import Orbit
from poliastro.plotting.static import StaticOrbitPlotter
orb = Orbit.from_vectors(
Sun,
[0.36137779, 0.84843643, 0.36772403] * u.au,
[-0.01849308, -0.00788258, -0.00339819] * u.au / u.day,
)
op = StaticOrbitPlotter()
op.plot(orb)
op.plot_trajectory(orb.sample(min_anomaly=orb.nu, max_anomaly=orb.nu + 5 * u.deg), color="k")
plt.show() Probably because:
|
Original figure after merging #926: ✔️ |
For example:
The text was updated successfully, but these errors were encountered: