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.
- package/CHANGELOG.md +235 -10
- package/README.md +27 -40
- package/dist/coordinate/Hill.d.ts +49 -0
- package/dist/coordinate/Hill.js +222 -0
- package/dist/coordinate/Hill.js.map +1 -0
- package/dist/coordinate/index.d.ts +1 -0
- package/dist/coordinate/index.js +2 -0
- package/dist/coordinate/index.js.map +1 -0
- package/dist/covariance/CovarianceSample.d.ts +43 -0
- package/dist/covariance/CovarianceSample.js +147 -0
- package/dist/covariance/CovarianceSample.js.map +1 -0
- package/dist/covariance/StateCovariance.d.ts +42 -0
- package/dist/covariance/StateCovariance.js +65 -0
- package/dist/covariance/StateCovariance.js.map +1 -0
- package/dist/force/AtmosphericDrag.d.ts +31 -0
- package/dist/force/AtmosphericDrag.js +73 -0
- package/dist/force/AtmosphericDrag.js.map +1 -0
- package/dist/force/EarthGravity.d.ts +27 -0
- package/dist/force/EarthGravity.js +117 -0
- package/dist/force/EarthGravity.js.map +1 -0
- package/{lib/ootk.d.ts → dist/force/Force.d.ts} +12 -11
- package/dist/force/Force.js +31 -0
- package/dist/force/Force.js.map +1 -0
- package/dist/force/ForceModel.d.ts +37 -0
- package/dist/force/ForceModel.js +75 -0
- package/dist/force/ForceModel.js.map +1 -0
- package/dist/force/Gravity.d.ts +38 -0
- package/dist/force/Gravity.js +47 -0
- package/dist/force/Gravity.js.map +1 -0
- package/dist/{ootk.d.ts → force/SolarRadiationPressure.d.ts} +12 -11
- package/dist/force/SolarRadiationPressure.js +44 -0
- package/dist/force/SolarRadiationPressure.js.map +1 -0
- package/dist/force/ThirdBodyGravity.d.ts +26 -0
- package/dist/force/ThirdBodyGravity.js +57 -0
- package/dist/force/ThirdBodyGravity.js.map +1 -0
- package/dist/force/Thrust.d.ts +34 -0
- package/dist/force/Thrust.js +58 -0
- 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/dist/interpolator/ChebyshevCoefficients.d.ts +50 -0
- package/dist/interpolator/ChebyshevCoefficients.js +94 -0
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -0
- package/dist/interpolator/ChebyshevInterpolator.d.ts +38 -0
- package/dist/interpolator/ChebyshevInterpolator.js +71 -0
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -0
- package/dist/interpolator/CubicSpline.d.ts +35 -0
- package/dist/interpolator/CubicSpline.js +69 -0
- package/dist/interpolator/CubicSpline.js.map +1 -0
- package/dist/interpolator/CubicSplineInterpolator.d.ts +36 -0
- package/dist/interpolator/CubicSplineInterpolator.js +80 -0
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -0
- package/dist/interpolator/FieldInterpolator.d.ts +28 -0
- package/dist/interpolator/FieldInterpolator.js +34 -0
- package/dist/interpolator/FieldInterpolator.js.map +1 -0
- package/dist/interpolator/Interpolator.d.ts +22 -0
- package/dist/interpolator/Interpolator.js +47 -0
- package/dist/interpolator/Interpolator.js.map +1 -0
- package/dist/interpolator/LagrangeInterpolator.d.ts +40 -0
- package/dist/interpolator/LagrangeInterpolator.js +159 -0
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -0
- package/dist/interpolator/StateInterpolator.d.ts +27 -0
- package/dist/interpolator/StateInterpolator.js +35 -0
- package/dist/interpolator/StateInterpolator.js.map +1 -0
- package/dist/interpolator/VerletBlendInterpolator.d.ts +43 -0
- package/dist/interpolator/VerletBlendInterpolator.js +118 -0
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -0
- package/{lib/ootk.js → dist/main.d.ts} +13 -10
- package/dist/{objects/space-object.d.ts → main.js} +17 -23
- package/dist/main.js.map +1 -0
- package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +41 -0
- package/dist/maneuver/TwoBurnOrbitTransfer.js +65 -0
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
- package/dist/maneuver/Waypoint.d.ts +91 -0
- package/dist/maneuver/Waypoint.js +179 -0
- package/dist/maneuver/Waypoint.js.map +1 -0
- package/{lib/objects/detailed-sat.d.ts → dist/objects/DetailedSatellite.d.ts} +40 -36
- package/dist/objects/DetailedSatellite.js +136 -0
- package/dist/objects/DetailedSatellite.js.map +1 -0
- package/dist/objects/DetailedSensor.d.ts +42 -0
- package/dist/objects/DetailedSensor.js +65 -0
- package/dist/objects/DetailedSensor.js.map +1 -0
- package/dist/objects/LandObject.d.ts +33 -0
- package/dist/objects/LandObject.js +34 -0
- package/dist/objects/LandObject.js.map +1 -0
- package/dist/objects/Marker.d.ts +20 -0
- package/dist/objects/Marker.js +24 -0
- 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/dist/objects/index.d.ts +5 -4
- package/dist/objects/index.js +6 -0
- package/dist/objects/index.js.map +1 -0
- package/dist/observation/Observation.d.ts +89 -0
- package/dist/observation/Observation.js +102 -0
- package/dist/observation/Observation.js.map +1 -0
- package/dist/observation/ObservationOptical.d.ts +48 -0
- package/dist/observation/ObservationOptical.js +105 -0
- package/dist/observation/ObservationOptical.js.map +1 -0
- package/dist/observation/ObservationRadar.d.ts +46 -0
- package/dist/observation/ObservationRadar.js +96 -0
- package/dist/observation/ObservationRadar.js.map +1 -0
- package/dist/observation/ObservationUtils.d.ts +20 -0
- package/dist/observation/ObservationUtils.js +32 -0
- package/dist/observation/ObservationUtils.js.map +1 -0
- package/dist/observation/PropagatorPairs.d.ts +32 -0
- package/dist/observation/PropagatorPairs.js +43 -0
- package/dist/observation/PropagatorPairs.js.map +1 -0
- package/dist/operations/BoxMuller.d.ts +46 -0
- package/dist/operations/BoxMuller.js +77 -0
- package/dist/operations/BoxMuller.js.map +1 -0
- package/dist/operations/EulerAngles.d.ts +105 -0
- package/dist/operations/EulerAngles.js +161 -0
- package/dist/operations/EulerAngles.js.map +1 -0
- package/dist/operations/Quaternion.d.ts +56 -0
- package/dist/operations/Quaternion.js +167 -0
- package/dist/operations/Quaternion.js.map +1 -0
- package/dist/operations/RandomGaussianSource.d.ts +24 -0
- package/dist/operations/RandomGaussianSource.js +43 -0
- package/dist/operations/RandomGaussianSource.js.map +1 -0
- package/dist/operations/index.d.ts +4 -0
- package/dist/operations/index.js +5 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/optimize/ChebyshevCompressor.d.ts +32 -0
- package/dist/optimize/ChebyshevCompressor.js +83 -0
- package/dist/optimize/ChebyshevCompressor.js.map +1 -0
- package/dist/optimize/DownhillSimplex.d.ts +64 -0
- package/dist/optimize/DownhillSimplex.js +182 -0
- package/dist/optimize/DownhillSimplex.js.map +1 -0
- package/dist/optimize/GoldenSection.d.ts +39 -0
- package/dist/optimize/GoldenSection.js +55 -0
- package/dist/optimize/GoldenSection.js.map +1 -0
- package/dist/optimize/PolynomialRegression.d.ts +49 -0
- package/dist/optimize/PolynomialRegression.js +83 -0
- package/dist/optimize/PolynomialRegression.js.map +1 -0
- package/dist/optimize/PolynomicalRegressionResult.d.ts +31 -0
- package/dist/optimize/PolynomicalRegressionResult.js +38 -0
- package/dist/optimize/PolynomicalRegressionResult.js.map +1 -0
- package/dist/optimize/SimpleLinearRegression.d.ts +44 -0
- package/dist/optimize/SimpleLinearRegression.js +112 -0
- package/dist/optimize/SimpleLinearRegression.js.map +1 -0
- package/dist/optimize/SimplexEntry.d.ts +32 -0
- package/dist/optimize/SimplexEntry.js +42 -0
- package/dist/optimize/SimplexEntry.js.map +1 -0
- package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +65 -0
- package/dist/orbit_determination/BatchLeastSquaresOD.js +143 -0
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
- package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +31 -0
- package/{lib/objects/space-object.d.ts → dist/orbit_determination/BatchLeastSquaresResult.js} +21 -23
- package/dist/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
- package/dist/orbit_determination/GibbsIOD.d.ts +38 -0
- package/dist/orbit_determination/GibbsIOD.js +76 -0
- package/dist/orbit_determination/GibbsIOD.js.map +1 -0
- package/dist/orbit_determination/GoodingIOD.d.ts +51 -0
- package/dist/orbit_determination/GoodingIOD.js +247 -0
- package/dist/orbit_determination/GoodingIOD.js.map +1 -0
- package/dist/orbit_determination/HerrickGibbsIOD.d.ts +33 -0
- package/dist/orbit_determination/HerrickGibbsIOD.js +50 -0
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -0
- package/dist/orbit_determination/LambertIOD.d.ts +59 -0
- package/dist/orbit_determination/LambertIOD.js +213 -0
- package/dist/orbit_determination/LambertIOD.js.map +1 -0
- package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +40 -0
- package/dist/orbit_determination/ModifiedGoodingIOD.js +83 -0
- package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
- package/dist/propagator/DormandPrince54Propagator.d.ts +28 -0
- package/dist/propagator/DormandPrince54Propagator.js +64 -0
- package/dist/propagator/DormandPrince54Propagator.js.map +1 -0
- package/dist/propagator/KeplerPropagator.d.ts +35 -0
- package/dist/propagator/KeplerPropagator.js +84 -0
- package/dist/propagator/KeplerPropagator.js.map +1 -0
- package/dist/propagator/Propagator.d.ts +34 -0
- package/dist/propagator/Propagator.js +162 -0
- package/dist/propagator/Propagator.js.map +1 -0
- package/dist/propagator/RkCheckpoint.d.ts +22 -0
- package/dist/propagator/RkCheckpoint.js +27 -0
- package/dist/propagator/RkCheckpoint.js.map +1 -0
- package/dist/propagator/RkResult.d.ts +23 -0
- package/dist/propagator/RkResult.js +30 -0
- package/dist/propagator/RkResult.js.map +1 -0
- package/dist/propagator/RungeKutta4Propagator.d.ts +50 -0
- package/dist/propagator/RungeKutta4Propagator.js +141 -0
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -0
- package/dist/propagator/RungeKutta89Propagator.d.ts +28 -0
- package/dist/propagator/RungeKutta89Propagator.js +126 -0
- package/dist/propagator/RungeKutta89Propagator.js.map +1 -0
- package/dist/propagator/RungeKuttaAdaptive.d.ts +54 -0
- package/dist/propagator/RungeKuttaAdaptive.js +159 -0
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -0
- package/dist/propagator/Sgp4Propagator.d.ts +34 -0
- package/dist/propagator/Sgp4Propagator.js +56 -0
- package/dist/propagator/Sgp4Propagator.js.map +1 -0
- package/dist/smoothing/ExponentialSmoothing.d.ts +23 -0
- package/dist/smoothing/ExponentialSmoothing.js +81 -0
- 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 +56 -92
- package/dist/transforms/transforms.js +94 -0
- package/dist/transforms/transforms.js.map +1 -0
- package/dist/types/types.d.ts +105 -584
- package/dist/types/types.js +23 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -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 +34 -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/src/main.ts +32 -0
- 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/index.ts +1 -0
- package/src/utils/jacobian.ts +38 -0
- package/.eslintrc.json +0 -244
- package/.prettierrc +0 -17
- package/babel.config.js +0 -16
- package/codecov.yml +0 -21
- package/dist/objects/base-object.d.ts +0 -40
- package/dist/objects/detailed-sat.d.ts +0 -66
- package/dist/objects/sat.d.ts +0 -92
- package/dist/objects/sensor.d.ts +0 -93
- package/dist/objects/star.d.ts +0 -46
- package/dist/ootk.js +0 -2
- package/dist/ootk.js.LICENSE.txt +0 -77
- package/dist/sgp4/sgp4.d.ts +0 -82
- package/dist/tle/tle-format-data.d.ts +0 -6
- package/dist/tle/tle.d.ts +0 -375
- package/dist/utils/constants.d.ts +0 -34
- package/dist/utils/moon-math.d.ts +0 -113
- package/dist/utils/sun-math.d.ts +0 -230
- package/dist/utils/utils.d.ts +0 -39
- package/jest.config.ts +0 -30
- package/lib/objects/base-object.d.ts +0 -40
- package/lib/objects/base-object.js +0 -79
- package/lib/objects/base-object.js.map +0 -1
- package/lib/objects/detailed-sat.js +0 -149
- package/lib/objects/detailed-sat.js.map +0 -1
- package/lib/objects/index.d.ts +0 -4
- package/lib/objects/index.js +0 -5
- package/lib/objects/index.js.map +0 -1
- package/lib/objects/sat.d.ts +0 -92
- package/lib/objects/sat.js +0 -188
- package/lib/objects/sat.js.map +0 -1
- package/lib/objects/sensor.d.ts +0 -93
- package/lib/objects/sensor.js +0 -273
- package/lib/objects/sensor.js.map +0 -1
- package/lib/objects/space-object.js +0 -60
- package/lib/objects/space-object.js.map +0 -1
- package/lib/objects/star.d.ts +0 -46
- package/lib/objects/star.js +0 -91
- package/lib/objects/star.js.map +0 -1
- package/lib/ootk.js.map +0 -1
- package/lib/sgp4/sgp4.d.ts +0 -82
- package/lib/sgp4/sgp4.js +0 -3262
- package/lib/sgp4/sgp4.js.map +0 -1
- package/lib/tle/tle-format-data.d.ts +0 -6
- package/lib/tle/tle-format-data.js +0 -10
- package/lib/tle/tle-format-data.js.map +0 -1
- package/lib/tle/tle.d.ts +0 -375
- package/lib/tle/tle.js +0 -611
- package/lib/tle/tle.js.map +0 -1
- package/lib/transforms/transforms.d.ts +0 -94
- package/lib/transforms/transforms.js +0 -308
- package/lib/transforms/transforms.js.map +0 -1
- package/lib/types/types.d.ts +0 -605
- package/lib/types/types.js +0 -36
- package/lib/types/types.js.map +0 -1
- package/lib/utils/constants.d.ts +0 -34
- package/lib/utils/constants.js +0 -35
- package/lib/utils/constants.js.map +0 -1
- package/lib/utils/moon-math.d.ts +0 -113
- package/lib/utils/moon-math.js +0 -387
- package/lib/utils/moon-math.js.map +0 -1
- package/lib/utils/sun-math.d.ts +0 -230
- package/lib/utils/sun-math.js +0 -422
- package/lib/utils/sun-math.js.map +0 -1
- package/lib/utils/utils.d.ts +0 -39
- package/lib/utils/utils.js +0 -102
- package/lib/utils/utils.js.map +0 -1
- package/sandbox.html +0 -8
- package/tsconfig.base.json +0 -31
- package/tsconfig.build.json +0 -14
- /package/{LICENSE.MD → LICENSE.md} +0 -0
|
@@ -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
|
+
/* eslint-disable require-jsdoc */
|
|
18
|
+
/* eslint-disable func-style */
|
|
19
|
+
import { evalPoly } from 'ootk-core';
|
|
20
|
+
import { DownhillSimplex } from './DownhillSimplex';
|
|
21
|
+
import { PolynomicalRegressionResult } from './PolynomicalRegressionResult';
|
|
22
|
+
// / Polynomial regression optimizer.
|
|
23
|
+
export class PolynomialRegression {
|
|
24
|
+
constructor() {
|
|
25
|
+
// disable constructor
|
|
26
|
+
}
|
|
27
|
+
static _bayesInformationCriterea(n, k, sse) {
|
|
28
|
+
return n * Math.log(sse) + k * Math.log(n);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Optimize polynomial coefficients to fit data series [xs] and [ys] for the
|
|
32
|
+
* provided polynomial [order].
|
|
33
|
+
* @param xs x values
|
|
34
|
+
* @param ys y values
|
|
35
|
+
* @param order Polynomial order
|
|
36
|
+
* @param root0 Root0
|
|
37
|
+
* @param root0.printIter Root0.printIter
|
|
38
|
+
* @returns The optimal input value.
|
|
39
|
+
*/
|
|
40
|
+
static solve(xs, ys, order, { printIter = false } = {}) {
|
|
41
|
+
const simplex = DownhillSimplex.generateSimplex(Float64Array.from(Array(order + 1).fill(1.0)));
|
|
42
|
+
/**
|
|
43
|
+
* Sum of squared errors.
|
|
44
|
+
* @param coeffs Polynomial coefficients
|
|
45
|
+
* @returns Sum of squared errors
|
|
46
|
+
*/
|
|
47
|
+
function f(coeffs) {
|
|
48
|
+
let sse = 0.0;
|
|
49
|
+
for (let i = 0; i < xs.length; i++) {
|
|
50
|
+
const diff = ys[i] - evalPoly(xs[i], coeffs);
|
|
51
|
+
sse += diff * diff;
|
|
52
|
+
}
|
|
53
|
+
return sse;
|
|
54
|
+
}
|
|
55
|
+
const result = DownhillSimplex.solveSimplex(f, simplex, {
|
|
56
|
+
adaptive: true,
|
|
57
|
+
printIter,
|
|
58
|
+
});
|
|
59
|
+
const sse = f(result);
|
|
60
|
+
return new PolynomicalRegressionResult(result, Math.sqrt(sse), PolynomialRegression._bayesInformationCriterea(xs.length, order, sse));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Optimize polynomial coefficients to fit data series [xs] and [ys], and
|
|
64
|
+
* attempt to find an optimal order within the [minOrder] and
|
|
65
|
+
* [maxOrder] bounds.
|
|
66
|
+
* @param xs x values
|
|
67
|
+
* @param ys y values
|
|
68
|
+
* @param minOrder Minimum polynomial order
|
|
69
|
+
* @param maxOrder Maximum polynomial order
|
|
70
|
+
* @param root0 Root0
|
|
71
|
+
* @param root0.printIter Root0.printIter
|
|
72
|
+
* @returns The optimal input value.
|
|
73
|
+
*/
|
|
74
|
+
static solveOrder(xs, ys, minOrder, maxOrder, { printIter = false } = {}) {
|
|
75
|
+
const cache = [];
|
|
76
|
+
for (let order = minOrder; order <= maxOrder; order++) {
|
|
77
|
+
cache.push(PolynomialRegression.solve(xs, ys, order, { printIter }));
|
|
78
|
+
}
|
|
79
|
+
cache.sort((a, b) => a.bic - b.bic);
|
|
80
|
+
return cache[0];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=PolynomialRegression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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AG,eAAe,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE;YACtD,QAAQ,EAAE,IAAI;YACd,SAAS;SACV,CAAC,CAAC;QACH,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QAEtB,OAAO,IAAI,2BAA2B,CACpC,MAAM,EACN,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EACd,oBAAoB,CAAC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CACtE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,UAAU,CACf,EAAgB,EAChB,EAAgB,EAChB,QAAgB,EAChB,QAAgB,EAChB,EAAE,SAAS,GAAG,KAAK,KAA8B,EAAE;QAEnD,MAAM,KAAK,GAAkC,EAAE,CAAC;QAEhD,KAAK,IAAI,KAAK,GAAG,QAAQ,EAAE,KAAK,IAAI,QAAQ,EAAE,KAAK,EAAE,EAAE;YACrD,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;SACtE;QACD,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAEpC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
export declare class PolynomicalRegressionResult {
|
|
18
|
+
coefficients: Float64Array;
|
|
19
|
+
rss: number;
|
|
20
|
+
bic: number;
|
|
21
|
+
/**
|
|
22
|
+
* Create a new [PolynomicalRegressionResult] object, containing the
|
|
23
|
+
* polynomial [coefficients], root-sum-squared error [rss], and Bayes
|
|
24
|
+
* information criterea [bic].
|
|
25
|
+
* @param coefficients The polynomial coefficients.
|
|
26
|
+
* @param rss The root-sum-squared error.
|
|
27
|
+
* @param bic The Bayes information criterea.
|
|
28
|
+
* @returns The optimal input value.
|
|
29
|
+
*/
|
|
30
|
+
constructor(coefficients: Float64Array, rss: number, bic: number);
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
// / Polynomial regression optimization result.
|
|
18
|
+
export class PolynomicalRegressionResult {
|
|
19
|
+
coefficients;
|
|
20
|
+
rss;
|
|
21
|
+
bic;
|
|
22
|
+
/**
|
|
23
|
+
* Create a new [PolynomicalRegressionResult] object, containing the
|
|
24
|
+
* polynomial [coefficients], root-sum-squared error [rss], and Bayes
|
|
25
|
+
* information criterea [bic].
|
|
26
|
+
* @param coefficients The polynomial coefficients.
|
|
27
|
+
* @param rss The root-sum-squared error.
|
|
28
|
+
* @param bic The Bayes information criterea.
|
|
29
|
+
* @returns The optimal input value.
|
|
30
|
+
*/
|
|
31
|
+
constructor(coefficients, rss, bic) {
|
|
32
|
+
this.coefficients = coefficients;
|
|
33
|
+
this.rss = rss;
|
|
34
|
+
this.bic = bic;
|
|
35
|
+
// Nothing to do here.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=PolynomicalRegressionResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolynomicalRegressionResult.js","sourceRoot":"","sources":["../../src/optimize/PolynomicalRegressionResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,+CAA+C;AAC/C,MAAM,OAAO,2BAA2B;IAUnB;IAAmC;IAAoB;IAT1E;;;;;;;;OAQG;IACH,YAAmB,YAA0B,EAAS,GAAW,EAAS,GAAW;QAAlE,iBAAY,GAAZ,YAAY,CAAc;QAAS,QAAG,GAAH,GAAG,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QACnF,sBAAsB;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
export declare class SimpleLinearRegression {
|
|
18
|
+
xs: number[];
|
|
19
|
+
ys: number[];
|
|
20
|
+
/**
|
|
21
|
+
* Create a new [SimpleLinearRegression] object from lists of x and y
|
|
22
|
+
* values.
|
|
23
|
+
* @param xs x values
|
|
24
|
+
* @param ys y values
|
|
25
|
+
*/
|
|
26
|
+
constructor(xs: number[], ys: number[]);
|
|
27
|
+
private _slope;
|
|
28
|
+
private _intercept;
|
|
29
|
+
private _error;
|
|
30
|
+
get slope(): number;
|
|
31
|
+
get intercept(): number;
|
|
32
|
+
get error(): number;
|
|
33
|
+
get length(): number;
|
|
34
|
+
private _calcError;
|
|
35
|
+
update(): void;
|
|
36
|
+
evaluate(x: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new [SimpleLinearRegression] object with outliers above the
|
|
39
|
+
* provided standard deviation [sigma] value removed.
|
|
40
|
+
* @param sigma standard deviation
|
|
41
|
+
* @returns new [SimpleLinearRegression] object
|
|
42
|
+
*/
|
|
43
|
+
filterOutliers(sigma?: number): SimpleLinearRegression;
|
|
44
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
// / Simple linear regression _(y = mx + b)_.
|
|
18
|
+
export class SimpleLinearRegression {
|
|
19
|
+
xs;
|
|
20
|
+
ys;
|
|
21
|
+
/**
|
|
22
|
+
* Create a new [SimpleLinearRegression] object from lists of x and y
|
|
23
|
+
* values.
|
|
24
|
+
* @param xs x values
|
|
25
|
+
* @param ys y values
|
|
26
|
+
*/
|
|
27
|
+
constructor(xs, ys) {
|
|
28
|
+
this.xs = xs;
|
|
29
|
+
this.ys = ys;
|
|
30
|
+
this.update();
|
|
31
|
+
}
|
|
32
|
+
// / Line slope
|
|
33
|
+
_slope = 0.0;
|
|
34
|
+
// / Y-axis intercept
|
|
35
|
+
_intercept = 0.0;
|
|
36
|
+
_error = 0.0;
|
|
37
|
+
// / Line slope
|
|
38
|
+
get slope() {
|
|
39
|
+
return this._slope;
|
|
40
|
+
}
|
|
41
|
+
// / Y-axis intercept
|
|
42
|
+
get intercept() {
|
|
43
|
+
return this._intercept;
|
|
44
|
+
}
|
|
45
|
+
// / Linear regression standard deviation
|
|
46
|
+
get error() {
|
|
47
|
+
return this._error;
|
|
48
|
+
}
|
|
49
|
+
// / Data length
|
|
50
|
+
get length() {
|
|
51
|
+
return Math.min(this.xs.length, this.ys.length);
|
|
52
|
+
}
|
|
53
|
+
_calcError() {
|
|
54
|
+
let total = 0.0;
|
|
55
|
+
for (let i = 0; i < this.length; i++) {
|
|
56
|
+
const delta = this.ys[i] - this.evaluate(this.xs[i]);
|
|
57
|
+
total += delta * delta;
|
|
58
|
+
}
|
|
59
|
+
this._error = Math.sqrt(total / (this.length - 1));
|
|
60
|
+
}
|
|
61
|
+
// / Update the linear fit with this object's current [xs] and [ys] values.
|
|
62
|
+
update() {
|
|
63
|
+
const n = Math.min(this.xs.length, this.ys.length);
|
|
64
|
+
let xMu = 0.0;
|
|
65
|
+
let yMu = 0.0;
|
|
66
|
+
for (let i = 0; i < n; i++) {
|
|
67
|
+
xMu += this.xs[i];
|
|
68
|
+
yMu += this.ys[i];
|
|
69
|
+
}
|
|
70
|
+
xMu /= n;
|
|
71
|
+
yMu /= n;
|
|
72
|
+
let pa = 0.0;
|
|
73
|
+
let xSig = 0.0;
|
|
74
|
+
let ySig = 0.0;
|
|
75
|
+
for (let i = 0; i < n; i++) {
|
|
76
|
+
const xd = this.xs[i] - xMu;
|
|
77
|
+
const yd = this.ys[i] - yMu;
|
|
78
|
+
pa += xd * yd;
|
|
79
|
+
xSig += xd * xd;
|
|
80
|
+
ySig += yd * yd;
|
|
81
|
+
}
|
|
82
|
+
const p = pa / (Math.sqrt(xSig) * Math.sqrt(ySig));
|
|
83
|
+
xSig = Math.sqrt(xSig / (n - 1));
|
|
84
|
+
ySig = Math.sqrt(ySig / (n - 1));
|
|
85
|
+
this._slope = p * (ySig / xSig);
|
|
86
|
+
this._intercept = yMu - this._slope * xMu;
|
|
87
|
+
this._calcError();
|
|
88
|
+
}
|
|
89
|
+
// / Evaluate this linear fit for y, given an [x] value.
|
|
90
|
+
evaluate(x) {
|
|
91
|
+
return this._slope * x + this._intercept;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Create a new [SimpleLinearRegression] object with outliers above the
|
|
95
|
+
* provided standard deviation [sigma] value removed.
|
|
96
|
+
* @param sigma standard deviation
|
|
97
|
+
* @returns new [SimpleLinearRegression] object
|
|
98
|
+
*/
|
|
99
|
+
filterOutliers(sigma = 1.0) {
|
|
100
|
+
const limit = this.error * sigma;
|
|
101
|
+
const xsOut = [];
|
|
102
|
+
const ysOut = [];
|
|
103
|
+
for (let i = 0; i < this.length; i++) {
|
|
104
|
+
if (Math.abs(this.ys[i] - this.evaluate(this.xs[i])) < limit) {
|
|
105
|
+
xsOut.push(this.xs[i]);
|
|
106
|
+
ysOut.push(this.ys[i]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return new SimpleLinearRegression(xsOut, ysOut);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=SimpleLinearRegression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleLinearRegression.js","sourceRoot":"","sources":["../../src/optimize/SimpleLinearRegression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,6CAA6C;AAC7C,MAAM,OAAO,sBAAsB;IAOd;IAAqB;IANxC;;;;;OAKG;IACH,YAAmB,EAAY,EAAS,EAAY;QAAjC,OAAE,GAAF,EAAE,CAAU;QAAS,OAAE,GAAF,EAAE,CAAU;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,eAAe;IACP,MAAM,GAAG,GAAG,CAAC;IAErB,qBAAqB;IACb,UAAU,GAAG,GAAG,CAAC;IAEjB,MAAM,GAAG,GAAG,CAAC;IAErB,eAAe;IACf,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,qBAAqB;IACrB,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,yCAAyC;IACzC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,gBA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AE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE;gBAC5D,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aACxB;SACF;QAED,OAAO,IAAI,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
* Optimization cost function that takes in parameter array [xs] and returns
|
|
19
|
+
* a score.
|
|
20
|
+
*/
|
|
21
|
+
export type CostFunction = (points: Float64Array) => number;
|
|
22
|
+
export declare class SimplexEntry {
|
|
23
|
+
private _f;
|
|
24
|
+
points: Float64Array;
|
|
25
|
+
score: number;
|
|
26
|
+
private _x;
|
|
27
|
+
constructor(_f: CostFunction, points: Float64Array);
|
|
28
|
+
getPoints(): Float64Array;
|
|
29
|
+
getScore(): number;
|
|
30
|
+
modify(n: number, xa: SimplexEntry, xb: SimplexEntry): SimplexEntry;
|
|
31
|
+
distance(se: SimplexEntry): number;
|
|
32
|
+
}
|
|
@@ -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
|
+
import { Vector } from 'ootk-core';
|
|
18
|
+
export class SimplexEntry {
|
|
19
|
+
_f;
|
|
20
|
+
points;
|
|
21
|
+
score;
|
|
22
|
+
_x;
|
|
23
|
+
constructor(_f, points) {
|
|
24
|
+
this._f = _f;
|
|
25
|
+
this.points = points;
|
|
26
|
+
this._x = new Vector(points);
|
|
27
|
+
this.score = this._f(points);
|
|
28
|
+
}
|
|
29
|
+
getPoints() {
|
|
30
|
+
return this._x.toArray();
|
|
31
|
+
}
|
|
32
|
+
getScore() {
|
|
33
|
+
return this.score;
|
|
34
|
+
}
|
|
35
|
+
modify(n, xa, xb) {
|
|
36
|
+
return new SimplexEntry(this._f, this._x.add(xa._x.subtract(xb._x).scale(n)).toArray());
|
|
37
|
+
}
|
|
38
|
+
distance(se) {
|
|
39
|
+
return this._x.distance(se._x);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=SimplexEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimplexEntry.js","sourceRoot":"","sources":["../../src/optimize/SimplexEntry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAQnC,MAAM,OAAO,YAAY;IAIH;IAAyB;IAH7C,KAAK,CAAS;IACN,EAAE,CAAS;IAEnB,YAAoB,EAAgB,EAAS,MAAoB;QAA7C,OAAE,GAAF,EAAE,CAAc;QAAS,WAAM,GAAN,MAAM,CAAc;QAC/D,IAAI,CAAC,EAAE,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,CAAS,EAAE,EAAgB,EAAE,EAAgB;QAClD,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,QAAQ,CAAC,EAAgB;QACvB,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;CACF"}
|
|
@@ -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 { J2000 } from 'ootk-core';
|
|
18
|
+
import { Observation } from '../observation/Observation';
|
|
19
|
+
import { ForceModel } from './../force/ForceModel';
|
|
20
|
+
import { BatchLeastSquaresResult } from './BatchLeastSquaresResult';
|
|
21
|
+
/**
|
|
22
|
+
* Batch least squares orbit determination.
|
|
23
|
+
*/
|
|
24
|
+
export declare class BatchLeastSquaresOD {
|
|
25
|
+
private observations_;
|
|
26
|
+
private apriori_;
|
|
27
|
+
private forceModel_?;
|
|
28
|
+
private posStep_;
|
|
29
|
+
private velStep_;
|
|
30
|
+
private fastDerivatives_;
|
|
31
|
+
private propPairs_;
|
|
32
|
+
private propagator_;
|
|
33
|
+
private nominal_;
|
|
34
|
+
private start_;
|
|
35
|
+
/**
|
|
36
|
+
* Create a new [BatchLeastSquaresOD] object from a list of [Observation]
|
|
37
|
+
* objects, an [apriori] state estimate, and an optional
|
|
38
|
+
* spacecraft [forceModel].
|
|
39
|
+
* @param observations_ List of observations.
|
|
40
|
+
* @param apriori_ Apriori state estimate.
|
|
41
|
+
* @param forceModel_ Spacecraft force model.
|
|
42
|
+
* @param posStep_ Position step size.
|
|
43
|
+
* @param velStep_ Velocity step size.
|
|
44
|
+
* @param fastDerivatives_ Use fast derivatives.
|
|
45
|
+
* @returns [BatchLeastSquaresOD] object.
|
|
46
|
+
*/
|
|
47
|
+
constructor(observations_: Observation[], apriori_: J2000, forceModel_?: ForceModel | undefined, posStep_?: number, velStep_?: number, fastDerivatives_?: boolean);
|
|
48
|
+
private buildPropagator_;
|
|
49
|
+
private static stateToX0_;
|
|
50
|
+
private setPropagatorPairs_;
|
|
51
|
+
/**
|
|
52
|
+
* Attempt to solve a state estimate with the given root-mean-squared delta
|
|
53
|
+
* [tolerance].
|
|
54
|
+
* @param root0 Root initial guess.
|
|
55
|
+
* @param root0.tolerance Root-mean-squared delta tolerance.
|
|
56
|
+
* @param root0.maxIter Maximum number of iterations.
|
|
57
|
+
* @param root0.printIter Print iterations.
|
|
58
|
+
* @returns [BatchLeastSquaresResult] object.
|
|
59
|
+
*/
|
|
60
|
+
solve({ tolerance, maxIter, printIter, }?: {
|
|
61
|
+
tolerance?: number;
|
|
62
|
+
maxIter?: number;
|
|
63
|
+
printIter?: boolean;
|
|
64
|
+
}): BatchLeastSquaresResult;
|
|
65
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { concat, J2000, Matrix, Vector, Vector3D } from 'ootk-core';
|
|
18
|
+
import { PropagatorPairs } from '../observation/PropagatorPairs';
|
|
19
|
+
import { CovarianceFrame, StateCovariance } from './../covariance/StateCovariance';
|
|
20
|
+
import { ForceModel } from './../force/ForceModel';
|
|
21
|
+
import { KeplerPropagator } from './../propagator/KeplerPropagator';
|
|
22
|
+
import { RungeKutta89Propagator } from './../propagator/RungeKutta89Propagator';
|
|
23
|
+
import { BatchLeastSquaresResult } from './BatchLeastSquaresResult';
|
|
24
|
+
/**
|
|
25
|
+
* Batch least squares orbit determination.
|
|
26
|
+
*/
|
|
27
|
+
export class BatchLeastSquaresOD {
|
|
28
|
+
observations_;
|
|
29
|
+
apriori_;
|
|
30
|
+
forceModel_;
|
|
31
|
+
posStep_;
|
|
32
|
+
velStep_;
|
|
33
|
+
fastDerivatives_;
|
|
34
|
+
// / Propagator pair cache, for generating observation Jacobians.
|
|
35
|
+
propPairs_;
|
|
36
|
+
// / Nominal state propagator.
|
|
37
|
+
propagator_;
|
|
38
|
+
// / State estimate during solve.
|
|
39
|
+
nominal_;
|
|
40
|
+
// / Solve start epoch.
|
|
41
|
+
start_;
|
|
42
|
+
/**
|
|
43
|
+
* Create a new [BatchLeastSquaresOD] object from a list of [Observation]
|
|
44
|
+
* objects, an [apriori] state estimate, and an optional
|
|
45
|
+
* spacecraft [forceModel].
|
|
46
|
+
* @param observations_ List of observations.
|
|
47
|
+
* @param apriori_ Apriori state estimate.
|
|
48
|
+
* @param forceModel_ Spacecraft force model.
|
|
49
|
+
* @param posStep_ Position step size.
|
|
50
|
+
* @param velStep_ Velocity step size.
|
|
51
|
+
* @param fastDerivatives_ Use fast derivatives.
|
|
52
|
+
* @returns [BatchLeastSquaresOD] object.
|
|
53
|
+
*/
|
|
54
|
+
constructor(observations_, apriori_, forceModel_, posStep_ = 1e-5, velStep_ = 1e-5, fastDerivatives_ = false) {
|
|
55
|
+
this.observations_ = observations_;
|
|
56
|
+
this.apriori_ = apriori_;
|
|
57
|
+
this.forceModel_ = forceModel_;
|
|
58
|
+
this.posStep_ = posStep_;
|
|
59
|
+
this.velStep_ = velStep_;
|
|
60
|
+
this.fastDerivatives_ = fastDerivatives_;
|
|
61
|
+
this.observations_.sort((a, b) => a.epoch.posix - b.epoch.posix);
|
|
62
|
+
this.start_ = this.observations_[0].epoch;
|
|
63
|
+
this.propPairs_ = new PropagatorPairs(this.posStep_, this.velStep_);
|
|
64
|
+
this.forceModel_ ??= new ForceModel().setGravity();
|
|
65
|
+
this.propagator_ = new RungeKutta89Propagator(this.apriori_, this.forceModel_);
|
|
66
|
+
this.nominal_ = this.propagator_.propagate(this.start_);
|
|
67
|
+
}
|
|
68
|
+
buildPropagator_(x0, simple) {
|
|
69
|
+
const state = new J2000(this.nominal_.epoch, new Vector3D(x0[0], x0[1], x0[2]), new Vector3D(x0[3], x0[4], x0[5]));
|
|
70
|
+
if (simple) {
|
|
71
|
+
return new KeplerPropagator(state.toClassicalElements());
|
|
72
|
+
}
|
|
73
|
+
return new RungeKutta89Propagator(state, this.forceModel_);
|
|
74
|
+
}
|
|
75
|
+
static stateToX0_(state) {
|
|
76
|
+
return concat(state.position.toArray(), state.velocity.toArray());
|
|
77
|
+
}
|
|
78
|
+
setPropagatorPairs_(x0) {
|
|
79
|
+
const pl = this.buildPropagator_(x0, this.fastDerivatives_);
|
|
80
|
+
for (let i = 0; i < 6; i++) {
|
|
81
|
+
const step = this.propPairs_.step(i);
|
|
82
|
+
const xh = x0.slice();
|
|
83
|
+
xh[i] += step;
|
|
84
|
+
const ph = this.buildPropagator_(xh, this.fastDerivatives_);
|
|
85
|
+
this.propPairs_.set(i, ph, pl);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Attempt to solve a state estimate with the given root-mean-squared delta
|
|
90
|
+
* [tolerance].
|
|
91
|
+
* @param root0 Root initial guess.
|
|
92
|
+
* @param root0.tolerance Root-mean-squared delta tolerance.
|
|
93
|
+
* @param root0.maxIter Maximum number of iterations.
|
|
94
|
+
* @param root0.printIter Print iterations.
|
|
95
|
+
* @returns [BatchLeastSquaresResult] object.
|
|
96
|
+
*/
|
|
97
|
+
solve({ tolerance = 1e-3, maxIter = 250, printIter = false, } = {}) {
|
|
98
|
+
let breakFlag = false;
|
|
99
|
+
const xNom = BatchLeastSquaresOD.stateToX0_(this.nominal_);
|
|
100
|
+
let weightedRms = Infinity;
|
|
101
|
+
const atwaMatInit = Matrix.zero(6, 6);
|
|
102
|
+
const atwbMatInit = Matrix.zero(6, 1);
|
|
103
|
+
let atwaMat = atwaMatInit;
|
|
104
|
+
for (let iter = 0; iter < maxIter; iter++) {
|
|
105
|
+
atwaMat = atwaMatInit;
|
|
106
|
+
let atwbMat = atwbMatInit;
|
|
107
|
+
this.propagator_ = this.buildPropagator_(xNom, false);
|
|
108
|
+
this.setPropagatorPairs_(xNom);
|
|
109
|
+
let rmsTotal = 0.0;
|
|
110
|
+
let measCount = 0;
|
|
111
|
+
for (const ob of this.observations_) {
|
|
112
|
+
const noise = ob.noise;
|
|
113
|
+
const aMat = ob.jacobian(this.propPairs_);
|
|
114
|
+
const aMatTN = aMat.transpose().multiply(noise);
|
|
115
|
+
const bMat = ob.residual(this.propagator_);
|
|
116
|
+
atwaMat = atwaMat.add(aMatTN.multiply(aMat));
|
|
117
|
+
atwbMat = atwbMat.add(aMatTN.multiply(bMat));
|
|
118
|
+
rmsTotal += bMat.transpose().multiply(noise).multiply(bMat).elements[0][0];
|
|
119
|
+
measCount += noise.rows;
|
|
120
|
+
}
|
|
121
|
+
const newWeightedRms = Math.sqrt(rmsTotal / measCount);
|
|
122
|
+
if (printIter) {
|
|
123
|
+
// eslint-disable-next-line no-console
|
|
124
|
+
console.log(`${iter + 1}: rms=${newWeightedRms} x=${new Vector(xNom)}`);
|
|
125
|
+
}
|
|
126
|
+
if (Math.abs((weightedRms - newWeightedRms) / weightedRms) <= tolerance) {
|
|
127
|
+
breakFlag = true;
|
|
128
|
+
}
|
|
129
|
+
weightedRms = newWeightedRms;
|
|
130
|
+
const dX = atwaMat.inverse().multiply(atwbMat);
|
|
131
|
+
for (let i = 0; i < 6; i++) {
|
|
132
|
+
xNom[i] += dX.elements[i][0];
|
|
133
|
+
}
|
|
134
|
+
if (breakFlag) {
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const p = atwaMat.inverse();
|
|
139
|
+
const covariance = new StateCovariance(p, CovarianceFrame.ECI);
|
|
140
|
+
return new BatchLeastSquaresResult(this.buildPropagator_(xNom, false).propagate(this.start_), covariance, weightedRms);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=BatchLeastSquaresOD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchLeastSquaresOD.js","sourceRoot":"","sources":["../../src/orbit_determination/BatchLeastSquaresOD.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAY,KAAK,EAAmC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE/G,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAA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AAC,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;QAE/D,OAAO,IAAI,uBAAuB,CAChC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EACzD,UAAU,EACV,WAAW,CACZ,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { J2000 } from 'ootk-core';
|
|
18
|
+
import { StateCovariance } from './../covariance/StateCovariance';
|
|
19
|
+
export declare class BatchLeastSquaresResult {
|
|
20
|
+
state: J2000;
|
|
21
|
+
covariance: StateCovariance;
|
|
22
|
+
rms: number;
|
|
23
|
+
/**
|
|
24
|
+
* Create a new [BatchLeastSquaresResult] object, containing the solved
|
|
25
|
+
* [state], [covariance], and root-mean-squared error [rms].
|
|
26
|
+
* @param state The solved state.
|
|
27
|
+
* @param covariance The solved covariance.
|
|
28
|
+
* @param rms The root-mean-squared error.
|
|
29
|
+
*/
|
|
30
|
+
constructor(state: J2000, covariance: StateCovariance, rms: number);
|
|
31
|
+
}
|