ootk 3.0.0 → 4.0.0-1

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.
Files changed (357) hide show
  1. package/CHANGELOG.md +235 -10
  2. package/README.md +27 -40
  3. package/dist/coordinate/Hill.d.ts +49 -0
  4. package/dist/coordinate/Hill.js +222 -0
  5. package/dist/coordinate/Hill.js.map +1 -0
  6. package/dist/coordinate/index.d.ts +1 -0
  7. package/dist/coordinate/index.js +2 -0
  8. package/dist/coordinate/index.js.map +1 -0
  9. package/dist/covariance/CovarianceSample.d.ts +43 -0
  10. package/dist/covariance/CovarianceSample.js +147 -0
  11. package/dist/covariance/CovarianceSample.js.map +1 -0
  12. package/dist/covariance/StateCovariance.d.ts +42 -0
  13. package/dist/covariance/StateCovariance.js +65 -0
  14. package/dist/covariance/StateCovariance.js.map +1 -0
  15. package/dist/force/AtmosphericDrag.d.ts +31 -0
  16. package/dist/force/AtmosphericDrag.js +73 -0
  17. package/dist/force/AtmosphericDrag.js.map +1 -0
  18. package/dist/force/EarthGravity.d.ts +27 -0
  19. package/dist/force/EarthGravity.js +117 -0
  20. package/dist/force/EarthGravity.js.map +1 -0
  21. package/{lib/ootk.d.ts → dist/force/Force.d.ts} +12 -11
  22. package/dist/force/Force.js +31 -0
  23. package/dist/force/Force.js.map +1 -0
  24. package/dist/force/ForceModel.d.ts +37 -0
  25. package/dist/force/ForceModel.js +75 -0
  26. package/dist/force/ForceModel.js.map +1 -0
  27. package/dist/force/Gravity.d.ts +38 -0
  28. package/dist/force/Gravity.js +47 -0
  29. package/dist/force/Gravity.js.map +1 -0
  30. package/dist/{ootk.d.ts → force/SolarRadiationPressure.d.ts} +12 -11
  31. package/dist/force/SolarRadiationPressure.js +44 -0
  32. package/dist/force/SolarRadiationPressure.js.map +1 -0
  33. package/dist/force/ThirdBodyGravity.d.ts +26 -0
  34. package/dist/force/ThirdBodyGravity.js +57 -0
  35. package/dist/force/ThirdBodyGravity.js.map +1 -0
  36. package/dist/force/Thrust.d.ts +34 -0
  37. package/dist/force/Thrust.js +58 -0
  38. package/dist/force/Thrust.js.map +1 -0
  39. package/dist/interfaces/RfSensorParams.d.ts +28 -0
  40. package/dist/interfaces/RfSensorParams.js +24 -0
  41. package/dist/interfaces/RfSensorParams.js.map +1 -0
  42. package/dist/interfaces/index.d.ts +1 -0
  43. package/dist/interfaces/index.js +2 -0
  44. package/dist/interfaces/index.js.map +1 -0
  45. package/dist/interpolator/ChebyshevCoefficients.d.ts +50 -0
  46. package/dist/interpolator/ChebyshevCoefficients.js +94 -0
  47. package/dist/interpolator/ChebyshevCoefficients.js.map +1 -0
  48. package/dist/interpolator/ChebyshevInterpolator.d.ts +38 -0
  49. package/dist/interpolator/ChebyshevInterpolator.js +71 -0
  50. package/dist/interpolator/ChebyshevInterpolator.js.map +1 -0
  51. package/dist/interpolator/CubicSpline.d.ts +35 -0
  52. package/dist/interpolator/CubicSpline.js +69 -0
  53. package/dist/interpolator/CubicSpline.js.map +1 -0
  54. package/dist/interpolator/CubicSplineInterpolator.d.ts +36 -0
  55. package/dist/interpolator/CubicSplineInterpolator.js +80 -0
  56. package/dist/interpolator/CubicSplineInterpolator.js.map +1 -0
  57. package/dist/interpolator/FieldInterpolator.d.ts +28 -0
  58. package/dist/interpolator/FieldInterpolator.js +34 -0
  59. package/dist/interpolator/FieldInterpolator.js.map +1 -0
  60. package/dist/interpolator/Interpolator.d.ts +22 -0
  61. package/dist/interpolator/Interpolator.js +47 -0
  62. package/dist/interpolator/Interpolator.js.map +1 -0
  63. package/dist/interpolator/LagrangeInterpolator.d.ts +40 -0
  64. package/dist/interpolator/LagrangeInterpolator.js +159 -0
  65. package/dist/interpolator/LagrangeInterpolator.js.map +1 -0
  66. package/dist/interpolator/StateInterpolator.d.ts +27 -0
  67. package/dist/interpolator/StateInterpolator.js +35 -0
  68. package/dist/interpolator/StateInterpolator.js.map +1 -0
  69. package/dist/interpolator/VerletBlendInterpolator.d.ts +43 -0
  70. package/dist/interpolator/VerletBlendInterpolator.js +118 -0
  71. package/dist/interpolator/VerletBlendInterpolator.js.map +1 -0
  72. package/{lib/ootk.js → dist/main.d.ts} +13 -10
  73. package/dist/{objects/space-object.d.ts → main.js} +17 -23
  74. package/dist/main.js.map +1 -0
  75. package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +41 -0
  76. package/dist/maneuver/TwoBurnOrbitTransfer.js +65 -0
  77. package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
  78. package/dist/maneuver/Waypoint.d.ts +91 -0
  79. package/dist/maneuver/Waypoint.js +179 -0
  80. package/dist/maneuver/Waypoint.js.map +1 -0
  81. package/{lib/objects/detailed-sat.d.ts → dist/objects/DetailedSatellite.d.ts} +40 -36
  82. package/dist/objects/DetailedSatellite.js +136 -0
  83. package/dist/objects/DetailedSatellite.js.map +1 -0
  84. package/dist/objects/DetailedSensor.d.ts +42 -0
  85. package/dist/objects/DetailedSensor.js +65 -0
  86. package/dist/objects/DetailedSensor.js.map +1 -0
  87. package/dist/objects/LandObject.d.ts +33 -0
  88. package/dist/objects/LandObject.js +34 -0
  89. package/dist/objects/LandObject.js.map +1 -0
  90. package/dist/objects/Marker.d.ts +20 -0
  91. package/dist/objects/Marker.js +24 -0
  92. package/dist/objects/Marker.js.map +1 -0
  93. package/dist/objects/RfSensor.d.ts +41 -0
  94. package/dist/objects/RfSensor.js +67 -0
  95. package/dist/objects/RfSensor.js.map +1 -0
  96. package/dist/objects/index.d.ts +5 -4
  97. package/dist/objects/index.js +6 -0
  98. package/dist/objects/index.js.map +1 -0
  99. package/dist/observation/Observation.d.ts +89 -0
  100. package/dist/observation/Observation.js +102 -0
  101. package/dist/observation/Observation.js.map +1 -0
  102. package/dist/observation/ObservationOptical.d.ts +48 -0
  103. package/dist/observation/ObservationOptical.js +105 -0
  104. package/dist/observation/ObservationOptical.js.map +1 -0
  105. package/dist/observation/ObservationRadar.d.ts +46 -0
  106. package/dist/observation/ObservationRadar.js +96 -0
  107. package/dist/observation/ObservationRadar.js.map +1 -0
  108. package/dist/observation/ObservationUtils.d.ts +20 -0
  109. package/dist/observation/ObservationUtils.js +32 -0
  110. package/dist/observation/ObservationUtils.js.map +1 -0
  111. package/dist/observation/PropagatorPairs.d.ts +32 -0
  112. package/dist/observation/PropagatorPairs.js +43 -0
  113. package/dist/observation/PropagatorPairs.js.map +1 -0
  114. package/dist/operations/BoxMuller.d.ts +46 -0
  115. package/dist/operations/BoxMuller.js +77 -0
  116. package/dist/operations/BoxMuller.js.map +1 -0
  117. package/dist/operations/EulerAngles.d.ts +105 -0
  118. package/dist/operations/EulerAngles.js +161 -0
  119. package/dist/operations/EulerAngles.js.map +1 -0
  120. package/dist/operations/Quaternion.d.ts +56 -0
  121. package/dist/operations/Quaternion.js +167 -0
  122. package/dist/operations/Quaternion.js.map +1 -0
  123. package/dist/operations/RandomGaussianSource.d.ts +24 -0
  124. package/dist/operations/RandomGaussianSource.js +43 -0
  125. package/dist/operations/RandomGaussianSource.js.map +1 -0
  126. package/dist/operations/index.d.ts +4 -0
  127. package/dist/operations/index.js +5 -0
  128. package/dist/operations/index.js.map +1 -0
  129. package/dist/optimize/ChebyshevCompressor.d.ts +32 -0
  130. package/dist/optimize/ChebyshevCompressor.js +83 -0
  131. package/dist/optimize/ChebyshevCompressor.js.map +1 -0
  132. package/dist/optimize/DownhillSimplex.d.ts +64 -0
  133. package/dist/optimize/DownhillSimplex.js +182 -0
  134. package/dist/optimize/DownhillSimplex.js.map +1 -0
  135. package/dist/optimize/GoldenSection.d.ts +39 -0
  136. package/dist/optimize/GoldenSection.js +55 -0
  137. package/dist/optimize/GoldenSection.js.map +1 -0
  138. package/dist/optimize/PolynomialRegression.d.ts +49 -0
  139. package/dist/optimize/PolynomialRegression.js +83 -0
  140. package/dist/optimize/PolynomialRegression.js.map +1 -0
  141. package/dist/optimize/PolynomicalRegressionResult.d.ts +31 -0
  142. package/dist/optimize/PolynomicalRegressionResult.js +38 -0
  143. package/dist/optimize/PolynomicalRegressionResult.js.map +1 -0
  144. package/dist/optimize/SimpleLinearRegression.d.ts +44 -0
  145. package/dist/optimize/SimpleLinearRegression.js +112 -0
  146. package/dist/optimize/SimpleLinearRegression.js.map +1 -0
  147. package/dist/optimize/SimplexEntry.d.ts +32 -0
  148. package/dist/optimize/SimplexEntry.js +42 -0
  149. package/dist/optimize/SimplexEntry.js.map +1 -0
  150. package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +65 -0
  151. package/dist/orbit_determination/BatchLeastSquaresOD.js +143 -0
  152. package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
  153. package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +31 -0
  154. package/{lib/objects/space-object.d.ts → dist/orbit_determination/BatchLeastSquaresResult.js} +21 -23
  155. package/dist/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
  156. package/dist/orbit_determination/GibbsIOD.d.ts +38 -0
  157. package/dist/orbit_determination/GibbsIOD.js +76 -0
  158. package/dist/orbit_determination/GibbsIOD.js.map +1 -0
  159. package/dist/orbit_determination/GoodingIOD.d.ts +51 -0
  160. package/dist/orbit_determination/GoodingIOD.js +247 -0
  161. package/dist/orbit_determination/GoodingIOD.js.map +1 -0
  162. package/dist/orbit_determination/HerrickGibbsIOD.d.ts +33 -0
  163. package/dist/orbit_determination/HerrickGibbsIOD.js +50 -0
  164. package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -0
  165. package/dist/orbit_determination/LambertIOD.d.ts +59 -0
  166. package/dist/orbit_determination/LambertIOD.js +213 -0
  167. package/dist/orbit_determination/LambertIOD.js.map +1 -0
  168. package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +40 -0
  169. package/dist/orbit_determination/ModifiedGoodingIOD.js +83 -0
  170. package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
  171. package/dist/propagator/DormandPrince54Propagator.d.ts +28 -0
  172. package/dist/propagator/DormandPrince54Propagator.js +64 -0
  173. package/dist/propagator/DormandPrince54Propagator.js.map +1 -0
  174. package/dist/propagator/KeplerPropagator.d.ts +35 -0
  175. package/dist/propagator/KeplerPropagator.js +84 -0
  176. package/dist/propagator/KeplerPropagator.js.map +1 -0
  177. package/dist/propagator/Propagator.d.ts +34 -0
  178. package/dist/propagator/Propagator.js +162 -0
  179. package/dist/propagator/Propagator.js.map +1 -0
  180. package/dist/propagator/RkCheckpoint.d.ts +22 -0
  181. package/dist/propagator/RkCheckpoint.js +27 -0
  182. package/dist/propagator/RkCheckpoint.js.map +1 -0
  183. package/dist/propagator/RkResult.d.ts +23 -0
  184. package/dist/propagator/RkResult.js +30 -0
  185. package/dist/propagator/RkResult.js.map +1 -0
  186. package/dist/propagator/RungeKutta4Propagator.d.ts +50 -0
  187. package/dist/propagator/RungeKutta4Propagator.js +141 -0
  188. package/dist/propagator/RungeKutta4Propagator.js.map +1 -0
  189. package/dist/propagator/RungeKutta89Propagator.d.ts +28 -0
  190. package/dist/propagator/RungeKutta89Propagator.js +126 -0
  191. package/dist/propagator/RungeKutta89Propagator.js.map +1 -0
  192. package/dist/propagator/RungeKuttaAdaptive.d.ts +54 -0
  193. package/dist/propagator/RungeKuttaAdaptive.js +159 -0
  194. package/dist/propagator/RungeKuttaAdaptive.js.map +1 -0
  195. package/dist/propagator/Sgp4Propagator.d.ts +34 -0
  196. package/dist/propagator/Sgp4Propagator.js +56 -0
  197. package/dist/propagator/Sgp4Propagator.js.map +1 -0
  198. package/dist/smoothing/ExponentialSmoothing.d.ts +23 -0
  199. package/dist/smoothing/ExponentialSmoothing.js +81 -0
  200. package/dist/smoothing/ExponentialSmoothing.js.map +1 -0
  201. package/dist/transforms/index.d.ts +1 -0
  202. package/dist/transforms/index.js +2 -0
  203. package/dist/transforms/index.js.map +1 -0
  204. package/dist/transforms/transforms.d.ts +56 -92
  205. package/dist/transforms/transforms.js +94 -0
  206. package/dist/transforms/transforms.js.map +1 -0
  207. package/dist/types/types.d.ts +105 -584
  208. package/dist/types/types.js +23 -0
  209. package/dist/types/types.js.map +1 -0
  210. package/dist/utils/index.d.ts +1 -0
  211. package/dist/utils/index.js +2 -0
  212. package/dist/utils/index.js.map +1 -0
  213. package/dist/utils/jacobian.d.ts +11 -0
  214. package/dist/utils/jacobian.js +29 -0
  215. package/dist/utils/jacobian.js.map +1 -0
  216. package/package.json +34 -42
  217. package/src/coordinate/Hill.ts +326 -0
  218. package/src/coordinate/index.ts +1 -0
  219. package/src/covariance/CovarianceSample.ts +194 -0
  220. package/src/covariance/StateCovariance.ts +69 -0
  221. package/src/force/AtmosphericDrag.ts +101 -0
  222. package/src/force/EarthGravity.ts +157 -0
  223. package/src/force/Force.ts +33 -0
  224. package/src/force/ForceModel.ts +91 -0
  225. package/src/force/Gravity.ts +53 -0
  226. package/src/force/SolarRadiationPressure.ts +42 -0
  227. package/src/force/ThirdBodyGravity.ts +62 -0
  228. package/src/force/Thrust.ts +83 -0
  229. package/src/interfaces/RfSensorParams.ts +30 -0
  230. package/src/interfaces/index.ts +1 -0
  231. package/src/interpolator/ChebyshevCoefficients.ts +109 -0
  232. package/src/interpolator/ChebyshevInterpolator.ts +87 -0
  233. package/src/interpolator/CubicSpline.ts +72 -0
  234. package/src/interpolator/CubicSplineInterpolator.ts +90 -0
  235. package/src/interpolator/FieldInterpolator.ts +37 -0
  236. package/src/interpolator/Interpolator.ts +56 -0
  237. package/src/interpolator/LagrangeInterpolator.ts +192 -0
  238. package/src/interpolator/StateInterpolator.ts +39 -0
  239. package/src/interpolator/VerletBlendInterpolator.ts +146 -0
  240. package/src/main.ts +32 -0
  241. package/src/maneuver/TwoBurnOrbitTransfer.ts +79 -0
  242. package/src/maneuver/Waypoint.ts +267 -0
  243. package/src/objects/DetailedSatellite.ts +159 -0
  244. package/src/objects/DetailedSensor.ts +68 -0
  245. package/src/objects/LandObject.ts +46 -0
  246. package/src/objects/Marker.ts +25 -0
  247. package/src/objects/RfSensor.ts +78 -0
  248. package/src/objects/index.ts +5 -0
  249. package/src/observation/Observation.ts +125 -0
  250. package/src/observation/ObservationOptical.ts +146 -0
  251. package/src/observation/ObservationRadar.ts +131 -0
  252. package/src/observation/ObservationUtils.ts +40 -0
  253. package/src/observation/PropagatorPairs.ts +45 -0
  254. package/src/operations/BoxMuller.ts +87 -0
  255. package/src/operations/EulerAngles.ts +183 -0
  256. package/src/operations/Quaternion.ts +222 -0
  257. package/src/operations/RandomGaussianSource.ts +51 -0
  258. package/src/operations/index.ts +4 -0
  259. package/src/optimize/ChebyshevCompressor.ts +96 -0
  260. package/src/optimize/DownhillSimplex.ts +212 -0
  261. package/src/optimize/GoldenSection.ts +71 -0
  262. package/src/optimize/PolynomialRegression.ts +109 -0
  263. package/src/optimize/PolynomicalRegressionResult.ts +32 -0
  264. package/src/optimize/SimpleLinearRegression.ts +127 -0
  265. package/src/optimize/SimplexEntry.ts +50 -0
  266. package/src/orbit_determination/BatchLeastSquaresOD.ts +174 -0
  267. package/src/orbit_determination/BatchLeastSquaresResult.ts +33 -0
  268. package/src/orbit_determination/GibbsIOD.ts +95 -0
  269. package/src/orbit_determination/GoodingIOD.ts +380 -0
  270. package/src/orbit_determination/HerrickGibbsIOD.ts +51 -0
  271. package/src/orbit_determination/LambertIOD.ts +260 -0
  272. package/src/orbit_determination/ModifiedGoodingIOD.ts +133 -0
  273. package/src/propagator/DormandPrince54Propagator.ts +73 -0
  274. package/src/propagator/KeplerPropagator.ts +102 -0
  275. package/src/propagator/Propagator.ts +253 -0
  276. package/src/propagator/RkCheckpoint.ts +25 -0
  277. package/src/propagator/RkResult.ts +26 -0
  278. package/src/propagator/RungeKutta4Propagator.ts +179 -0
  279. package/src/propagator/RungeKutta89Propagator.ts +132 -0
  280. package/src/propagator/RungeKuttaAdaptive.ts +232 -0
  281. package/src/propagator/Sgp4Propagator.ts +71 -0
  282. package/src/smoothing/ExponentialSmoothing.ts +90 -0
  283. package/src/transforms/index.ts +1 -0
  284. package/src/transforms/transforms.ts +117 -0
  285. package/src/types/types.ts +135 -0
  286. package/src/utils/index.ts +1 -0
  287. package/src/utils/jacobian.ts +38 -0
  288. package/.eslintrc.json +0 -244
  289. package/.prettierrc +0 -17
  290. package/babel.config.js +0 -16
  291. package/codecov.yml +0 -21
  292. package/dist/objects/base-object.d.ts +0 -40
  293. package/dist/objects/detailed-sat.d.ts +0 -66
  294. package/dist/objects/sat.d.ts +0 -92
  295. package/dist/objects/sensor.d.ts +0 -93
  296. package/dist/objects/star.d.ts +0 -46
  297. package/dist/ootk.js +0 -2
  298. package/dist/ootk.js.LICENSE.txt +0 -77
  299. package/dist/sgp4/sgp4.d.ts +0 -82
  300. package/dist/tle/tle-format-data.d.ts +0 -6
  301. package/dist/tle/tle.d.ts +0 -375
  302. package/dist/utils/constants.d.ts +0 -34
  303. package/dist/utils/moon-math.d.ts +0 -113
  304. package/dist/utils/sun-math.d.ts +0 -230
  305. package/dist/utils/utils.d.ts +0 -39
  306. package/jest.config.ts +0 -30
  307. package/lib/objects/base-object.d.ts +0 -40
  308. package/lib/objects/base-object.js +0 -79
  309. package/lib/objects/base-object.js.map +0 -1
  310. package/lib/objects/detailed-sat.js +0 -149
  311. package/lib/objects/detailed-sat.js.map +0 -1
  312. package/lib/objects/index.d.ts +0 -4
  313. package/lib/objects/index.js +0 -5
  314. package/lib/objects/index.js.map +0 -1
  315. package/lib/objects/sat.d.ts +0 -92
  316. package/lib/objects/sat.js +0 -188
  317. package/lib/objects/sat.js.map +0 -1
  318. package/lib/objects/sensor.d.ts +0 -93
  319. package/lib/objects/sensor.js +0 -273
  320. package/lib/objects/sensor.js.map +0 -1
  321. package/lib/objects/space-object.js +0 -60
  322. package/lib/objects/space-object.js.map +0 -1
  323. package/lib/objects/star.d.ts +0 -46
  324. package/lib/objects/star.js +0 -91
  325. package/lib/objects/star.js.map +0 -1
  326. package/lib/ootk.js.map +0 -1
  327. package/lib/sgp4/sgp4.d.ts +0 -82
  328. package/lib/sgp4/sgp4.js +0 -3262
  329. package/lib/sgp4/sgp4.js.map +0 -1
  330. package/lib/tle/tle-format-data.d.ts +0 -6
  331. package/lib/tle/tle-format-data.js +0 -10
  332. package/lib/tle/tle-format-data.js.map +0 -1
  333. package/lib/tle/tle.d.ts +0 -375
  334. package/lib/tle/tle.js +0 -611
  335. package/lib/tle/tle.js.map +0 -1
  336. package/lib/transforms/transforms.d.ts +0 -94
  337. package/lib/transforms/transforms.js +0 -308
  338. package/lib/transforms/transforms.js.map +0 -1
  339. package/lib/types/types.d.ts +0 -605
  340. package/lib/types/types.js +0 -36
  341. package/lib/types/types.js.map +0 -1
  342. package/lib/utils/constants.d.ts +0 -34
  343. package/lib/utils/constants.js +0 -35
  344. package/lib/utils/constants.js.map +0 -1
  345. package/lib/utils/moon-math.d.ts +0 -113
  346. package/lib/utils/moon-math.js +0 -387
  347. package/lib/utils/moon-math.js.map +0 -1
  348. package/lib/utils/sun-math.d.ts +0 -230
  349. package/lib/utils/sun-math.js +0 -422
  350. package/lib/utils/sun-math.js.map +0 -1
  351. package/lib/utils/utils.d.ts +0 -39
  352. package/lib/utils/utils.js +0 -102
  353. package/lib/utils/utils.js.map +0 -1
  354. package/sandbox.html +0 -8
  355. package/tsconfig.base.json +0 -31
  356. package/tsconfig.build.json +0 -14
  357. /package/{LICENSE.MD → LICENSE.md} +0 -0
