Commit c9304a4
authored
Feature/lambert solver (#234)
* Add LambertSolver.cs
* Add SpecialFunctions class with Hypergeometric method
Introduces a new class `SpecialFunctions` in the `IO.Astrodynamics.Math` namespace.
The class features a `Hypergeometric` method that computes the value of a hypergeometric series
based on input parameters `z` and `tol`. The method iteratively calculates the series until
the absolute value of the next term is within the specified tolerance. Detailed XML documentation
is provided for clarity on the method's purpose, parameters, and return value.
* Add time of flight methods to LambertSolver
Updated `LambertSolver.cs` with two new methods:
`XToTimeOfFlight` for computing time of flight based on
the x parameter and number of revolutions, and
`XToTimeOfFlightGeneral` for selecting the appropriate
calculation method (Battin, Lagrange, or Lancaster).
Code cleanup includes removal of unnecessary using
directives and enhanced documentation with XML comments.
* Update packages and enhance mathematical functions
- Upgraded package references in `IO.Astrodynamics.Tests.csproj`.
- Added `TimeOfFlightDerivatives` method in `LambertSolver.cs` with XML documentation.
- Implemented validation in `Hypergeometric` method in `Functions.cs` to check for non-negative tolerance.
- Created `SpecialFunctionsTests` class in `SpecialFunctionsTests.cs` to unit test the `Hypergeometric` method.
* Add documentation and implement Halley's method in LambertSolver
* Add LambertResult and LambertSolution classes for Lambert problem solutions
* Update tests and refactor Lambert problem classes
- Enhanced `.gitignore` to include build artifacts and IDE directories.
- Added unit tests for `LambertResult`, `LambertSolution`, and `LambertSolver` classes using `Xunit`.
- Modified `LambertResult` to return a read-only collection of solutions and changed `MaxRevolutions` type to `ushort`.
- Refactored `LambertSolver` constructor and updated the `Solve` method for improved robustness.
- Enhanced `ComputeSolution` method for accurate velocity vector calculations.
- Added documentation comments to improve code maintainability.
* Refactor namespaces and improve Lambert solver tests
This commit refactors the namespace from IO.Astrodynamics.Tests.Maneuver.Lambert to IO.Astrodynamics.Tests.Maneuvers.Lambert for consistency across multiple test files.
In LambertSolverTests.cs, instances of DummyCelestialItem were replaced with DummyBody, and tests now utilize TestHelpers.EarthAtJ2000 for better clarity. The CreateStateVector method was updated to accept an epoch parameter.
Significant changes were made to the LambertSolver class, including the removal of the m_lambda member in favor of a local variable lambda, simplifying state management. Time of flight calculation methods were also updated to accept the lambda parameter.
New test cases were added to validate the solver's functionality for Earth to Moon transfers in both direct and retrograde scenarios, enhancing test reliability and ensuring correct behavior under various conditions.
* Bump version to 0.6.5.0 and 6.5.0; enhance LambertSolution with DeltaV properties
* Update IO.Astrodynamics.Net/IO.Astrodynamics/Math/Functions.cs
Co-authored-by: Copilot <[email protected]>
* Refactor namespaces and improve Lambert solver tests
This commit refactors the namespace from `IO.Astrodynamics.Tests.Maneuver.Lambert` to `IO.Astrodynamics.Tests.Maneuvers.Lambert` for consistency across multiple test files.
In `LambertSolverTests.cs`, instances of `DummyCelestialItem` were replaced with `DummyBody`, and tests now utilize `TestHelpers.EarthAtJ2000` for better clarity. The `CreateStateVector` method was updated to accept an epoch parameter.
Significant changes were made to the `LambertSolver` class, including the removal of the `m_lambda` member in favor of a local variable `lambda`, simplifying state management. Time of flight calculation methods were also updated to accept the `lambda` parameter.
New test cases were added to validate the solver's functionality for Earth to Moon transfers in both direct and retrograde scenarios, enhancing test reliability and ensuring correct behavior under various conditions.
* Fix variable name for threshold comparison
Renamed `battinThreshold` to `BattinThreshold` in the
conditional statement to ensure consistency with its
definition elsewhere in the code.
* Refactor DateTimeTests for accurate TDT conversions
Updated `LocalToTdt` and `TdtToLocal` methods to calculate expected TDT and local time based on the system's local time zone offset. Removed hardcoded values and added assertions with a tolerance of 1 millisecond for improved accuracy in time conversions.
---------
Authored-by: Sylvain Guillet <[email protected]>1 parent 641ee24 commit c9304a4
File tree
14 files changed
+1035
-13
lines changed- IO.Astrodynamics.Net
- IO.Astrodynamics.CLI
- IO.Astrodynamics.Tests
- Maneuvers
- Math
- Mission
- Time
- IO.Astrodynamics
- Maneuver/Lambert
- Math
14 files changed
+1035
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
Lines changed: 89 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
Lines changed: 81 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
0 commit comments