You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Refactor GeopotentialGravitationalField for improved performance and accuracy in gravitational calculations
* Add test for 24h propagation with degree-10 geopotential and validate position error
* Enhance GeopotentialGravitationalField with detailed comments and improve Legendre function handling at poles; add new WebFetch domains in settings
@@ -302,6 +303,7 @@ Represents a natural celestial body (planet, moon, star).
302
303
|`Flattening`| Flattening coefficient |
303
304
|`Frame`| Body-fixed reference frame |
304
305
|`SphereOfInfluence`| Sphere of influence radius (m) |
306
+
|`GravitationalField`| Gravity model (point-mass or geopotential) |
305
307
|`InitialOrbitalParameters`| Initial orbital state |
306
308
307
309
| Method | Description |
@@ -1453,7 +1455,7 @@ Console.WriteLine($"Delta-V at arrival: {solution.ArrivalVelocity.Magnitude():F1
1453
1455
1454
1456
#### SpacecraftPropagator
1455
1457
1456
-
Numerical orbit propagator with perturbations.
1458
+
Numerical orbit propagator using a Velocity-Verlet (symplectic) integrator with configurable perturbation models.
1457
1459
1458
1460
| Constructor | Description |
1459
1461
|------------|-------------|
@@ -1463,6 +1465,37 @@ Numerical orbit propagator with perturbations.
1463
1465
|--------|-------------|
1464
1466
|`Propagate()`| Execute propagation |
1465
1467
1468
+
**Force Models:**
1469
+
-**Gravitational acceleration** from each body in the `bodies` list. If a body has a `GeopotentialModelParameters`, the full spherical harmonic model (EGM2008) is used; otherwise point-mass gravity is applied.
1470
+
-**Atmospheric drag** (when `drag` is true): uses the body's atmospheric model
1471
+
-**Solar radiation pressure** (when `srp` is true): cannonball model with eclipse detection
1472
+
1473
+
**Geopotential usage:**
1474
+
1475
+
```csharp
1476
+
// Create Earth with degree-10 EGM2008 geopotential
**Accuracy:** With degree-10 EGM2008, Moon, and Sun perturbations, 24h LEO propagation achieves sub-kilometer position accuracy compared to STK HPOP reference solutions.
1498
+
1466
1499
#### TLEPropagator
1467
1500
1468
1501
SGP4/SDP4 propagator for TLE elements.
@@ -1477,6 +1510,74 @@ SGP4/SDP4 propagator for TLE elements.
1477
1510
1478
1511
---
1479
1512
1513
+
### Geopotential Gravity Models
1514
+
1515
+
The framework supports high-fidelity Earth gravity modeling using spherical harmonic expansion with the EGM2008 model (up to degree/order 70).
1516
+
1517
+
#### GeopotentialModelParameters
1518
+
1519
+
Configuration for enabling geopotential gravity on a `CelestialBody`.
1520
+
1521
+
| Constructor | Description |
1522
+
|------------|-------------|
1523
+
|`GeopotentialModelParameters(string path, ushort degree = 60)`| Load model from file path |
1524
+
|`GeopotentialModelParameters(Stream stream, ushort degree = 60)`| Load model from stream |
1525
+
1526
+
| Property | Description |
1527
+
|----------|-------------|
1528
+
|`GeopotentialModelPath`| Stream reader for the model file |
1529
+
|`GeopotentialDegree`| Maximum degree/order to use |
1530
+
1531
+
#### GeopotentialGravitationalField
1532
+
1533
+
Computes the full 3D gravitational acceleration including spherical harmonic perturbations using the Montenbruck & Gill spherical coordinate gradient formulation.
1534
+
1535
+
| Property | Description |
1536
+
|----------|-------------|
1537
+
|`MaxDegree`| Maximum harmonic degree |
1538
+
1539
+
| Method | Description |
1540
+
|--------|-------------|
1541
+
|`ComputeGravitationalAcceleration(StateVector sv)`| Compute full 3D acceleration including harmonics |
1542
+
1543
+
**Algorithm:**
1544
+
1. Transform position to body-fixed frame
1545
+
2. Compute geocentric latitude, longitude, and radius
1546
+
3. Evaluate geodesy-normalized associated Legendre functions and derivatives via stable recursion
1547
+
4. Sum radial, latitudinal, and longitudinal gradient components over all harmonic degrees/orders
1548
+
5. Transform spherical acceleration to body-fixed Cartesian, then rotate to inertial frame
1549
+
1550
+
**Normalization convention:** Geodesy (fully-normalized) without Condon-Shortley phase:
**Supported model file:** EGM2008 (tide-free), included as `Data/SolarSystem/EGM2008_to70_TideFree`. The file provides coefficients C_nm and S_nm from degree 2 to degree 70.
1554
+
1555
+
**Thread safety:**`GeopotentialGravitationalField` is **not** thread-safe. Pre-allocated buffers (Legendre tables, trig arrays) are reused across calls. Create a separate `CelestialBody` instance per thread when propagating concurrently.
1556
+
1557
+
**Degree selection guidelines:**
1558
+
1559
+
| Degree | Use Case | Typical LEO Accuracy (24h) |
1560
+
|--------|----------|---------------------------|
1561
+
| 2 | J2-only, fast preliminary analysis |~10 km |
1562
+
| 10 | Good accuracy for most LEO missions | < 1 km vs STK HPOP |
1563
+
| 20-30 | High-fidelity geodesy applications | Sub-100 m |
1564
+
| 70 | Maximum available (EGM2008_to70) | Highest fidelity |
1565
+
1566
+
```csharp
1567
+
// Degree-10 geopotential (good balance of accuracy and speed)
**Thread Safety:**`GeopotentialGravitationalField` is NOT thread-safe (pre-allocated buffers). Create separate `CelestialBody` instances for concurrent propagation.
434
+
402
435
### Attitude Maneuvers
403
436
404
437
The framework provides a family of attitude maneuvers for spacecraft orientation control. All inherit from the abstract `Attitude` base class.
@@ -534,6 +567,13 @@ Test data files are in `Data/SolarSystem/` and copied to output directory.
534
567
- Ensure body vectors and reference vectors are not collinear (minimum 5 degrees separation)
535
568
- Use `Spacecraft.Front`, `Spacecraft.Up`, etc. for standard body frame directions
536
569
- Use `Instrument.GetBoresightInSpacecraftFrame()` and `GetRefVectorInSpacecraftFrame()` for instrument-based pointing
570
+
10.**Geopotential Gravity**: When working with spherical harmonic gravity models:
571
+
- Pass `GeopotentialModelParameters` to `CelestialBody` constructor to enable geopotential
572
+
- Use degree 10 for typical LEO accuracy; degree 2 for J2-only analysis
573
+
- EGM2008 model file: `Data/SolarSystem/EGM2008_to70_TideFree` (degrees 2-70)
574
+
-`GeopotentialGravitationalField` is NOT thread-safe — one instance per thread
575
+
- Legendre functions use geodesy normalization without Condon-Shortley phase
576
+
- The model file starts at degree 2; degrees 0 and 1 are handled as zeros internally
0 commit comments