Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] TLE estimation fails due to negative eccentricity #533

Open
vishwa2710 opened this issue Mar 11, 2025 · 0 comments
Open

[fix] TLE estimation fails due to negative eccentricity #533

vishwa2710 opened this issue Mar 11, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@vishwa2710
Copy link
Contributor

vishwa2710 commented Mar 11, 2025

Describe the bug
Sometimes TLE estimation can fail due to a negative eccentricity found in an intermediate step.

Steps to reproduce

from ostk.physics import Environment
from ostk.physics.environment.object.celestial import Earth
from ostk.physics.coordinate import Position
from ostk.physics.coordinate import Velocity
from ostk.physics.coordinate import Frame
from ostk.physics.time import Instant
from ostk.physics.time import Interval
from ostk.physics.time import Duration
from ostk.physics.time import Scale

from ostk.astrodynamics.trajectory import State
from ostk.astrodynamics.trajectory import Propagator
from ostk.astrodynamics.estimator import TLESolver
from ostk.astrodynamics.solver import LeastSquaresSolver

state = State(
    position=Position.meters([-130897.3295, 1348403.6866, -6841471.7888], Frame.GCRF()),
    velocity=Velocity.meters_per_second([5678.9079, -4865.1520, -1075.1813], Frame.GCRF()),
    instant=Instant.parse("2024-12-04 23:50:00", Scale.UTC)
)

earth = Earth.spherical()

environment = Environment(Instant.J2000(), [earth])

propagator = Propagator.default(environment)

interval = Interval.closed(state.get_instant(), state.get_instant() + Duration.days(1.0))

instants = interval.generate_grid(Duration.minutes(1.0))

states = propagator.calculate_states_at(state, instants)

tle_solver = TLESolver(
    solver=LeastSquaresSolver.default(),
    satellite_number=99999,
    revolution_number=1,
    estimate_b_star=False,
)

analysis = tle_solver.estimate(states[0], states)

Expected behavior
The TLE estimator converges to a solution

Potential suggestion
It might be sufficient to just use std::max(0.0, aTLEState.extractCoordinate(EccentricitySubset)[0]) here:

aTLEState.extractCoordinate(EccentricitySubset)[0],

@vishwa2710 vishwa2710 added the bug Something isn't working label Mar 11, 2025
@vishwa2710 vishwa2710 self-assigned this Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant