ootk 4.0.0-0 → 4.0.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +142 -31
- package/{lib → dist}/coordinate/Hill.d.ts +17 -18
- package/{lib → dist}/coordinate/Hill.js +44 -36
- package/dist/coordinate/Hill.js.map +1 -0
- package/{lib → dist}/covariance/CovarianceSample.d.ts +6 -7
- package/{lib → dist}/covariance/CovarianceSample.js +29 -28
- package/dist/covariance/CovarianceSample.js.map +1 -0
- package/{lib → dist}/covariance/StateCovariance.d.ts +4 -3
- package/{lib → dist}/covariance/StateCovariance.js +8 -5
- package/dist/covariance/StateCovariance.js.map +1 -0
- package/{lib → dist}/force/AtmosphericDrag.d.ts +1 -2
- package/{lib → dist}/force/AtmosphericDrag.js +13 -6
- package/dist/force/AtmosphericDrag.js.map +1 -0
- package/{lib → dist}/force/EarthGravity.d.ts +1 -2
- package/{lib → dist}/force/EarthGravity.js +4 -2
- package/dist/force/EarthGravity.js.map +1 -0
- package/{lib → dist}/force/Force.d.ts +3 -2
- package/{lib → dist}/force/Force.js +3 -2
- package/dist/force/Force.js.map +1 -0
- package/{lib → dist}/force/ForceModel.d.ts +4 -5
- package/{lib → dist}/force/ForceModel.js +6 -2
- package/dist/force/ForceModel.js.map +1 -0
- package/{lib → dist}/force/Gravity.d.ts +1 -4
- package/{lib → dist}/force/Gravity.js +3 -4
- package/dist/force/Gravity.js.map +1 -0
- package/{lib → dist}/force/SolarRadiationPressure.d.ts +1 -2
- package/{lib → dist}/force/SolarRadiationPressure.js +6 -4
- package/dist/force/SolarRadiationPressure.js.map +1 -0
- package/{lib → dist}/force/ThirdBodyGravity.d.ts +1 -2
- package/{lib → dist}/force/ThirdBodyGravity.js +4 -3
- package/dist/force/ThirdBodyGravity.js.map +1 -0
- package/{lib → dist}/force/Thrust.d.ts +10 -11
- package/{lib → dist}/force/Thrust.js +8 -3
- package/dist/force/Thrust.js.map +1 -0
- package/dist/interfaces/RfSensorParams.d.ts +28 -0
- package/dist/interfaces/RfSensorParams.js +24 -0
- package/dist/interfaces/RfSensorParams.js.map +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -0
- package/{lib → dist}/interpolator/ChebyshevCoefficients.d.ts +11 -15
- package/{lib → dist}/interpolator/ChebyshevCoefficients.js +19 -15
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -0
- package/{lib → dist}/interpolator/ChebyshevInterpolator.d.ts +1 -2
- package/{lib → dist}/interpolator/ChebyshevInterpolator.js +2 -2
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -0
- package/{lib → dist}/interpolator/CubicSpline.d.ts +8 -9
- package/{lib → dist}/interpolator/CubicSpline.js +10 -5
- package/dist/interpolator/CubicSpline.js.map +1 -0
- package/{lib → dist}/interpolator/CubicSplineInterpolator.d.ts +2 -3
- package/{lib → dist}/interpolator/CubicSplineInterpolator.js +6 -4
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -0
- package/{lib → dist}/interpolator/FieldInterpolator.d.ts +7 -5
- package/{lib → dist}/interpolator/FieldInterpolator.js +6 -3
- package/dist/interpolator/FieldInterpolator.js.map +1 -0
- package/{lib → dist}/interpolator/Interpolator.d.ts +1 -2
- package/{lib → dist}/interpolator/Interpolator.js +1 -2
- package/dist/interpolator/Interpolator.js.map +1 -0
- package/{lib → dist}/interpolator/LagrangeInterpolator.d.ts +8 -10
- package/{lib → dist}/interpolator/LagrangeInterpolator.js +32 -29
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -0
- package/{lib → dist}/interpolator/StateInterpolator.d.ts +2 -4
- package/{lib → dist}/interpolator/StateInterpolator.js +2 -4
- package/dist/interpolator/StateInterpolator.js.map +1 -0
- package/{lib → dist}/interpolator/VerletBlendInterpolator.d.ts +4 -5
- package/{lib → dist}/interpolator/VerletBlendInterpolator.js +16 -13
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -0
- package/{lib/ootk.d.ts → dist/main.d.ts} +4 -2
- package/dist/main.js +32 -0
- package/dist/main.js.map +1 -0
- package/{lib → dist}/maneuver/TwoBurnOrbitTransfer.d.ts +5 -7
- package/{lib → dist}/maneuver/TwoBurnOrbitTransfer.js +6 -3
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
- package/{lib → dist}/maneuver/Waypoint.d.ts +30 -5
- package/{lib → dist}/maneuver/Waypoint.js +31 -4
- package/dist/maneuver/Waypoint.js.map +1 -0
- package/{lib → dist}/objects/DetailedSatellite.d.ts +7 -31
- package/{lib → dist}/objects/DetailedSatellite.js +68 -72
- package/dist/objects/DetailedSatellite.js.map +1 -0
- package/{lib → dist}/objects/DetailedSensor.d.ts +1 -2
- package/{lib → dist}/objects/DetailedSensor.js +22 -2
- package/dist/objects/DetailedSensor.js.map +1 -0
- package/{lib → dist}/objects/LandObject.d.ts +3 -6
- package/{lib → dist}/objects/LandObject.js +9 -3
- package/dist/objects/LandObject.js.map +1 -0
- package/{lib → dist}/objects/Marker.d.ts +1 -2
- package/{lib → dist}/objects/Marker.js +1 -2
- package/dist/objects/Marker.js.map +1 -0
- package/dist/objects/RfSensor.d.ts +41 -0
- package/dist/objects/RfSensor.js +67 -0
- package/dist/objects/RfSensor.js.map +1 -0
- package/{lib → dist}/objects/index.d.ts +1 -1
- package/{lib → dist}/objects/index.js +1 -1
- package/dist/objects/index.js.map +1 -0
- package/{lib → dist}/observation/Observation.d.ts +42 -4
- package/{lib → dist}/observation/Observation.js +41 -10
- package/dist/observation/Observation.js.map +1 -0
- package/{lib → dist}/observation/ObservationOptical.d.ts +7 -6
- package/{lib → dist}/observation/ObservationOptical.js +19 -15
- package/dist/observation/ObservationOptical.js.map +1 -0
- package/{lib → dist}/observation/ObservationRadar.d.ts +7 -4
- package/{lib → dist}/observation/ObservationRadar.js +25 -19
- package/dist/observation/ObservationRadar.js.map +1 -0
- package/{lib → dist}/observation/ObservationUtils.d.ts +1 -2
- package/{lib → dist}/observation/ObservationUtils.js +1 -2
- package/dist/observation/ObservationUtils.js.map +1 -0
- package/{lib → dist}/observation/PropagatorPairs.d.ts +3 -2
- package/{lib → dist}/observation/PropagatorPairs.js +7 -4
- package/dist/observation/PropagatorPairs.js.map +1 -0
- package/{lib → dist}/operations/BoxMuller.d.ts +7 -2
- package/{lib → dist}/operations/BoxMuller.js +15 -4
- package/dist/operations/BoxMuller.js.map +1 -0
- package/dist/operations/EulerAngles.d.ts +105 -0
- package/{lib → dist}/operations/EulerAngles.js +72 -22
- package/dist/operations/EulerAngles.js.map +1 -0
- package/{lib → dist}/operations/Quaternion.d.ts +5 -6
- package/{lib → dist}/operations/Quaternion.js +12 -9
- package/dist/operations/Quaternion.js.map +1 -0
- package/{lib → dist}/operations/RandomGaussianSource.d.ts +1 -2
- package/{lib → dist}/operations/RandomGaussianSource.js +3 -3
- package/dist/operations/RandomGaussianSource.js.map +1 -0
- package/{lib → dist}/optimize/ChebyshevCompressor.d.ts +3 -2
- package/{lib → dist}/optimize/ChebyshevCompressor.js +7 -4
- package/dist/optimize/ChebyshevCompressor.js.map +1 -0
- package/{lib → dist}/optimize/DownhillSimplex.d.ts +16 -2
- package/{lib → dist}/optimize/DownhillSimplex.js +16 -2
- package/dist/optimize/DownhillSimplex.js.map +1 -0
- package/{lib → dist}/optimize/GoldenSection.d.ts +9 -3
- package/{lib → dist}/optimize/GoldenSection.js +9 -3
- package/dist/optimize/GoldenSection.js.map +1 -0
- package/{lib → dist}/optimize/PolynomialRegression.d.ts +14 -2
- package/{lib → dist}/optimize/PolynomialRegression.js +19 -2
- package/dist/optimize/PolynomialRegression.js.map +1 -0
- package/{lib → dist}/optimize/PolynomicalRegressionResult.d.ts +5 -2
- package/{lib → dist}/optimize/PolynomicalRegressionResult.js +8 -2
- package/dist/optimize/PolynomicalRegressionResult.js.map +1 -0
- package/{lib → dist}/optimize/SimpleLinearRegression.d.ts +5 -2
- package/{lib → dist}/optimize/SimpleLinearRegression.js +12 -7
- package/dist/optimize/SimpleLinearRegression.js.map +1 -0
- package/{lib → dist}/optimize/SimplexEntry.d.ts +1 -2
- package/{lib → dist}/optimize/SimplexEntry.js +5 -2
- package/dist/optimize/SimplexEntry.js.map +1 -0
- package/{lib → dist}/orbit_determination/BatchLeastSquaresOD.d.ts +14 -3
- package/{lib → dist}/orbit_determination/BatchLeastSquaresOD.js +29 -4
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
- package/{lib → dist}/orbit_determination/BatchLeastSquaresResult.d.ts +4 -2
- package/{lib → dist}/orbit_determination/BatchLeastSquaresResult.js +7 -2
- package/dist/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
- package/{lib → dist}/orbit_determination/GibbsIOD.d.ts +9 -4
- package/{lib → dist}/orbit_determination/GibbsIOD.js +11 -5
- package/dist/orbit_determination/GibbsIOD.js.map +1 -0
- package/{lib → dist}/orbit_determination/GoodingIOD.d.ts +21 -22
- package/{lib → dist}/orbit_determination/GoodingIOD.js +74 -71
- package/dist/orbit_determination/GoodingIOD.js.map +1 -0
- package/{lib → dist}/orbit_determination/HerrickGibbsIOD.d.ts +4 -4
- package/{lib → dist}/orbit_determination/HerrickGibbsIOD.js +3 -2
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -0
- package/{lib → dist}/orbit_determination/LambertIOD.d.ts +21 -8
- package/{lib → dist}/orbit_determination/LambertIOD.js +20 -6
- package/dist/orbit_determination/LambertIOD.js.map +1 -0
- package/{lib → dist}/orbit_determination/ModifiedGoodingIOD.d.ts +6 -7
- package/{lib → dist}/orbit_determination/ModifiedGoodingIOD.js +12 -11
- package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
- package/{lib → dist}/propagator/DormandPrince54Propagator.d.ts +1 -2
- package/dist/propagator/DormandPrince54Propagator.js +64 -0
- package/dist/propagator/DormandPrince54Propagator.js.map +1 -0
- package/{lib → dist}/propagator/KeplerPropagator.d.ts +1 -2
- package/{lib → dist}/propagator/KeplerPropagator.js +5 -2
- package/{lib → dist}/propagator/KeplerPropagator.js.map +1 -1
- package/{lib → dist}/propagator/Propagator.d.ts +5 -6
- package/{lib → dist}/propagator/Propagator.js +5 -6
- package/dist/propagator/Propagator.js.map +1 -0
- package/{lib → dist}/propagator/RkCheckpoint.d.ts +1 -2
- package/{lib → dist}/propagator/RkCheckpoint.js +3 -2
- package/dist/propagator/RkCheckpoint.js.map +1 -0
- package/{lib → dist}/propagator/RkResult.d.ts +1 -2
- package/{lib → dist}/propagator/RkResult.js +4 -2
- package/dist/propagator/RkResult.js.map +1 -0
- package/{lib → dist}/propagator/RungeKutta4Propagator.d.ts +14 -10
- package/{lib → dist}/propagator/RungeKutta4Propagator.js +45 -36
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -0
- package/{lib → dist}/propagator/RungeKutta89Propagator.d.ts +1 -2
- package/dist/propagator/RungeKutta89Propagator.js +126 -0
- package/dist/propagator/RungeKutta89Propagator.js.map +1 -0
- package/{lib → dist}/propagator/RungeKuttaAdaptive.d.ts +13 -11
- package/{lib → dist}/propagator/RungeKuttaAdaptive.js +31 -24
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -0
- package/{lib → dist}/propagator/Sgp4Propagator.d.ts +3 -4
- package/{lib → dist}/propagator/Sgp4Propagator.js +4 -3
- package/dist/propagator/Sgp4Propagator.js.map +1 -0
- package/{lib → dist}/smoothing/ExponentialSmoothing.d.ts +1 -2
- package/{lib → dist}/smoothing/ExponentialSmoothing.js +1 -2
- package/dist/smoothing/ExponentialSmoothing.js.map +1 -0
- package/dist/transforms/index.d.ts +1 -0
- package/dist/transforms/index.js +2 -0
- package/dist/transforms/index.js.map +1 -0
- package/dist/transforms/transforms.d.ts +58 -0
- package/dist/transforms/transforms.js +94 -0
- package/dist/transforms/transforms.js.map +1 -0
- package/{lib → dist}/types/types.d.ts +44 -4
- package/{lib → dist}/types/types.js +1 -2
- package/dist/types/types.js.map +1 -0
- package/dist/utils/functions.d.ts +8 -0
- package/dist/utils/functions.js +18 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/jacobian.d.ts +11 -0
- package/dist/utils/jacobian.js +29 -0
- package/dist/utils/jacobian.js.map +1 -0
- package/package.json +32 -42
- package/src/coordinate/Hill.ts +326 -0
- package/src/coordinate/index.ts +1 -0
- package/src/covariance/CovarianceSample.ts +194 -0
- package/src/covariance/StateCovariance.ts +69 -0
- package/src/force/AtmosphericDrag.ts +101 -0
- package/src/force/EarthGravity.ts +157 -0
- package/src/force/Force.ts +33 -0
- package/src/force/ForceModel.ts +91 -0
- package/src/force/Gravity.ts +53 -0
- package/src/force/SolarRadiationPressure.ts +42 -0
- package/src/force/ThirdBodyGravity.ts +62 -0
- package/src/force/Thrust.ts +83 -0
- package/src/interfaces/RfSensorParams.ts +30 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interpolator/ChebyshevCoefficients.ts +109 -0
- package/src/interpolator/ChebyshevInterpolator.ts +87 -0
- package/src/interpolator/CubicSpline.ts +72 -0
- package/src/interpolator/CubicSplineInterpolator.ts +90 -0
- package/src/interpolator/FieldInterpolator.ts +37 -0
- package/src/interpolator/Interpolator.ts +56 -0
- package/src/interpolator/LagrangeInterpolator.ts +192 -0
- package/src/interpolator/StateInterpolator.ts +39 -0
- package/src/interpolator/VerletBlendInterpolator.ts +146 -0
- package/{lib/ootk.js → src/main.ts} +7 -3
- package/src/maneuver/TwoBurnOrbitTransfer.ts +79 -0
- package/src/maneuver/Waypoint.ts +267 -0
- package/src/objects/DetailedSatellite.ts +159 -0
- package/src/objects/DetailedSensor.ts +68 -0
- package/src/objects/LandObject.ts +46 -0
- package/src/objects/Marker.ts +25 -0
- package/src/objects/RfSensor.ts +78 -0
- package/src/objects/index.ts +5 -0
- package/src/observation/Observation.ts +125 -0
- package/src/observation/ObservationOptical.ts +146 -0
- package/src/observation/ObservationRadar.ts +131 -0
- package/src/observation/ObservationUtils.ts +40 -0
- package/src/observation/PropagatorPairs.ts +45 -0
- package/src/operations/BoxMuller.ts +87 -0
- package/src/operations/EulerAngles.ts +183 -0
- package/src/operations/Quaternion.ts +222 -0
- package/src/operations/RandomGaussianSource.ts +51 -0
- package/src/operations/index.ts +4 -0
- package/src/optimize/ChebyshevCompressor.ts +96 -0
- package/src/optimize/DownhillSimplex.ts +212 -0
- package/src/optimize/GoldenSection.ts +71 -0
- package/src/optimize/PolynomialRegression.ts +109 -0
- package/src/optimize/PolynomicalRegressionResult.ts +32 -0
- package/src/optimize/SimpleLinearRegression.ts +127 -0
- package/src/optimize/SimplexEntry.ts +50 -0
- package/src/orbit_determination/BatchLeastSquaresOD.ts +174 -0
- package/src/orbit_determination/BatchLeastSquaresResult.ts +33 -0
- package/src/orbit_determination/GibbsIOD.ts +95 -0
- package/src/orbit_determination/GoodingIOD.ts +380 -0
- package/src/orbit_determination/HerrickGibbsIOD.ts +51 -0
- package/src/orbit_determination/LambertIOD.ts +260 -0
- package/src/orbit_determination/ModifiedGoodingIOD.ts +133 -0
- package/src/propagator/DormandPrince54Propagator.ts +73 -0
- package/src/propagator/KeplerPropagator.ts +102 -0
- package/src/propagator/Propagator.ts +253 -0
- package/src/propagator/RkCheckpoint.ts +25 -0
- package/src/propagator/RkResult.ts +26 -0
- package/src/propagator/RungeKutta4Propagator.ts +179 -0
- package/src/propagator/RungeKutta89Propagator.ts +132 -0
- package/src/propagator/RungeKuttaAdaptive.ts +232 -0
- package/src/propagator/Sgp4Propagator.ts +71 -0
- package/src/smoothing/ExponentialSmoothing.ts +90 -0
- package/src/transforms/index.ts +1 -0
- package/src/transforms/transforms.ts +117 -0
- package/src/types/types.ts +135 -0
- package/src/utils/functions.ts +21 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/jacobian.ts +38 -0
- package/.eslintrc.json +0 -244
- package/jest.config.ts +0 -30
- package/lib/coordinate/Hill.js.map +0 -1
- package/lib/covariance/CovarianceSample.js.map +0 -1
- package/lib/covariance/StateCovariance.js.map +0 -1
- package/lib/force/AtmosphericDrag.js.map +0 -1
- package/lib/force/EarthGravity.js.map +0 -1
- package/lib/force/Force.js.map +0 -1
- package/lib/force/ForceModel.js.map +0 -1
- package/lib/force/Gravity.js.map +0 -1
- package/lib/force/SolarRadiationPressure.js.map +0 -1
- package/lib/force/ThirdBodyGravity.js.map +0 -1
- package/lib/force/Thrust.js.map +0 -1
- package/lib/interpolator/ChebyshevCoefficients.js.map +0 -1
- package/lib/interpolator/ChebyshevInterpolator.js.map +0 -1
- package/lib/interpolator/CubicSpline.js.map +0 -1
- package/lib/interpolator/CubicSplineInterpolator.js.map +0 -1
- package/lib/interpolator/FieldInterpolator.js.map +0 -1
- package/lib/interpolator/Interpolator.js.map +0 -1
- package/lib/interpolator/LagrangeInterpolator.js.map +0 -1
- package/lib/interpolator/StateInterpolator.js.map +0 -1
- package/lib/interpolator/VerletBlendInterpolator.js.map +0 -1
- package/lib/maneuver/TwoBurnOrbitTransfer.js.map +0 -1
- package/lib/maneuver/Waypoint.js.map +0 -1
- package/lib/objects/DetailedSatellite.js.map +0 -1
- package/lib/objects/DetailedSensor.js.map +0 -1
- package/lib/objects/LandObject.js.map +0 -1
- package/lib/objects/Marker.js.map +0 -1
- package/lib/objects/index.js.map +0 -1
- package/lib/observation/Observation.js.map +0 -1
- package/lib/observation/ObservationOptical.js.map +0 -1
- package/lib/observation/ObservationRadar.js.map +0 -1
- package/lib/observation/ObservationUtils.js.map +0 -1
- package/lib/observation/PropagatorPairs.js.map +0 -1
- package/lib/ootk.js.map +0 -1
- package/lib/operations/BoxMuller.js.map +0 -1
- package/lib/operations/EulerAngles.d.ts +0 -50
- package/lib/operations/EulerAngles.js.map +0 -1
- package/lib/operations/Quaternion.js.map +0 -1
- package/lib/operations/RandomGaussianSource.js.map +0 -1
- package/lib/optimize/ChebyshevCompressor.js.map +0 -1
- package/lib/optimize/DownhillSimplex.js.map +0 -1
- package/lib/optimize/GoldenSection.js.map +0 -1
- package/lib/optimize/PolynomialRegression.js.map +0 -1
- package/lib/optimize/PolynomicalRegressionResult.js.map +0 -1
- package/lib/optimize/SimpleLinearRegression.js.map +0 -1
- package/lib/optimize/SimplexEntry.js.map +0 -1
- package/lib/orbit_determination/BatchLeastSquaresOD.js.map +0 -1
- package/lib/orbit_determination/BatchLeastSquaresResult.js.map +0 -1
- package/lib/orbit_determination/GibbsIOD.js.map +0 -1
- package/lib/orbit_determination/GoodingIOD.js.map +0 -1
- package/lib/orbit_determination/HerrickGibbsIOD.js.map +0 -1
- package/lib/orbit_determination/LambertIOD.js.map +0 -1
- package/lib/orbit_determination/ModifiedGoodingIOD.js.map +0 -1
- package/lib/propagator/DormandPrince54Propagator.js +0 -68
- package/lib/propagator/DormandPrince54Propagator.js.map +0 -1
- package/lib/propagator/Propagator.js.map +0 -1
- package/lib/propagator/RkCheckpoint.js.map +0 -1
- package/lib/propagator/RkResult.js.map +0 -1
- package/lib/propagator/RungeKutta4Propagator.js.map +0 -1
- package/lib/propagator/RungeKutta89Propagator.js +0 -130
- package/lib/propagator/RungeKutta89Propagator.js.map +0 -1
- package/lib/propagator/RungeKuttaAdaptive.js.map +0 -1
- package/lib/propagator/Sgp4Propagator.js.map +0 -1
- package/lib/smoothing/ExponentialSmoothing.js.map +0 -1
- package/lib/types/types.js.map +0 -1
- /package/{lib → dist}/coordinate/index.d.ts +0 -0
- /package/{lib → dist}/coordinate/index.js +0 -0
- /package/{lib → dist}/coordinate/index.js.map +0 -0
- /package/{lib → dist}/operations/index.d.ts +0 -0
- /package/{lib → dist}/operations/index.js +0 -0
- /package/{lib → dist}/operations/index.js.map +0 -0
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ootk",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"module": "dist/main.js",
|
|
4
6
|
"description": "Orbital Object Toolkit including Multiple Propagators, Initial Orbit Determination, and Maneuver Calculations.",
|
|
5
7
|
"scripts": {
|
|
6
|
-
"build": "
|
|
7
|
-
"
|
|
8
|
-
"lint": "eslint src",
|
|
9
|
-
"lint:fix": "eslint src --fix",
|
|
10
|
-
"
|
|
11
|
-
"test": "npm run build && jest",
|
|
8
|
+
"build": "npm run clean && npx tsc -p tsconfig.build.json -m esnext",
|
|
9
|
+
"clean": "node ./scripts/cleanup.mjs",
|
|
10
|
+
"lint": "npx eslint src",
|
|
11
|
+
"lint:fix": "npx eslint src --fix",
|
|
12
|
+
"test": "jest",
|
|
12
13
|
"test:coverage": "jest --coverage",
|
|
13
|
-
"
|
|
14
|
-
"version": "auto-changelog -p && git add CHANGELOG.md"
|
|
15
|
-
},
|
|
16
|
-
"main": "./lib/ootk.js",
|
|
17
|
-
"exports": {
|
|
18
|
-
"import": "./lib/ootk.js",
|
|
19
|
-
"require": "./lib/ootk.js"
|
|
14
|
+
"version": "npm run build && auto-changelog && git add CHANGELOG.md"
|
|
20
15
|
},
|
|
16
|
+
"main": "dist/main.js",
|
|
17
|
+
"typings": "dist/main.d.ts",
|
|
21
18
|
"repository": {
|
|
22
19
|
"type": "git",
|
|
23
20
|
"url": "git://github.com/thkruz/ootk"
|
|
@@ -27,7 +24,9 @@
|
|
|
27
24
|
"orbit",
|
|
28
25
|
"toolkit",
|
|
29
26
|
"space",
|
|
30
|
-
"satellite"
|
|
27
|
+
"satellite",
|
|
28
|
+
"radar",
|
|
29
|
+
"iod"
|
|
31
30
|
],
|
|
32
31
|
"author": "Theodore Kruczek <theodore.kruczek@gmail.com> (https://github.com/ootk/)",
|
|
33
32
|
"license": "APGL-3.0",
|
|
@@ -35,35 +34,26 @@
|
|
|
35
34
|
"url": "https://github.com/thkruz/ootk/issues"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"@babel/core": "^7.
|
|
39
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
40
|
-
"@babel/preset-env": "^7.
|
|
41
|
-
"@babel/preset-typescript": "^7.
|
|
42
|
-
"@types/jest": "^
|
|
43
|
-
"@
|
|
44
|
-
"@typescript-eslint/
|
|
45
|
-
"
|
|
46
|
-
"auto-changelog": "^
|
|
37
|
+
"@babel/core": "^7.23.7",
|
|
38
|
+
"@babel/plugin-transform-runtime": "^7.23.7",
|
|
39
|
+
"@babel/preset-env": "^7.23.8",
|
|
40
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
41
|
+
"@types/jest": "^29.5.11",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
43
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
44
|
+
"auto-changelog": "^2.4.0",
|
|
45
|
+
"auto-changelog-thkruz": "^1.0.0",
|
|
47
46
|
"babel-eslint": "^10.1.0",
|
|
48
|
-
"babel-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"eslint": "^
|
|
47
|
+
"babel-jest": "^29.7.0",
|
|
48
|
+
"babel-loader": "^9.1.3",
|
|
49
|
+
"eslint": "^8.56.0",
|
|
50
|
+
"eslint-plugin-jsdoc": "^48.0.2",
|
|
52
51
|
"jest": "^28.1.3",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"prettier": "^2.8.8",
|
|
56
|
-
"prettier-plugin-organize-imports": "^3.2.3",
|
|
57
|
-
"ts-node": "^10.9.2",
|
|
58
|
-
"tsconfig-paths": "^4.2.0",
|
|
59
|
-
"ttypescript": "^1.5.15",
|
|
60
|
-
"typescript": "^4.9.5",
|
|
61
|
-
"typescript-transform-paths": "^3.4.6",
|
|
62
|
-
"webpack": "^5.11.1",
|
|
63
|
-
"webpack-cli": "^4.10.0"
|
|
52
|
+
"tsx": "^4.7.0",
|
|
53
|
+
"typescript": "^4.9.5"
|
|
64
54
|
},
|
|
65
|
-
"homepage": "https://github.com/thkruz/ootk",
|
|
66
55
|
"dependencies": {
|
|
67
|
-
"ootk-core": "^1.0.
|
|
68
|
-
}
|
|
56
|
+
"ootk-core": "^1.0.8"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/thkruz/ootk"
|
|
69
59
|
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2020-2024 Theodore Kruczek
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
Earth,
|
|
20
|
+
EpochUTC,
|
|
21
|
+
J2000,
|
|
22
|
+
Kilometers,
|
|
23
|
+
KilometersPerSecond,
|
|
24
|
+
Matrix,
|
|
25
|
+
MetersPerSecond,
|
|
26
|
+
RadiansPerSecond,
|
|
27
|
+
RelativeState,
|
|
28
|
+
Seconds,
|
|
29
|
+
Vector3D,
|
|
30
|
+
} from 'ootk-core';
|
|
31
|
+
import { Thrust } from './../force/Thrust';
|
|
32
|
+
import { Waypoint } from './../maneuver/Waypoint';
|
|
33
|
+
|
|
34
|
+
// / Hill Modified Equidistant Cyllindrical _(EQCM)_ coordinates.
|
|
35
|
+
export class Hill {
|
|
36
|
+
private semimajorAxis_: Kilometers;
|
|
37
|
+
private meanMotion_: RadiansPerSecond;
|
|
38
|
+
|
|
39
|
+
constructor(
|
|
40
|
+
public epoch: EpochUTC,
|
|
41
|
+
public position: Vector3D<Kilometers>,
|
|
42
|
+
public velocity: Vector3D<KilometersPerSecond>,
|
|
43
|
+
semimajorAxis: Kilometers,
|
|
44
|
+
) {
|
|
45
|
+
this.semimajorAxis_ = semimajorAxis;
|
|
46
|
+
this.meanMotion_ = Earth.smaToMeanMotion(this.semimajorAxis_);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static fromState(
|
|
50
|
+
origin: J2000,
|
|
51
|
+
radialPosition: Kilometers,
|
|
52
|
+
intrackPosition: Kilometers,
|
|
53
|
+
nodeVelocity: KilometersPerSecond,
|
|
54
|
+
nodeOffsetTime: Seconds,
|
|
55
|
+
): Hill {
|
|
56
|
+
const a = origin.semimajorAxis;
|
|
57
|
+
const n = Earth.smaToMeanMotion(a);
|
|
58
|
+
const yDot = -3.0 * radialPosition * n * 0.5 as KilometersPerSecond;
|
|
59
|
+
const z = (nodeVelocity / n) * Math.sin(n * -nodeOffsetTime) as Kilometers;
|
|
60
|
+
const zDot = nodeVelocity * Math.cos(n * -nodeOffsetTime) as KilometersPerSecond;
|
|
61
|
+
const r = new Vector3D(radialPosition, intrackPosition, z);
|
|
62
|
+
const v = new Vector3D(0.0 as KilometersPerSecond, yDot, zDot);
|
|
63
|
+
|
|
64
|
+
return new Hill(origin.epoch, r, v, a);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static fromNmc(
|
|
68
|
+
origin: J2000,
|
|
69
|
+
majorAxisRange: Kilometers,
|
|
70
|
+
nodeVelocity: KilometersPerSecond,
|
|
71
|
+
nodeOffsetTime: Seconds,
|
|
72
|
+
translation = 0.0,
|
|
73
|
+
): Hill {
|
|
74
|
+
const a = origin.semimajorAxis;
|
|
75
|
+
const n = Earth.smaToMeanMotion(a);
|
|
76
|
+
const xDot = majorAxisRange * n * 0.5 as KilometersPerSecond;
|
|
77
|
+
const z = (nodeVelocity / n) * Math.sin(n * -nodeOffsetTime) as Kilometers;
|
|
78
|
+
const zDot = nodeVelocity * Math.cos(n * -nodeOffsetTime) as KilometersPerSecond;
|
|
79
|
+
const r = new Vector3D(0.0 as Kilometers, majorAxisRange + translation as Kilometers, z);
|
|
80
|
+
const v = new Vector3D(xDot, 0.0 as KilometersPerSecond, zDot);
|
|
81
|
+
|
|
82
|
+
return new Hill(origin.epoch, r, v, a);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static fromPerch(
|
|
86
|
+
origin: J2000,
|
|
87
|
+
perchRange: Kilometers,
|
|
88
|
+
nodeVelocity: KilometersPerSecond,
|
|
89
|
+
nodeOffsetTime: Seconds,
|
|
90
|
+
): Hill {
|
|
91
|
+
const a = origin.semimajorAxis;
|
|
92
|
+
const n = Earth.smaToMeanMotion(a);
|
|
93
|
+
const z = (nodeVelocity / n) * Math.sin(n * -nodeOffsetTime) as Kilometers;
|
|
94
|
+
const zDot = nodeVelocity * Math.cos(n * -nodeOffsetTime) as KilometersPerSecond;
|
|
95
|
+
const r = new Vector3D(0.0 as Kilometers, perchRange, z);
|
|
96
|
+
const v = new Vector3D(0.0 as KilometersPerSecond, 0.0 as KilometersPerSecond, zDot);
|
|
97
|
+
|
|
98
|
+
return new Hill(origin.epoch, r, v, a);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get semimajorAxis(): Kilometers {
|
|
102
|
+
return this.semimajorAxis_;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
set semimajorAxis(sma: Kilometers) {
|
|
106
|
+
this.semimajorAxis_ = sma;
|
|
107
|
+
this.meanMotion_ = Earth.smaToMeanMotion(this.semimajorAxis_);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get meanMotion(): RadiansPerSecond {
|
|
111
|
+
return this.meanMotion_;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
toJ2000Matrix(origin: J2000, transform: Matrix): J2000 {
|
|
115
|
+
const magrtgt = origin.position.magnitude();
|
|
116
|
+
const magrint = magrtgt + this.position.x;
|
|
117
|
+
const vtgtrsw = transform.multiplyVector3D(origin.velocity);
|
|
118
|
+
|
|
119
|
+
const lambdadottgt = vtgtrsw.y / magrtgt;
|
|
120
|
+
const lambdaint = this.position.y / magrtgt;
|
|
121
|
+
const phiint = this.position.z / magrtgt;
|
|
122
|
+
const sinphiint = Math.sin(phiint);
|
|
123
|
+
const cosphiint = Math.cos(phiint);
|
|
124
|
+
const sinlambdaint = Math.sin(lambdaint);
|
|
125
|
+
const coslambdaint = Math.cos(lambdaint);
|
|
126
|
+
|
|
127
|
+
const rotRswSez = new Matrix([
|
|
128
|
+
[sinphiint * coslambdaint, sinphiint * sinlambdaint, -cosphiint],
|
|
129
|
+
[-sinlambdaint, coslambdaint, 0],
|
|
130
|
+
[cosphiint * coslambdaint, cosphiint * sinlambdaint, sinphiint],
|
|
131
|
+
]);
|
|
132
|
+
|
|
133
|
+
const rdotint = this.velocity.x + vtgtrsw.x;
|
|
134
|
+
const lambdadotint = this.velocity.y / magrtgt + lambdadottgt;
|
|
135
|
+
const phidotint = this.velocity.z / magrtgt;
|
|
136
|
+
const vintsez = new Vector3D(-magrint * phidotint, magrint * lambdadotint * cosphiint, rdotint);
|
|
137
|
+
const vintrsw = rotRswSez.transpose().multiplyVector3D(vintsez);
|
|
138
|
+
const vinteci = transform.transpose().multiplyVector3D(vintrsw) as Vector3D<KilometersPerSecond>;
|
|
139
|
+
|
|
140
|
+
const rintrsw = new Vector3D(
|
|
141
|
+
cosphiint * magrint * coslambdaint,
|
|
142
|
+
cosphiint * magrint * sinlambdaint,
|
|
143
|
+
sinphiint * magrint,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const rinteci = transform.transpose().multiplyVector3D(rintrsw) as Vector3D<Kilometers>;
|
|
147
|
+
|
|
148
|
+
return new J2000(origin.epoch, rinteci, vinteci);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
toJ2000(origin: J2000): J2000 {
|
|
152
|
+
return this.toJ2000Matrix(origin, RelativeState.createMatrix(origin.position, origin.velocity));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static transitionMatrix(t: number, meanMotion: number): Matrix {
|
|
156
|
+
const n = meanMotion;
|
|
157
|
+
const sn = Math.sin(n * t);
|
|
158
|
+
const cs = Math.cos(n * t);
|
|
159
|
+
|
|
160
|
+
return new Matrix([
|
|
161
|
+
[4.0 - 3.0 * cs, 0.0, 0.0, sn / n, (2.0 * (1.0 - cs)) / n, 0.0],
|
|
162
|
+
[6.0 * (sn - n * t), 1.0, 0.0, (-2.0 * (1.0 - cs)) / n, (4.0 * sn - 3.0 * n * t) / n, 0.0],
|
|
163
|
+
[0.0, 0.0, cs, 0.0, 0.0, sn / n],
|
|
164
|
+
[3.0 * n * sn, 0.0, 0.0, cs, 2.0 * sn, 0.0],
|
|
165
|
+
[-6.0 * n * (1.0 - cs), 0.0, 0.0, -2.0 * sn, 4.0 * cs - 3.0, 0.0],
|
|
166
|
+
[0.0, 0.0, -n * sn, 0.0, 0.0, cs],
|
|
167
|
+
]);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
transition(t: Seconds): Hill {
|
|
171
|
+
const sysMat = Hill.transitionMatrix(t, this.meanMotion_);
|
|
172
|
+
const res = sysMat.multiplyVector(this.position.join(this.velocity)).elements;
|
|
173
|
+
|
|
174
|
+
return new Hill(
|
|
175
|
+
this.epoch.roll(t),
|
|
176
|
+
new Vector3D(res[0] as Kilometers, res[1] as Kilometers, res[2] as Kilometers),
|
|
177
|
+
new Vector3D(res[3] as KilometersPerSecond, res[4] as KilometersPerSecond, res[5] as KilometersPerSecond),
|
|
178
|
+
this.semimajorAxis_,
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
transitionWithMatrix(stm: Matrix, t: Seconds): Hill {
|
|
183
|
+
const res = stm.multiplyVector(this.position.join(this.velocity)).elements;
|
|
184
|
+
|
|
185
|
+
return new Hill(
|
|
186
|
+
this.epoch.roll(t),
|
|
187
|
+
new Vector3D(res[0] as Kilometers, res[1] as Kilometers, res[2] as Kilometers),
|
|
188
|
+
new Vector3D(res[3] as KilometersPerSecond, res[4] as KilometersPerSecond, res[5] as KilometersPerSecond),
|
|
189
|
+
this.semimajorAxis_,
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
propagate(newEpoch: EpochUTC): Hill {
|
|
194
|
+
return this.transition(newEpoch.difference(this.epoch));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
propagateWithMatrix(stm: Matrix, newEpoch: EpochUTC): Hill {
|
|
198
|
+
return this.transitionWithMatrix(stm, newEpoch.difference(this.epoch));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
maneuver(maneuver: Thrust): Hill {
|
|
202
|
+
const state = this.propagate(maneuver.center);
|
|
203
|
+
|
|
204
|
+
return new Hill(state.epoch, state.position, state.velocity.add(maneuver.deltaV), state.semimajorAxis_);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
ephemeris(start: EpochUTC, stop: EpochUTC, step = 60.0 as Seconds): Hill[] {
|
|
208
|
+
const output: Hill[] = [];
|
|
209
|
+
let current = start;
|
|
210
|
+
|
|
211
|
+
while (stop >= current) {
|
|
212
|
+
output.push(this.propagate(current));
|
|
213
|
+
current = current.roll(step);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return output;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
get period(): Seconds {
|
|
220
|
+
return (2 * Math.PI) / this.meanMotion_ as Seconds;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
nextRadialTangent(): Hill {
|
|
224
|
+
const x = this.position.x;
|
|
225
|
+
const xDot = this.velocity.x;
|
|
226
|
+
const yDot = this.velocity.y;
|
|
227
|
+
let t = Math.atan(-xDot / (3.0 * this.meanMotion_ * x + 2.0 * yDot)) / this.meanMotion_ as Seconds;
|
|
228
|
+
|
|
229
|
+
if (t <= 0) {
|
|
230
|
+
t = t + 0.5 * this.period as Seconds;
|
|
231
|
+
} else if (isNaN(t)) {
|
|
232
|
+
t = 0.5 * this.period as Seconds;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return this.propagate(this.epoch.roll(t));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
solveManeuver(waypoint: Waypoint, ignoreCrosstrack = false): Thrust {
|
|
239
|
+
const t = waypoint.epoch.difference(this.epoch);
|
|
240
|
+
const w = waypoint.relativePosition;
|
|
241
|
+
const sysMat = Hill.transitionMatrix(t, this.meanMotion_);
|
|
242
|
+
const posEquationMat = new Matrix([
|
|
243
|
+
[sysMat.elements[0][0], sysMat.elements[0][1], sysMat.elements[0][2]],
|
|
244
|
+
[sysMat.elements[1][0], sysMat.elements[1][1], sysMat.elements[1][2]],
|
|
245
|
+
[sysMat.elements[2][0], sysMat.elements[2][1], sysMat.elements[2][2]],
|
|
246
|
+
]);
|
|
247
|
+
const solnVector = w
|
|
248
|
+
.subtract(posEquationMat.multiplyVector3D(this.position)) as unknown as Vector3D<KilometersPerSecond>;
|
|
249
|
+
const velEquationMat = new Matrix([
|
|
250
|
+
[sysMat.elements[0][3], sysMat.elements[0][4], sysMat.elements[0][5]],
|
|
251
|
+
[sysMat.elements[1][3], sysMat.elements[1][4], sysMat.elements[1][5]],
|
|
252
|
+
[sysMat.elements[2][3], sysMat.elements[2][4], sysMat.elements[2][5]],
|
|
253
|
+
]);
|
|
254
|
+
let result = velEquationMat
|
|
255
|
+
.inverse()
|
|
256
|
+
.multiplyVector3D(solnVector)
|
|
257
|
+
.subtract(this.velocity);
|
|
258
|
+
|
|
259
|
+
if (ignoreCrosstrack) {
|
|
260
|
+
result = new Vector3D(
|
|
261
|
+
result.x,
|
|
262
|
+
result.y,
|
|
263
|
+
0 as KilometersPerSecond,
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return new Thrust(
|
|
268
|
+
this.epoch,
|
|
269
|
+
result.x * 1000 as MetersPerSecond,
|
|
270
|
+
result.y * 1000 as MetersPerSecond,
|
|
271
|
+
result.z * 1000 as MetersPerSecond,
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
maneuverSequence(
|
|
276
|
+
pivot: EpochUTC,
|
|
277
|
+
waypoints: Waypoint[],
|
|
278
|
+
preManeuvers: Thrust[] = [],
|
|
279
|
+
postManeuvers: Thrust[] = [],
|
|
280
|
+
): Thrust[] {
|
|
281
|
+
let state = new Hill(this.epoch, this.position, this.velocity, this.semimajorAxis_);
|
|
282
|
+
|
|
283
|
+
preManeuvers = preManeuvers.slice();
|
|
284
|
+
postManeuvers = postManeuvers.slice();
|
|
285
|
+
let output = preManeuvers;
|
|
286
|
+
|
|
287
|
+
// Note difference was once compareTo
|
|
288
|
+
output.sort((a, b) => a.center.difference(b.center));
|
|
289
|
+
output = output.filter((mvr) => mvr.center >= this.epoch && mvr.center >= pivot);
|
|
290
|
+
for (const mvr of output) {
|
|
291
|
+
state = state.maneuver(mvr);
|
|
292
|
+
}
|
|
293
|
+
state = state.propagate(pivot);
|
|
294
|
+
for (const wpt of waypoints) {
|
|
295
|
+
const mvr = state.solveManeuver(wpt);
|
|
296
|
+
|
|
297
|
+
state = state.maneuver(mvr);
|
|
298
|
+
output.push(mvr);
|
|
299
|
+
}
|
|
300
|
+
output.push(...postManeuvers);
|
|
301
|
+
|
|
302
|
+
return output;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
maneuverOrigin(maneuver: Thrust): Hill {
|
|
306
|
+
const state = this.propagate(maneuver.center);
|
|
307
|
+
const vInit = Math.sqrt(Earth.mu / this.semimajorAxis_);
|
|
308
|
+
const vFinal = vInit - maneuver.intrack * 1e-3;
|
|
309
|
+
const aFinal = Earth.mu / (vFinal * vFinal) as Kilometers;
|
|
310
|
+
|
|
311
|
+
return new Hill(state.epoch, state.position, state.velocity.subtract(maneuver.deltaV), aFinal);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
get name(): string {
|
|
315
|
+
return 'Hill';
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
toString(): string {
|
|
319
|
+
return [
|
|
320
|
+
`[${this.name}]`,
|
|
321
|
+
` Epoch: ${this.epoch}`,
|
|
322
|
+
` Position: ${this.position.toString(6)} km`,
|
|
323
|
+
` Velocity: ${this.velocity.toString(9)} km/s`,
|
|
324
|
+
].join('\n');
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Hill } from './Hill';
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2020-2024 Theodore Kruczek
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/* eslint-disable class-methods-use-this */
|
|
19
|
+
import {
|
|
20
|
+
Epoch,
|
|
21
|
+
EpochUTC,
|
|
22
|
+
J2000,
|
|
23
|
+
Kilometers,
|
|
24
|
+
KilometersPerSecond,
|
|
25
|
+
Matrix,
|
|
26
|
+
RelativeState,
|
|
27
|
+
RIC,
|
|
28
|
+
Vector,
|
|
29
|
+
Vector3D,
|
|
30
|
+
} from 'ootk-core';
|
|
31
|
+
import { ForceModel } from '../force/ForceModel';
|
|
32
|
+
import { Thrust } from '../force/Thrust';
|
|
33
|
+
import { RungeKutta89Propagator } from '../propagator/RungeKutta89Propagator';
|
|
34
|
+
import { CovarianceFrame, StateCovariance } from './StateCovariance';
|
|
35
|
+
|
|
36
|
+
// / Sigma point covariance sample.
|
|
37
|
+
export class CovarianceSample {
|
|
38
|
+
private _origin: RungeKutta89Propagator;
|
|
39
|
+
private _samples: RungeKutta89Propagator[] = [];
|
|
40
|
+
private matrix_ = Matrix.zero(6, 12);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create a new [CovarianceSample] object from an inertial state, covariance
|
|
44
|
+
* and optional force models for the origin state and samples.
|
|
45
|
+
*
|
|
46
|
+
* Two-body physics will be used if a force model is not provided.
|
|
47
|
+
* @param state The origin state.
|
|
48
|
+
* @param covariance The covariance.
|
|
49
|
+
* @param originForceModel The force model for the origin state.
|
|
50
|
+
* @param sampleForceModel The force model for the samples.
|
|
51
|
+
*/
|
|
52
|
+
constructor(state: J2000, covariance: StateCovariance, originForceModel?: ForceModel, sampleForceModel?: ForceModel) {
|
|
53
|
+
originForceModel ??= new ForceModel().setGravity();
|
|
54
|
+
sampleForceModel ??= new ForceModel().setGravity();
|
|
55
|
+
this._origin = new RungeKutta89Propagator(state, originForceModel);
|
|
56
|
+
const s = covariance.matrix.cholesky().elements;
|
|
57
|
+
const sqrt6 = Math.sqrt(6.0);
|
|
58
|
+
|
|
59
|
+
for (let i = 0; i < 6; i++) {
|
|
60
|
+
for (let j = 0; j < 6; j++) {
|
|
61
|
+
s[i][j] *= sqrt6;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 6 x 12 matrix
|
|
66
|
+
const sigmapts = Matrix.zero(6, 12).elements;
|
|
67
|
+
|
|
68
|
+
for (let i = 0; i < 6; i++) {
|
|
69
|
+
const jj = (i - 1) * 2 + 2;
|
|
70
|
+
|
|
71
|
+
for (let j = 0; j < 3; j++) {
|
|
72
|
+
sigmapts[j][jj] = s[j][i];
|
|
73
|
+
sigmapts[j + 3][jj] = s[j + 3][i];
|
|
74
|
+
|
|
75
|
+
sigmapts[j][jj + 1] = -s[j][i];
|
|
76
|
+
sigmapts[j + 3][jj + 1] = -s[j + 3][i];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for (let i = 0; i < 12; i++) {
|
|
81
|
+
const sampleR = new Vector3D(
|
|
82
|
+
sigmapts[0][i] as Kilometers,
|
|
83
|
+
sigmapts[1][i] as Kilometers,
|
|
84
|
+
sigmapts[2][i] as Kilometers,
|
|
85
|
+
);
|
|
86
|
+
const sampleV = new Vector3D(
|
|
87
|
+
sigmapts[3][i] as KilometersPerSecond,
|
|
88
|
+
sigmapts[4][i] as KilometersPerSecond,
|
|
89
|
+
sigmapts[5][i] as KilometersPerSecond,
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
if (covariance.frame === CovarianceFrame.ECI) {
|
|
93
|
+
const sample = new J2000(state.epoch, state.position.add(sampleR), state.velocity.add(sampleV));
|
|
94
|
+
|
|
95
|
+
this._samples.push(new RungeKutta89Propagator(sample, sampleForceModel));
|
|
96
|
+
} else if (covariance.frame === CovarianceFrame.RIC) {
|
|
97
|
+
const sample = new RIC(sampleR, sampleV).toJ2000(state);
|
|
98
|
+
|
|
99
|
+
this._samples.push(new RungeKutta89Propagator(sample, sampleForceModel));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// / Current covariance sample epoch.
|
|
105
|
+
get epoch(): Epoch {
|
|
106
|
+
return this._origin.state.epoch;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// / Current covariance sample origin state.
|
|
110
|
+
get state(): J2000 {
|
|
111
|
+
return this._origin.state;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// / Rebuild covariance from sigma points.
|
|
115
|
+
private _rebuildCovariance(matrix: Matrix): Matrix {
|
|
116
|
+
const pts = matrix.elements;
|
|
117
|
+
const c = 1.0 / 12.0;
|
|
118
|
+
const yu = new Vector([0, 0, 0, 0, 0, 0]).elements;
|
|
119
|
+
const y = Matrix.zero(6, 12);
|
|
120
|
+
|
|
121
|
+
for (let i = 0; i < 12; i++) {
|
|
122
|
+
for (let j = 0; j < 6; j++) {
|
|
123
|
+
yu[j] += pts[j][i];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
for (let j = 0; j < 6; j++) {
|
|
128
|
+
yu[j] *= c;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for (let i = 0; i < 12; i++) {
|
|
132
|
+
for (let j = 0; j < 6; j++) {
|
|
133
|
+
y.elements[j][i] = pts[j][i] - yu[j];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const yt = y.transpose();
|
|
138
|
+
const tmp = y.multiply(yt);
|
|
139
|
+
|
|
140
|
+
return tmp.scale(c);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// / Propagate covariance to a new epoch.
|
|
144
|
+
propagate(epoch: EpochUTC): void {
|
|
145
|
+
this._origin.propagate(epoch);
|
|
146
|
+
for (const sample of this._samples) {
|
|
147
|
+
sample.propagate(epoch);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// / Apply a maneuver to this covariance.
|
|
152
|
+
maneuver(maneuver: Thrust): void {
|
|
153
|
+
this._origin.maneuver(maneuver);
|
|
154
|
+
for (const sample of this._samples) {
|
|
155
|
+
sample.maneuver(maneuver);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// / Desample covariance in J2000 frame.
|
|
160
|
+
desampleJ2000(): StateCovariance {
|
|
161
|
+
for (let i = 0; i < 12; i++) {
|
|
162
|
+
const state = this._samples[i].state;
|
|
163
|
+
|
|
164
|
+
this.matrix_.elements[0][i] = state.position.x;
|
|
165
|
+
this.matrix_.elements[1][i] = state.position.y;
|
|
166
|
+
this.matrix_.elements[2][i] = state.position.z;
|
|
167
|
+
this.matrix_.elements[3][i] = state.velocity.x;
|
|
168
|
+
this.matrix_.elements[4][i] = state.velocity.y;
|
|
169
|
+
this.matrix_.elements[5][i] = state.velocity.z;
|
|
170
|
+
}
|
|
171
|
+
const matrix = this._rebuildCovariance(this.matrix_);
|
|
172
|
+
|
|
173
|
+
return new StateCovariance(matrix, CovarianceFrame.ECI);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// / Desample covariance in RIC frame.
|
|
177
|
+
desampleRIC(): StateCovariance {
|
|
178
|
+
const rot = RelativeState.createMatrix(this._origin.state.position, this._origin.state.velocity);
|
|
179
|
+
|
|
180
|
+
for (let i = 0; i < 12; i++) {
|
|
181
|
+
const state = RIC.fromJ2000Matrix(this._samples[i].state, this._origin.state, rot);
|
|
182
|
+
|
|
183
|
+
this.matrix_.elements[0][i] = state.position.x;
|
|
184
|
+
this.matrix_.elements[1][i] = state.position.y;
|
|
185
|
+
this.matrix_.elements[2][i] = state.position.z;
|
|
186
|
+
this.matrix_.elements[3][i] = state.velocity.x;
|
|
187
|
+
this.matrix_.elements[4][i] = state.velocity.y;
|
|
188
|
+
this.matrix_.elements[5][i] = state.velocity.z;
|
|
189
|
+
}
|
|
190
|
+
const matrix = this._rebuildCovariance(this.matrix_);
|
|
191
|
+
|
|
192
|
+
return new StateCovariance(matrix, CovarianceFrame.RIC);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2020-2024 Theodore Kruczek
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Matrix, Vector } from 'ootk-core';
|
|
19
|
+
|
|
20
|
+
/** Covariance Frame */
|
|
21
|
+
export enum CovarianceFrame {
|
|
22
|
+
/** Earth-centered inertial */
|
|
23
|
+
ECI = 'eci',
|
|
24
|
+
/** Radial-Intrack-Crosstrack */
|
|
25
|
+
RIC = 'ric',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// / State covariance.
|
|
29
|
+
export class StateCovariance {
|
|
30
|
+
/**
|
|
31
|
+
* Create a new [StateCovariance] object given its covariance [matrix] and
|
|
32
|
+
* [CovarianceFrame].
|
|
33
|
+
* @param matrix The covariance matrix.
|
|
34
|
+
* @param frame The covariance frame.
|
|
35
|
+
* @returns A new [StateCovariance] object.
|
|
36
|
+
*/
|
|
37
|
+
constructor(public matrix: Matrix, public frame: CovarianceFrame) {
|
|
38
|
+
// Nothing to do here.
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// / Create a new [StateCovariance] object from 1-sigma values.
|
|
42
|
+
static fromSigmas(sigmas: number[], frame: CovarianceFrame): StateCovariance {
|
|
43
|
+
const n = sigmas.length;
|
|
44
|
+
const output = Matrix.zero(n, n);
|
|
45
|
+
|
|
46
|
+
for (let i = 0; i < n; i++) {
|
|
47
|
+
output.elements[i][i] = Math.max(sigmas[i] * sigmas[i], 1e-32);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return new StateCovariance(output, frame);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Calculates the standard deviations (sigmas) of each element in the covariance matrix.
|
|
55
|
+
* @returns A vector containing the standard deviations of each element in the covariance matrix.
|
|
56
|
+
*/
|
|
57
|
+
sigmas(): Vector {
|
|
58
|
+
const c = this.matrix.columns;
|
|
59
|
+
const result = new Float64Array(c);
|
|
60
|
+
|
|
61
|
+
for (let i = 0; i < c; i++) {
|
|
62
|
+
const variance = this.matrix.elements[i][i];
|
|
63
|
+
|
|
64
|
+
result[i] = Math.sqrt(variance);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return new Vector(result);
|
|
68
|
+
}
|
|
69
|
+
}
|