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
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
DataHandler,
|
|
20
|
+
DEG2RAD,
|
|
21
|
+
Earth,
|
|
22
|
+
ITRF,
|
|
23
|
+
J2000,
|
|
24
|
+
Kilometers,
|
|
25
|
+
KilometersPerSecond,
|
|
26
|
+
Radians,
|
|
27
|
+
Sun,
|
|
28
|
+
Vector3D,
|
|
29
|
+
} from 'ootk-core';
|
|
30
|
+
import { Force } from './Force';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Harris-Priester atmospheric drag force model.
|
|
34
|
+
* Atmospheric density model assumes mean solar flux.
|
|
35
|
+
*/
|
|
36
|
+
export class AtmosphericDrag implements Force {
|
|
37
|
+
mass: number;
|
|
38
|
+
area: number;
|
|
39
|
+
dragCoeff: number;
|
|
40
|
+
cosine: number;
|
|
41
|
+
|
|
42
|
+
constructor(mass: number, area: number, dragCoeff: number, cosine: number) {
|
|
43
|
+
this.mass = mass;
|
|
44
|
+
this.area = area;
|
|
45
|
+
this.dragCoeff = dragCoeff;
|
|
46
|
+
this.cosine = cosine;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private static _getHPDensity(state: ITRF, n: number): number {
|
|
50
|
+
const hpa = DataHandler.getInstance().getHpAtmosphere(state.height);
|
|
51
|
+
|
|
52
|
+
if (hpa === null) {
|
|
53
|
+
return 0.0;
|
|
54
|
+
}
|
|
55
|
+
const sunPos = Sun.positionApparent(state.epoch);
|
|
56
|
+
const sunVec = new J2000(
|
|
57
|
+
state.epoch,
|
|
58
|
+
sunPos,
|
|
59
|
+
Vector3D.origin as Vector3D<KilometersPerSecond>,
|
|
60
|
+
).toITRF().position.normalize();
|
|
61
|
+
const bulVec = sunVec.rotZ(-30.0 * DEG2RAD as Radians);
|
|
62
|
+
const cosPsi = bulVec.normalize().dot(state.position.normalize());
|
|
63
|
+
const c2Psi2 = 0.5 * (1.0 + cosPsi);
|
|
64
|
+
const cPsi2 = Math.sqrt(c2Psi2);
|
|
65
|
+
const cosPow = cPsi2 > 1e-12 ? c2Psi2 * cPsi2 ** (n - 2) : 0.0;
|
|
66
|
+
const altitude = hpa.height;
|
|
67
|
+
const [h0, min0, max0] = hpa.hp0;
|
|
68
|
+
const [h1, min1, max1] = hpa.hp1;
|
|
69
|
+
const dH = (h0 - altitude) / (h0 - h1);
|
|
70
|
+
const rhoMin = min0 * (min1 / min0) ** dH;
|
|
71
|
+
|
|
72
|
+
if (cosPow === 0) {
|
|
73
|
+
return rhoMin;
|
|
74
|
+
}
|
|
75
|
+
const rhoMax = max0 * (max1 / max0) ** dH;
|
|
76
|
+
|
|
77
|
+
return rhoMin + (rhoMax - rhoMin) * cosPow;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
acceleration(state: J2000): Vector3D {
|
|
81
|
+
const itrfState = state.toITRF();
|
|
82
|
+
const density = AtmosphericDrag._getHPDensity(itrfState, this.cosine);
|
|
83
|
+
|
|
84
|
+
if (density === 0) {
|
|
85
|
+
return Vector3D.origin;
|
|
86
|
+
}
|
|
87
|
+
const rotation = new ITRF(
|
|
88
|
+
state.epoch,
|
|
89
|
+
// TODO: #26 This is a bit of a hack to get Radians/Second to work with StateVector class
|
|
90
|
+
Earth.rotation as unknown as Vector3D<Kilometers>,
|
|
91
|
+
Vector3D.origin as Vector3D<KilometersPerSecond>,
|
|
92
|
+
).toJ2000().position;
|
|
93
|
+
// TODO: #26 This is a bit of a hack to get Radians/Second to work with StateVector class
|
|
94
|
+
const vRel = state.velocity.subtract(rotation.cross(state.position) as unknown as Vector3D<KilometersPerSecond>)
|
|
95
|
+
.scale(1000.0 as KilometersPerSecond);
|
|
96
|
+
const vm = vRel.magnitude();
|
|
97
|
+
const fScale = -0.5 * density * ((this.dragCoeff * this.area) / this.mass) * vm;
|
|
98
|
+
|
|
99
|
+
return vRel.scale(fScale / 1000.0);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
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 { DataHandler, Earth, ITRF, J2000, Kilometers, KilometersPerSecond, Vector3D } from 'ootk-core';
|
|
19
|
+
/* eslint-disable class-methods-use-this */
|
|
20
|
+
// / Complex Earth gravity model, accounting for EGM-96 zonal, sectoral, and
|
|
21
|
+
|
|
22
|
+
import { Force } from './Force';
|
|
23
|
+
|
|
24
|
+
// / tesseral geopotential perturbations.
|
|
25
|
+
export class EarthGravity implements Force {
|
|
26
|
+
degree: number;
|
|
27
|
+
order: number;
|
|
28
|
+
_asphericalFlag: boolean;
|
|
29
|
+
|
|
30
|
+
constructor(degree: number, order: number) {
|
|
31
|
+
this.degree = Math.min(Math.max(degree, 0), 36);
|
|
32
|
+
this.order = Math.min(Math.max(order, 0), 36);
|
|
33
|
+
this._asphericalFlag = degree >= 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_spherical(state: J2000): Vector3D {
|
|
37
|
+
const rMag = state.position.magnitude();
|
|
38
|
+
|
|
39
|
+
return state.position.scale(-Earth.mu / (rMag * rMag * rMag));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line max-statements
|
|
43
|
+
_aspherical(state: J2000): Vector3D {
|
|
44
|
+
const posEcef = state.toITRF().position;
|
|
45
|
+
const ri = 1.0 / posEcef.magnitude();
|
|
46
|
+
const xor = posEcef.x * ri;
|
|
47
|
+
const yor = posEcef.y * ri;
|
|
48
|
+
const zor = posEcef.z * ri;
|
|
49
|
+
|
|
50
|
+
const ep = zor;
|
|
51
|
+
const reor = Earth.radiusEquator * ri;
|
|
52
|
+
let reorn = reor;
|
|
53
|
+
const muor2 = Earth.mu * ri * ri;
|
|
54
|
+
|
|
55
|
+
let sumH = 0.0;
|
|
56
|
+
let sumGm = 0.0;
|
|
57
|
+
let sumJ = 0.0;
|
|
58
|
+
let sumK = 0.0;
|
|
59
|
+
|
|
60
|
+
const cTil = new Float64Array(this.order + 4);
|
|
61
|
+
const sTil = new Float64Array(this.order + 4);
|
|
62
|
+
|
|
63
|
+
const pN = new Float64Array(this.order + 4);
|
|
64
|
+
const pNm1 = new Float64Array(this.order + 4);
|
|
65
|
+
const pNm2 = new Float64Array(this.order + 4);
|
|
66
|
+
|
|
67
|
+
pNm2[0] = 1.0;
|
|
68
|
+
pNm1[0] = ep;
|
|
69
|
+
pNm1[1] = 1.0;
|
|
70
|
+
cTil[0] = 1.0;
|
|
71
|
+
cTil[1] = xor;
|
|
72
|
+
sTil[1] = yor;
|
|
73
|
+
|
|
74
|
+
const dh = DataHandler.getInstance();
|
|
75
|
+
|
|
76
|
+
for (let n = 2, nm1 = 1, nm2 = 0, np1 = 3; n <= this.degree; nm2++, nm1++, n++, np1++) {
|
|
77
|
+
const twonm1 = 2.0 * n - 1.0;
|
|
78
|
+
|
|
79
|
+
reorn *= reor;
|
|
80
|
+
const cN0 = dh.getEgm96Coeffs(n, 0)[2];
|
|
81
|
+
|
|
82
|
+
pN[0] = (twonm1 * ep * pNm1[0] - nm1 * pNm2[0]) / n;
|
|
83
|
+
pN[1] = pNm2[1] + twonm1 * pNm1[0];
|
|
84
|
+
pN[2] = pNm2[2] + twonm1 * pNm1[1];
|
|
85
|
+
|
|
86
|
+
let sumHn = pN[1] * cN0;
|
|
87
|
+
let sumGmn = pN[0] * cN0 * np1;
|
|
88
|
+
|
|
89
|
+
if (this.order > 0) {
|
|
90
|
+
let sumJn = 0.0;
|
|
91
|
+
let sumKn = 0.0;
|
|
92
|
+
|
|
93
|
+
cTil[n] = cTil[1] * cTil[nm1] - sTil[1] * sTil[nm1];
|
|
94
|
+
sTil[n] = sTil[1] * cTil[nm1] + cTil[1] * sTil[nm1];
|
|
95
|
+
|
|
96
|
+
const lim = n < this.order ? n : this.order;
|
|
97
|
+
|
|
98
|
+
for (let m = 1, mm1 = 0, mm2 = -1, mp1 = 2, mp2 = 3; m <= lim; mm2++, mm1++, m++, mp1++, mp2++) {
|
|
99
|
+
pN[mp1] = pNm2[mp1] + twonm1 * pNm1[m];
|
|
100
|
+
|
|
101
|
+
const dm = m;
|
|
102
|
+
const npmp1 = n + mp1;
|
|
103
|
+
|
|
104
|
+
const pNm = pN[m];
|
|
105
|
+
const pNmp1 = pN[mp1];
|
|
106
|
+
|
|
107
|
+
const coefs = dh.getEgm96Coeffs(n, m);
|
|
108
|
+
const cNm = coefs[2];
|
|
109
|
+
const sNm = coefs[3];
|
|
110
|
+
|
|
111
|
+
const mxPnm = dm * pNm;
|
|
112
|
+
const bNmtil = cNm * cTil[m] + sNm * sTil[m];
|
|
113
|
+
const pNmBnm = pNm * bNmtil;
|
|
114
|
+
const bNmtm1 = cNm * cTil[mm1] + sNm * sTil[mm1];
|
|
115
|
+
const aNmtm1 = cNm * sTil[mm1] - sNm * cTil[mm1];
|
|
116
|
+
|
|
117
|
+
sumHn += pNmp1 * bNmtil;
|
|
118
|
+
sumGmn += npmp1 * pNmBnm;
|
|
119
|
+
sumJn += mxPnm * bNmtm1;
|
|
120
|
+
sumKn -= mxPnm * aNmtm1;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
sumJ += reorn * sumJn;
|
|
124
|
+
sumK += reorn * sumKn;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
sumH += reorn * sumHn;
|
|
128
|
+
sumGm += reorn * sumGmn;
|
|
129
|
+
|
|
130
|
+
if (n < this.degree) {
|
|
131
|
+
for (let i = 0; i <= n; i++) {
|
|
132
|
+
pNm2[i] = pNm1[i];
|
|
133
|
+
pNm1[i] = pN[i];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const lambda = sumGm + ep * sumH;
|
|
139
|
+
const g = new Vector3D<Kilometers>(
|
|
140
|
+
-muor2 * (lambda * xor - sumJ) as Kilometers,
|
|
141
|
+
-muor2 * (lambda * yor - sumK) as Kilometers,
|
|
142
|
+
-muor2 * (lambda * zor - sumH) as Kilometers,
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
return new ITRF(state.epoch, g, Vector3D.origin as Vector3D<KilometersPerSecond>).toJ2000().position;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
acceleration(state: J2000): Vector3D {
|
|
149
|
+
let accVec = this._spherical(state);
|
|
150
|
+
|
|
151
|
+
if (this._asphericalFlag) {
|
|
152
|
+
accVec = accVec.add(this._aspherical(state));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return accVec;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { J2000, Vector3D } from 'ootk-core';
|
|
19
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
20
|
+
/* eslint-disable class-methods-use-this */
|
|
21
|
+
|
|
22
|
+
// / Base class for perturbation forces.
|
|
23
|
+
export abstract class Force {
|
|
24
|
+
/**
|
|
25
|
+
* Calculate the acceleration due to the perturbing force on a given
|
|
26
|
+
* state vector.
|
|
27
|
+
* @param state The state vector.
|
|
28
|
+
* @throws If the force cannot be calculated.
|
|
29
|
+
*/
|
|
30
|
+
acceleration(state: J2000): Vector3D {
|
|
31
|
+
throw Error('Not implemented');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 { Earth, J2000, Vector, Vector3D } from 'ootk-core';
|
|
19
|
+
import { AtmosphericDrag } from './AtmosphericDrag';
|
|
20
|
+
import { EarthGravity } from './EarthGravity';
|
|
21
|
+
import { Force } from './Force';
|
|
22
|
+
import { Gravity } from './Gravity';
|
|
23
|
+
import { SolarRadiationPressure } from './SolarRadiationPressure';
|
|
24
|
+
import { ThirdBodyGravity } from './ThirdBodyGravity';
|
|
25
|
+
import { Thrust } from './Thrust';
|
|
26
|
+
|
|
27
|
+
// / Force model for spacecraft propagation.
|
|
28
|
+
|
|
29
|
+
export class ForceModel {
|
|
30
|
+
private _centralGravity?: Force;
|
|
31
|
+
private _thirdBodyGravity?: Force;
|
|
32
|
+
private _solarRadiationPressure?: Force;
|
|
33
|
+
private _atmosphericDrag?: Force;
|
|
34
|
+
private _maneuverThrust: Force | null = null;
|
|
35
|
+
|
|
36
|
+
setGravity(mu: number = Earth.mu): this {
|
|
37
|
+
this._centralGravity = new Gravity(mu);
|
|
38
|
+
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
setEarthGravity(degree: number, order: number): void {
|
|
43
|
+
this._centralGravity = new EarthGravity(degree, order);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
setThirdBodyGravity({ moon = false, sun = false }): void {
|
|
47
|
+
this._thirdBodyGravity = new ThirdBodyGravity(moon, sun);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
setSolarRadiationPressure(mass: number, area: number, coeff = 1.2): void {
|
|
51
|
+
this._solarRadiationPressure = new SolarRadiationPressure(mass, area, coeff);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
setAtmosphericDrag(mass: number, area: number, coeff = 2.2, cosine = 4): void {
|
|
55
|
+
this._atmosphericDrag = new AtmosphericDrag(mass, area, coeff, cosine);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
loadManeuver(maneuver: Thrust): void {
|
|
59
|
+
this._maneuverThrust = maneuver;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
clearManeuver(): void {
|
|
63
|
+
this._maneuverThrust = null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
acceleration(state: J2000): Vector3D {
|
|
67
|
+
let accVec = Vector3D.origin;
|
|
68
|
+
|
|
69
|
+
if (this._centralGravity) {
|
|
70
|
+
accVec = accVec.add(this._centralGravity.acceleration(state));
|
|
71
|
+
}
|
|
72
|
+
if (this._thirdBodyGravity) {
|
|
73
|
+
accVec = accVec.add(this._thirdBodyGravity.acceleration(state));
|
|
74
|
+
}
|
|
75
|
+
if (this._solarRadiationPressure) {
|
|
76
|
+
accVec = accVec.add(this._solarRadiationPressure.acceleration(state));
|
|
77
|
+
}
|
|
78
|
+
if (this._atmosphericDrag) {
|
|
79
|
+
accVec = accVec.add(this._atmosphericDrag.acceleration(state));
|
|
80
|
+
}
|
|
81
|
+
if (this._maneuverThrust) {
|
|
82
|
+
accVec = accVec.add(this._maneuverThrust.acceleration(state));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return accVec;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
derivative(state: J2000): Vector {
|
|
89
|
+
return state.velocity.join(this.acceleration(state));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { Earth, J2000, Vector3D } from 'ootk-core';
|
|
19
|
+
import { Force } from './Force';
|
|
20
|
+
|
|
21
|
+
// / Simple central-body gravity model.
|
|
22
|
+
export class Gravity implements Force {
|
|
23
|
+
// / Gravitational parameter _(km²/s³)_.
|
|
24
|
+
mu: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Create a new [Gravity] object with optional gravitational
|
|
28
|
+
* @param mu Gravitational parameter _(km²/s³)_.
|
|
29
|
+
*/
|
|
30
|
+
constructor(mu: number = Earth.mu) {
|
|
31
|
+
this.mu = mu;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Calculates the gravitational force in spherical coordinates.
|
|
36
|
+
* @param state The J2000 state containing the position and velocity vectors.
|
|
37
|
+
* @returns The gravitational force vector in spherical coordinates.
|
|
38
|
+
*/
|
|
39
|
+
private _spherical(state: J2000): Vector3D {
|
|
40
|
+
const rMag = state.position.magnitude();
|
|
41
|
+
|
|
42
|
+
return state.position.scale(-this.mu / (rMag * rMag * rMag));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Calculates the acceleration due to gravity at a given state.
|
|
47
|
+
* @param state The J2000 state at which to calculate the acceleration.
|
|
48
|
+
* @returns The acceleration vector.
|
|
49
|
+
*/
|
|
50
|
+
acceleration(state: J2000): Vector3D {
|
|
51
|
+
return this._spherical(state);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { astronomicalUnit, J2000, Sun, Vector3D } from 'ootk-core';
|
|
19
|
+
import { Force } from './Force';
|
|
20
|
+
|
|
21
|
+
// / Solar radiation pressure model.
|
|
22
|
+
export class SolarRadiationPressure extends Force {
|
|
23
|
+
// / Create a new [SolarRadiationPressure] object.
|
|
24
|
+
constructor(public mass: number, public area: number, public reflectCoeff: number) {
|
|
25
|
+
super();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// / Solar pressure _(N/m²)_;
|
|
29
|
+
private static readonly _kRef: number = 4.56e-6 * astronomicalUnit ** 2;
|
|
30
|
+
|
|
31
|
+
acceleration(state: J2000): Vector3D {
|
|
32
|
+
const rSun = Sun.positionApparent(state.epoch);
|
|
33
|
+
const r = state.position.subtract(rSun);
|
|
34
|
+
const rMag = r.magnitude();
|
|
35
|
+
const r2 = rMag * rMag;
|
|
36
|
+
const ratio = Sun.lightingRatio(state.position, rSun);
|
|
37
|
+
const p = (ratio * SolarRadiationPressure._kRef) / r2;
|
|
38
|
+
const flux = r.scale(p / rMag);
|
|
39
|
+
|
|
40
|
+
return flux.scale(((this.area * this.reflectCoeff) / this.mass) * 1e-3);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { J2000, Moon, Sun, Vector3D } from 'ootk-core';
|
|
19
|
+
import { Force } from './Force';
|
|
20
|
+
|
|
21
|
+
// / Third-body gravity model.
|
|
22
|
+
export class ThirdBodyGravity implements Force {
|
|
23
|
+
// / Create a new [ThirdBodyGravity] object with the selected bodies enabled.
|
|
24
|
+
constructor(public moon: boolean = false, public sun: boolean = false) {
|
|
25
|
+
// Nothing to do here.
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private static _moonGravity(state: J2000): Vector3D {
|
|
29
|
+
const rMoon = Moon.eci(state.epoch);
|
|
30
|
+
const aNum = rMoon.subtract(state.position);
|
|
31
|
+
const aDen = aNum.magnitude() ** 3;
|
|
32
|
+
const bNum = rMoon;
|
|
33
|
+
const bDen = rMoon.magnitude() ** 3;
|
|
34
|
+
const gravity = aNum.scale(1 / aDen).add(bNum.scale(-1 / bDen));
|
|
35
|
+
|
|
36
|
+
return gravity.scale(Moon.mu);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private static _sunGravity(state: J2000): Vector3D {
|
|
40
|
+
const rSun = Sun.positionApparent(state.epoch);
|
|
41
|
+
const aNum = rSun.subtract(state.position);
|
|
42
|
+
const aDen = aNum.magnitude() ** 3;
|
|
43
|
+
const bNum = rSun;
|
|
44
|
+
const bDen = rSun.magnitude() ** 3;
|
|
45
|
+
const gravity = aNum.scale(1 / aDen).add(bNum.scale(-1 / bDen));
|
|
46
|
+
|
|
47
|
+
return gravity.scale(Sun.mu);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
acceleration(state: J2000): Vector3D {
|
|
51
|
+
let accVec = Vector3D.origin;
|
|
52
|
+
|
|
53
|
+
if (this.moon) {
|
|
54
|
+
accVec = accVec.add(ThirdBodyGravity._moonGravity(state));
|
|
55
|
+
}
|
|
56
|
+
if (this.sun) {
|
|
57
|
+
accVec = accVec.add(ThirdBodyGravity._sunGravity(state));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return accVec;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
EpochUTC,
|
|
20
|
+
J2000,
|
|
21
|
+
Kilometers,
|
|
22
|
+
KilometersPerSecond,
|
|
23
|
+
MetersPerSecond,
|
|
24
|
+
RIC,
|
|
25
|
+
Seconds,
|
|
26
|
+
SecondsPerMeterPerSecond,
|
|
27
|
+
Vector3D,
|
|
28
|
+
} from 'ootk-core';
|
|
29
|
+
import { Force } from './Force';
|
|
30
|
+
|
|
31
|
+
// / Thrust force model.
|
|
32
|
+
export class Thrust implements Force {
|
|
33
|
+
constructor(
|
|
34
|
+
public center: EpochUTC,
|
|
35
|
+
public radial: MetersPerSecond,
|
|
36
|
+
public intrack: MetersPerSecond,
|
|
37
|
+
public crosstrack: MetersPerSecond,
|
|
38
|
+
public durationRate = 0.0 as SecondsPerMeterPerSecond,
|
|
39
|
+
) {
|
|
40
|
+
this.deltaV = new Vector3D<KilometersPerSecond>(
|
|
41
|
+
radial * 1e-3 as KilometersPerSecond,
|
|
42
|
+
intrack * 1e-3 as KilometersPerSecond,
|
|
43
|
+
crosstrack * 1e-3 as KilometersPerSecond,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
deltaV: Vector3D<KilometersPerSecond>;
|
|
48
|
+
|
|
49
|
+
get magnitude(): MetersPerSecond {
|
|
50
|
+
return this.deltaV.magnitude() * 1000.0 as MetersPerSecond;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get duration(): Seconds {
|
|
54
|
+
return this.magnitude * this.durationRate as Seconds;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get start(): EpochUTC {
|
|
58
|
+
return this.center.roll(-0.5 * this.duration as Seconds);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get stop(): EpochUTC {
|
|
62
|
+
return this.center.roll(0.5 * this.duration as Seconds);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
acceleration(state: J2000): Vector3D {
|
|
66
|
+
const relative = new RIC(
|
|
67
|
+
Vector3D.origin as Vector3D<Kilometers>,
|
|
68
|
+
this.deltaV.scale(1.0 / this.duration as KilometersPerSecond),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return relative.toJ2000(state).velocity.subtract(state.velocity);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
apply(state: J2000): J2000 {
|
|
75
|
+
const relative = new RIC(Vector3D.origin as Vector3D<Kilometers>, this.deltaV);
|
|
76
|
+
|
|
77
|
+
return relative.toJ2000(state);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get isImpulsive(): boolean {
|
|
81
|
+
return this.duration <= 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
|
+
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
|
+
* software and associated documentation files (the "Software"), to deal in the
|
|
7
|
+
* Software without restriction, including without limitation the rights to use,
|
|
8
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
* the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
* so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
|
13
|
+
* all copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { Degrees, SensorParams } from 'ootk-core';
|
|
25
|
+
|
|
26
|
+
export interface RfSensorParams extends SensorParams {
|
|
27
|
+
coneHalfAngle: Degrees;
|
|
28
|
+
boresightAz: Degrees;
|
|
29
|
+
boresightEl: Degrees;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { RfSensorParams } from './RfSensorParams';
|