@@ -0,0 +1,118 @@
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
+ import { copySign, Earth, EpochWindow, J2000, } from 'ootk-core';
18
+ import { CubicSplineInterpolator } from './CubicSplineInterpolator';
19
+ import { LagrangeInterpolator } from './LagrangeInterpolator';
20
+ import { StateInterpolator } from './StateInterpolator';
21
+ /**
22
+ * Two-body Velocity Verlet Blend interpolator.
23
+ *
24
+ * The [VerletBlendInterpolator] retains the original ephemerides, so the
25
+ * original _"truth"_ states can be retrieved if needed without imparting any
26
+ * additional error, so this can be used to build other interpolator types.
27
+ * The implementation is simple and very tolerant when working with sparse
28
+ * ephemerides.
29
+ */
30
+ export class VerletBlendInterpolator extends StateInterpolator {
31
+ ephemeris;
32
+ constructor(ephemeris) {
33
+ super();
34
+ this.ephemeris = ephemeris;
35
+ }
36
+ get sizeBytes() {
37
+ return (64 * 7 * this.ephemeris.length) / 8;
38
+ }
39
+ window() {
40
+ return new EpochWindow(this.ephemeris[0].epoch, this.ephemeris[this.ephemeris.length - 1].epoch);
41
+ }
42
+ static getClosest_(target, s1, s2) {
43
+ return target - s1.epoch.posix >= s2.epoch.posix - target ? s2 : s1;
44
+ }
45
+ matchState_(epoch) {
46
+ const target = epoch.posix;
47
+ if (target <= this.ephemeris[0].epoch.posix) {
48
+ return this.ephemeris[0];
49
+ }
50
+ if (target >= this.ephemeris[this.ephemeris.length - 1].epoch.posix) {
51
+ return this.ephemeris[this.ephemeris.length - 1];
52
+ }
53
+ let i = 0;
54
+ let j = this.ephemeris.length;
55
+ let mid = 0;
56
+ while (i < j) {
57
+ mid = (i + j) >> 1;
58
+ if (this.ephemeris[mid].epoch.posix === target) {
59
+ return this.ephemeris[mid];
60
+ }
61
+ if (target < this.ephemeris[mid].epoch.posix) {
62
+ if (mid > 0 && target > this.ephemeris[mid - 1].epoch.posix) {
63
+ return VerletBlendInterpolator.getClosest_(target, this.ephemeris[mid - 1], this.ephemeris[mid]);
64
+ }
65
+ j = mid;
66
+ }
67
+ else {
68
+ if (mid < this.ephemeris.length - 1 && target < this.ephemeris[mid + 1].epoch.posix) {
69
+ return VerletBlendInterpolator.getClosest_(target, this.ephemeris[mid], this.ephemeris[mid + 1]);
70
+ }
71
+ i = mid + 1;
72
+ }
73
+ }
74
+ return this.ephemeris[mid];
75
+ }
76
+ static _gravity(position) {
77
+ const r = position.magnitude();
78
+ return position.scale(-Earth.mu / (r * r * r));
79
+ }
80
+ static integrate_(state, step) {
81
+ const x0 = state.position;
82
+ const a0 = VerletBlendInterpolator._gravity(x0);
83
+ const v0 = state.velocity;
84
+ const x1 = x0
85
+ .add(v0.scale(step))
86
+ .add(a0.scale(0.5 * step * step));
87
+ const a1 = VerletBlendInterpolator._gravity(x1);
88
+ const v1 = v0
89
+ .add(a0.add(a1).scale(0.5 * step));
90
+ return new J2000(state.epoch.roll(step), x1, v1);
91
+ }
92
+ interpolate(epoch) {
93
+ if (!this.inWindow(epoch)) {
94
+ return null;
95
+ }
96
+ let state = this.matchState_(epoch);
97
+ while (state.epoch.posix !== epoch.posix) {
98
+ const delta = epoch.posix - state.epoch.posix;
99
+ const stepMag = Math.min(5.0, Math.abs(delta));
100
+ const stepSize = copySign(stepMag, delta);
101
+ state = VerletBlendInterpolator.integrate_(state, stepSize);
102
+ }
103
+ return state;
104
+ }
105
+ getCachedState(epoch) {
106
+ if (!this.inWindow(epoch)) {
107
+ return null;
108
+ }
109
+ return this.matchState_(epoch);
110
+ }
111
+ toCubicSpline() {
112
+ return CubicSplineInterpolator.fromEphemeris(this.ephemeris);
113
+ }
114
+ toLagrange(order = 10) {
115
+ return LagrangeInterpolator.fromEphemeris(this.ephemeris, order);
116
+ }
117
+ }
118
+ //# sourceMappingURL=VerletBlendInterpolator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerletBlendInterpolator.js","sourceRoot":"","sources":["../../src/interpolator/VerletBlendInterpolator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,QAAQ,EACR,KAAK,EAEL,WAAW,EACX,KAAK,GAKN,MAAM,WAAW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AAW,CAAC,KAAK,CAAC,CAAC;QAEpC,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE;YACxC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;YAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;YAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAY,CAAC;YAErD,KAAK,GAAG,uBAAuB,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;SAC7D;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,cAAc,CAAC,KAAe;QAC5B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACzB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,aAAa;QACX,OAAO,uBAAuB,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED,UAAU,CAAC,KAAK,GAAG,EAAE;QACnB,OAAO,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;CACF"}
@@ -1,10 +1,12 @@
1
1
  /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
