# `Sidereon.Propagator`
[🔗](https://github.com/neilberkman/sidereon-ex/blob/main/lib/sidereon/propagator.ex#L1)

High-precision numerical orbit propagation.

Supports high-order adaptive numerical integration (DP54)
of orbital states using various force models via Rust NIF.

# `covariance_node`

```elixir
@type covariance_node() :: %{
  state: %{
    epoch_tdb_seconds: float(),
    position_km: vec3(),
    velocity_km_s: vec3()
  },
  covariance: [[float()]],
  frame: String.t()
}
```

# `state`

```elixir
@type state() :: {r :: vec3(), v :: vec3()}
```

# `vec3`

```elixir
@type vec3() :: {float(), float(), float()}
```

# `propagate`

```elixir
@spec propagate(state(), float(), keyword()) :: {:ok, state()} | {:error, any()}
```

Adaptive step propagation using Dormand-Prince 5(4) via Rust NIF.
Returns the state at exactly `t_end`.

## Options
  * `:tolerance` - Integration tolerance (default: 1.0e-12)
  * `:forces` - List of active force models: `[:twobody, :j2]`,
    `[:composite, :j2_j6, :third_body, {:srp, cr, area_to_mass_m2_kg}, :relativity]`,
    `[:composite, {:geopotential, degree, order}]`,
    `[:composite, :solid_earth_tide, :solid_earth_pole_tide]`,
    or `[:earth_phase_a]` (default: `[:twobody]`)
  * `:drag` - optional `%Sidereon.Drag.Parameters{}` drag model
  * `:space_weather_table` - optional `%Sidereon.SpaceWeather{}` used with `:drag`
  * `:epoch_tdb_seconds` - initial epoch for table-backed drag (default: 0.0)

# `propagate_covariance`

```elixir
@spec propagate_covariance(state(), [[number()]], [number()], keyword()) ::
  {:ok, [covariance_node()]} | {:error, term()}
```

Propagate a Cartesian state and its 6x6 covariance to requested TDB epochs.

`initial_state` is `{position_km, velocity_km_s}`. `epochs_tdb_seconds` are
absolute TDB seconds in the same scale as `:epoch_tdb_seconds`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