2
+ * @author @thkruz Theodore Kruczek
3
+ * @description Orbital Object ToolKit (ootk) is a collection of tools for working
4
4
  * with satellites and other orbital objects.
5
- *
6
5
  * @license AGPL-3.0-or-later
7
- * @Copyright (c) 2020-2023 Theodore Kruczek
6
+ * @copyright (c) 2020-2024 Theodore Kruczek
7
+ *
8
+ * Many of the classes are based off of the work of @david-rc-dayton and his
9
+ * Pious Squid library (https://github.com/david-rc-dayton/pious_squid).
8
10
  *
9
11
  * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
10
12
  * terms of the GNU Affero General Public License as published by the Free Software
@@ -17,10 +19,11 @@
17
19
  * You should have received a copy of the GNU Affero General Public License along with
18
20
  * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
19
21
  */
20
- export { Sgp4 } from './sgp4/sgp4';
21
- export { Transforms } from './transforms/transforms';
22
- export { Utils } from './utils/utils';
23
- export { Tle } from './tle/tle';
24
- export * from './objects/index';
22
+ export * from 'ootk-core';
23
+ export * from './coordinate';
24
+ export * from './objects';
25
+ export * from './operations';
26
+ export * from './transforms';
27
+ export * from './interfaces';
25
28
  export * from './types/types';
26
- //# sourceMappingURL=ootk.js.map
29
+ export * from './utils';
@@ -1,13 +1,12 @@
1
1
  /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
2
+ * @author @thkruz Theodore Kruczek
3
+ * @description Orbital Object ToolKit (ootk) is a collection of tools for working
4
4
  * with satellites and other orbital objects.
5
- *
6
- * @file The SpaceObject class is meant to provide properties to satellites/stars that
7
- * do not apply to ground based objects.
8
- *
9
5
  * @license AGPL-3.0-or-later
10
- * @Copyright (c) 2020-2023 Theodore Kruczek
6
+ * @copyright (c) 2020-2024 Theodore Kruczek
7
+ *
8
+ * Many of the classes are based off of the work of @david-rc-dayton and his
9
+ * Pious Squid library (https://github.com/david-rc-dayton/pious_squid).
11
10
  *
12
11
  * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
13
12
  * terms of the GNU Affero General Public License as published by the Free Software
@@ -20,19 +19,14 @@
20
19
  * You should have received a copy of the GNU Affero General Public License along with
21
20
  * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
22
21
  */
23
- import { BaseObject } from './base-object';
24
- import { SpaceObjectType } from '../types/types';
25
- interface ObjectInfo {
26
- name?: string;
27
- type?: SpaceObjectType;
28
- rcs?: number;
29
- vmag?: number;
30
- }
31
- export declare class SpaceObject extends BaseObject {
32
- rcs: number;
33
- vmag: number;
34
- constructor(info: ObjectInfo);
35
- getRcs(): number;
36
- getVmag(): number;
37
- }
38
- export {};
22
+ export * from 'ootk-core';
23
+ export * from './coordinate';
24
+ export * from './objects';
25
+ export * from './operations';
26
+ export * from './transforms';
27
+ export * from './interfaces';
28
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
29
+ // @ts-ignore
30
+ export * from './types/types';
31
+ export * from './utils';
32
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,6DAA6D;AAC7D,aAAa;AACb,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,41 @@
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
+ import { EpochUTC, Seconds, SecondsPerMeterPerSecond } from 'ootk-core';
18
+ import { Thrust } from '../force/Thrust';
19
+ export declare class TwoBurnOrbitTransfer {
20
+ vInit: number;
21
+ vFinal: number;
22
+ vTransA: number;
23
+ vTransB: number;
24
+ tTrans: Seconds;
25
+ constructor(vInit: number, vFinal: number, vTransA: number, vTransB: number, tTrans: Seconds);
26
+ /**
27
+ * Calculates the parameters for a Hohmann transfer orbit between two circular orbits.
28
+ * @param rInit The initial radius of the orbit. (km)
29
+ * @param rFinal The final radius of the orbit. (km)
30
+ * @returns An instance of TwoBurnOrbitTransfer containing the calculated parameters.
31
+ */
32
+ static hohmannTransfer(rInit: number, rFinal: number): TwoBurnOrbitTransfer;
33
+ get deltaV(): number;
34
+ /**
35
+ * Calculates the two maneuver thrusts required for a two-burn orbit transfer.
36
+ * @param epoch The epoch of the maneuver.
37
+ * @param durationRate The duration rate of the maneuver (s/m/s).
38
+ * @returns An array containing the two thrust objects representing the maneuvers.
39
+ */
40
+ toManeuvers(epoch: EpochUTC, durationRate?: SecondsPerMeterPerSecond): [Thrust, Thrust];
41
+ }
@@ -0,0 +1,65 @@
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
+ import { Earth } from 'ootk-core';
18
+ import { Thrust } from '../force/Thrust';
19
+ // / Container for a two-burn orbit transfer.
20
+ export class TwoBurnOrbitTransfer {
21
+ vInit;
22
+ vFinal;
23
+ vTransA;
24
+ vTransB;
25
+ tTrans;
26
+ // / Create a new [TwoBurnOrbitTransfer] object.
27
+ constructor(vInit, vFinal, vTransA, vTransB, tTrans) {
28
+ this.vInit = vInit;
29
+ this.vFinal = vFinal;
30
+ this.vTransA = vTransA;
31
+ this.vTransB = vTransB;
32
+ this.tTrans = tTrans;
33
+ // Nothing to do here.
34
+ }
35
+ /**
36
+ * Calculates the parameters for a Hohmann transfer orbit between two circular orbits.
37
+ * @param rInit The initial radius of the orbit. (km)
38
+ * @param rFinal The final radius of the orbit. (km)
39
+ * @returns An instance of TwoBurnOrbitTransfer containing the calculated parameters.
40
+ */
41
+ static hohmannTransfer(rInit, rFinal) {
42
+ const vInit = Math.sqrt(Earth.mu / rInit);
43
+ const vFinal = Math.sqrt(Earth.mu / rFinal);
44
+ const vTransA = vInit * (Math.sqrt((2.0 * rFinal) / (rInit + rFinal)) - 1.0);
45
+ const vTransB = vFinal * (1.0 - Math.sqrt((2 * rInit) / (rInit + rFinal)));
46
+ const tTrans = Math.PI * Math.sqrt((rInit + rFinal) ** 3 / (8.0 * Earth.mu));
47
+ return new TwoBurnOrbitTransfer(vInit, vFinal, vTransA, vTransB, tTrans);
48
+ }
49
+ // / Return the total delta-velocity magnitude for both maneuvers _(km/s)_.
50
+ get deltaV() {
51
+ return Math.abs(this.vTransA) + Math.abs(this.vTransB);
52
+ }
53
+ /**
54
+ * Calculates the two maneuver thrusts required for a two-burn orbit transfer.
55
+ * @param epoch The epoch of the maneuver.
56
+ * @param durationRate The duration rate of the maneuver (s/m/s).
57
+ * @returns An array containing the two thrust objects representing the maneuvers.
58
+ */
59
+ toManeuvers(epoch, durationRate = 0.0) {
60
+ const mA = new Thrust(epoch, 0.0, this.vTransA * 1000.0, 0.0, durationRate);
61
+ const mB = new Thrust(epoch.roll(this.tTrans), 0.0, this.vTransB * 1000.0, 0.0, durationRate);
62
+ return [mA, mB];
63
+ }
64
+ }
65
+ //# sourceMappingURL=TwoBurnOrbitTransfer.js.map
@@ -0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AC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC,CAAY,CAAC;QAExF,OAAO,IAAI,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;IAED,2EAA2E;IAC3E,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,KAAe,EAAE,eAAe,GAA+B;QACzE,MAAM,EAAE,GAAG,IAAI,MAAM,CACnB,KAAK,EACL,GAAsB,EACtB,IAAI,CAAC,OAAO,GAAG,MAAyB,EACxC,GAAsB,EACtB,YAAY,CACb,CAAC;QACF,MAAM,EAAE,GAAG,IAAI,MAAM,CACnB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EACvB,GAAsB,EACtB,IAAI,CAAC,OAAO,GAAG,MAAyB,EACxC,GAAsB,EACtB,YAAY,CACb,CAAC;QAEF,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAClB,CAAC;CACF"}
@@ -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
+ import { EpochUTC, J2000, Kilometers, Vector3D } from 'ootk-core';
18
+ import { Thrust } from '../force/Thrust';
19
+ import { StateInterpolator } from '../interpolator/StateInterpolator';
20
+ import { ForceModel } from './../force/ForceModel';
21
+ export declare class Waypoint {
22
+ epoch: EpochUTC;
23
+ relativePosition: Vector3D<Kilometers>;
24
+ constructor(epoch: EpochUTC, relativePosition: Vector3D<Kilometers>);
25
+ /**
26
+ * Return the perturbed error in a [maneuver] when compared against the
27
+ * target [waypoint] given an initial [state], [forceModel],
28
+ * [target] interpolator, and speculative relative maneuver
29
+ * [components] _(m/s)_.
30
+ * @param waypoint The waypoint to target.
31
+ * @param maneuver The maneuver to perturb.
32
+ * @param state The initial state of the interceptor.
33
+ * @param forceModel The force model to use for propagation.
34
+ * @param target The target interpolator.
35
+ * @param components The speculative maneuver components.
36
+ * @returns The perturbed error in the maneuver.
37
+ */
38
+ static _error(waypoint: Waypoint, maneuver: Thrust, state: J2000, forceModel: ForceModel, target: StateInterpolator, components: Float64Array): number;
39
+ /**
40
+ * Generate a score function for refining perturbed [waypoint] maneuvers.
41
+ *
42
+ * The score function takes an array of speculative radial, intrack, and
43
+ * crosstrack components _(m/s)_ and returns the propagated error from the
44
+ * desired waypoint target.
45
+ * @param waypoint The waypoint to target.
46
+ * @param maneuver The maneuver to perturb.
47
+ * @param state The initial state of the interceptor.
48
+ * @param forceModel The force model to use for propagation.
49
+ * @param target The target interpolator.
50
+ * @returns A score function for refining maneuvers.
51
+ */
52
+ static _refineManeuverScore(waypoint: Waypoint, maneuver: Thrust, state: J2000, forceModel: ForceModel, target: StateInterpolator): (components: Float64Array) => number;
53
+ /**
54
+ * Convert an array of [waypoints] into a maneuver sequence given an
55
+ * [interceptor] state, [pivot] epoch for the first burn to arrive at the
56
+ * first waypoint, and [target] ephemeris interpolator.
57
+ *
58
+ * Optional arguments are as follows:
59
+ * - `preManeuvers`: maneuvers to execute before the pivot burn
60
+ * - `postManeuvers`: maneuvers to execute after the last pivot burn
61
+ * - `durationRate`: thruster duration rate _(s/m/s)_
62
+ * - `forceModel`: interceptor force model, defaults to two-body
63
+ * - `refine`: refine maneuvers to account for perturbations if `true`
64
+ * - `maxIter`: maximum refinement iterations per maneuver
65
+ * - `printIter`: print debug information on each refinement iteration
66
+ * @param interceptor The interceptor state.
67
+ * @param pivot The epoch of the first burn.
68
+ * @param waypoints The waypoints to target.
69
+ * @param target The target interpolator.
70
+ * @param preManeuvers The maneuvers to execute before the pivot burn.
71
+ * @param postManeuvers The maneuvers to execute after the last pivot burn.
72
+ * @param root0 The optional arguments.
73
+ * @param root0.durationRate The thruster duration rate.
74
+ * @param root0.forceModel The interceptor force model.
75
+ * @param root0.refine Whether to refine maneuvers to account for perturbations.
76
+ * @param root0.maxIter The maximum refinement iterations per maneuver.
77
+ * @param root0.printIter Whether to print debug information on each refinement iteration.
78
+ * @returns An array of maneuvers.
79
+ */
80
+ static toManeuvers(interceptor: J2000, pivot: EpochUTC, waypoints: Waypoint[], target: StateInterpolator, preManeuvers: Thrust[] | null, postManeuvers: Thrust[] | null, { durationRate, forceModel, refine, maxIter, printIter, }?: {
81
+ durationRate?: number;
82
+ forceModel?: ForceModel;
83
+ refine?: boolean;
84
+ maxIter?: number;
85
+ printIter?: boolean;
86
+ }): Thrust[];
87
+ static _refineManeuvers(waypoints: Waypoint[], maneuvers: Thrust[], interceptor: J2000, forceModel: ForceModel, target: StateInterpolator, { maxIter, printIter, }?: {
88
+ maxIter?: number;
89
+ printIter?: boolean;
90
+ }): Thrust[];
91
+ }
@@ -0,0 +1,179 @@
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
+ import { RIC, Vector3D, } from 'ootk-core';
18
+ import { Thrust } from '../force/Thrust';
19
+ import { ForceModel } from './../force/ForceModel';
20
+ import { DownhillSimplex } from './../optimize/DownhillSimplex';
21
+ import { LambertIOD } from './../orbit_determination/LambertIOD';
22
+ import { RungeKutta89Propagator } from './../propagator/RungeKutta89Propagator';
23
+ // / Relative waypoint targeting.
24
+ export class Waypoint {
25
+ epoch;
26
+ relativePosition;
27
+ // / Create a new [Waypoint] object.
28
+ constructor(epoch, relativePosition) {
29
+ this.epoch = epoch;
30
+ this.relativePosition = relativePosition;
31
+ }
32
+ /**
33
+ * Return the perturbed error in a [maneuver] when compared against the
34
+ * target [waypoint] given an initial [state], [forceModel],
35
+ * [target] interpolator, and speculative relative maneuver
36
+ * [components] _(m/s)_.
37
+ * @param waypoint The waypoint to target.
38
+ * @param maneuver The maneuver to perturb.
39
+ * @param state The initial state of the interceptor.
40
+ * @param forceModel The force model to use for propagation.
41
+ * @param target The target interpolator.
42
+ * @param components The speculative maneuver components.
43
+ * @returns The perturbed error in the maneuver.
44
+ */
45
+ static _error(waypoint, maneuver, state, forceModel, target, components) {
46
+ const testManeuver = new Thrust(maneuver.center, components[0], components[1], components[2], maneuver.durationRate);
47
+ const propagator = new RungeKutta89Propagator(state, forceModel);
48
+ const maneuverSteps = propagator.maneuver(testManeuver);
49
+ const postManeuver = maneuverSteps[maneuverSteps.length - 1];
50
+ const interceptor = new RungeKutta89Propagator(postManeuver, forceModel).propagate(waypoint.epoch);
51
+ const targetState = target.interpolate(waypoint.epoch);
52
+ if (targetState === null) {
53
+ throw new Error('Error calculation failed; epoch is outside the target interpolator ephemeris window.');
54
+ }
55
+ const expected = waypoint.relativePosition;
56
+ const actual = RIC.fromJ2000(interceptor, targetState);
57
+ return actual.position.distance(expected);
58
+ }
59
+ /**
60
+ * Generate a score function for refining perturbed [waypoint] maneuvers.
61
+ *
62
+ * The score function takes an array of speculative radial, intrack, and
63
+ * crosstrack components _(m/s)_ and returns the propagated error from the
64
+ * desired waypoint target.
65
+ * @param waypoint The waypoint to target.
66
+ * @param maneuver The maneuver to perturb.
67
+ * @param state The initial state of the interceptor.
68
+ * @param forceModel The force model to use for propagation.
69
+ * @param target The target interpolator.
70
+ * @returns A score function for refining maneuvers.
71
+ */
72
+ static _refineManeuverScore(waypoint, maneuver, state, forceModel, target) {
73
+ return (components) => Waypoint._error(waypoint, maneuver, state, forceModel, target, components);
74
+ }
75
+ /**
76
+ * Convert an array of [waypoints] into a maneuver sequence given an
77
+ * [interceptor] state, [pivot] epoch for the first burn to arrive at the
78
+ * first waypoint, and [target] ephemeris interpolator.
79
+ *
80
+ * Optional arguments are as follows:
81
+ * - `preManeuvers`: maneuvers to execute before the pivot burn
82
+ * - `postManeuvers`: maneuvers to execute after the last pivot burn
83
+ * - `durationRate`: thruster duration rate _(s/m/s)_
84
+ * - `forceModel`: interceptor force model, defaults to two-body
85
+ * - `refine`: refine maneuvers to account for perturbations if `true`
86
+ * - `maxIter`: maximum refinement iterations per maneuver
87
+ * - `printIter`: print debug information on each refinement iteration
88
+ * @param interceptor The interceptor state.
89
+ * @param pivot The epoch of the first burn.
90
+ * @param waypoints The waypoints to target.
91
+ * @param target The target interpolator.
92
+ * @param preManeuvers The maneuvers to execute before the pivot burn.
93
+ * @param postManeuvers The maneuvers to execute after the last pivot burn.
94
+ * @param root0 The optional arguments.
95
+ * @param root0.durationRate The thruster duration rate.
96
+ * @param root0.forceModel The interceptor force model.
97
+ * @param root0.refine Whether to refine maneuvers to account for perturbations.
98
+ * @param root0.maxIter The maximum refinement iterations per maneuver.
99
+ * @param root0.printIter Whether to print debug information on each refinement iteration.
100
+ * @returns An array of maneuvers.
101
+ */
102
+ static toManeuvers(interceptor, pivot, waypoints, target, preManeuvers, postManeuvers, { durationRate = 0.0, forceModel, refine = false, maxIter = 500, printIter = false, } = {}) {
103
+ const preMnv = preManeuvers ?? [];
104
+ const postMnv = postManeuvers ?? [];
105
+ let state = interceptor;
106
+ if (preMnv.length > 0) {
107
+ for (const maneuver of preMnv) {
108
+ const mvrStep = new RungeKutta89Propagator(state, forceModel).maneuver(maneuver);
109
+ state = mvrStep[mvrStep.length - 1];
110
+ }
111
+ }
112
+ state = new RungeKutta89Propagator(state, forceModel).propagate(pivot);
113
+ const pivotState = state;
114
+ let waypointManeuvers = [];
115
+ for (const wp of waypoints) {
116
+ const targetWp = new RIC(wp.relativePosition, Vector3D.origin);
117
+ const targetState = target.interpolate(wp.epoch);
118
+ if (targetState === null) {
119
+ throw new Error('Waypoint outside target interpolator window.');
120
+ }
121
+ const wpState = targetWp.toJ2000(targetState);
122
+ const tof = wp.epoch.difference(state.epoch);
123
+ const revs = Math.floor(tof / state.period);
124
+ const shortPath = LambertIOD.useShortPath(state, targetState);
125
+ const lambert = new LambertIOD();
126
+ const components = lambert.estimate(state.position, wpState.position, state.epoch, wp.epoch, {
127
+ posigrade: shortPath,
128
+ nRev: revs,
129
+ });
130
+ if (components === null) {
131
+ throw new Error('Lambert solve result is null.');
132
+ }
133
+ const componentsRel = RIC.fromJ2000(components, state).velocity.scale(1e3);
134
+ const maneuver = new Thrust(state.epoch, componentsRel.x, componentsRel.y, componentsRel.z, durationRate);
135
+ const tempProp = new RungeKutta89Propagator(state, forceModel);
136
+ tempProp.maneuver(maneuver);
137
+ state = tempProp.propagate(wp.epoch);
138
+ waypointManeuvers.push(maneuver);
139
+ }
140
+ if (refine) {
141
+ forceModel ??= new ForceModel().setGravity();
142
+ waypointManeuvers = this._refineManeuvers(waypoints, waypointManeuvers, pivotState, forceModel, target, {
143
+ maxIter,
144
+ printIter,
145
+ });
146
+ }
147
+ const output = [];
148
+ output.push(...preMnv);
149
+ output.push(...waypointManeuvers);
150
+ output.push(...postMnv);
151
+ return output;
152
+ }
153
+ static _refineManeuvers(waypoints, maneuvers, interceptor, forceModel, target, { maxIter = 500, printIter = false, } = {}) {
154
+ let state = interceptor;
155
+ const output = [];
156
+ for (let i = 0; i < maneuvers.length; i++) {
157
+ const maneuver = maneuvers[i];
158
+ const waypoint = waypoints[i];
159
+ const guess = maneuver.deltaV.scale(1e3).toArray();
160
+ const simplex = DownhillSimplex.generateSimplex(guess, 1e-1);
161
+ const scoreFn = this._refineManeuverScore(waypoint, maneuver, state, forceModel, target);
162
+ const results = DownhillSimplex.solveSimplex(scoreFn, simplex, {
163
+ maxIter,
164
+ xTolerance: 1e-6,
165
+ fTolerance: 1e-6,
166
+ printIter,
167
+ });
168
+ const tR = results[0];
169
+ const tI = results[1];
170
+ const tC = results[2];
171
+ const newManeuver = new Thrust(maneuver.center, tR, tI, tC, maneuver.durationRate);
172
+ output.push(newManeuver);
173
+ const mvrStep = new RungeKutta89Propagator(state, forceModel).maneuver(newManeuver);
174
+ state = mvrStep[mvrStep.length - 1];
175
+ }
176
+ return output;
177
+ }
178
+ }
179
+ //# sourceMappingURL=Waypoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Waypoint.js","sourceRoot":"","sources":["../../src/maneuver/Waypoint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAML,GAAG,EAEH,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,iCAAiC;AACjC,MAAM,OAAO,QAA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