This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Optimized OrbitalParameters and StateVector classes with lazy evaluation Refactored OrbitalParameters and StateVector classes to optimize them with lazy evaluation. The state is now calculated just-in-time, when accessed for the first time, rather than upfront, which can lead to improved performance for sceneries where not all parameters or vectors are used. The calculated state is cached for further use. This pattern is particularly beneficial when computations are expensive, and not all computed values are needed in subsequent operations, thereby potentially avoiding unnecessary work. Each parameter and vector is now only computed when it's actually accessed, making it more performant especially for users who only need a subset of all possible properties. * Refactor code to cache calculations and modify angle computations This refactoring changes the OrbitalParameters, StateVector, and Vector3 classes to store computed values to reduce redundant calculations. The changes include caching values in various Astrodynamics classes like the StateVector, Equinoctial and Keplerian Elements to avoid recalculation, especially in orbital parameters-related methods. The Vector3.Angle method is also modified to use atan2 instead of acos for angle calculation to handle full circle angle differences. Additional test cases for Vector3 angles have been added to ensure correctness. * Updated Math and Maneuver classes, added new methods This update includes significant changes to classes in Astrodynamics/Math and Astrodynamics/Maneuver. In the Math group, Plane and Vector3 classes have been upgraded with new methods. In the Maneuver group, many classes added a new `ManeuverPointComputation` method, which currently throws NotImplementedException. The ComputeDeltaV, ComputeDeltaT, and ComputeDeltaM methods are also updated in the Maneuver class. * Add performance testing for spacecraft propagation The commit includes the addition of the BenchmarkDotNet library to the IO.Astrodynamics.Tests project. A new 'Performance' class is created in the same project, with a benchmark test for the 'ScenarioTests' class. Additionally, a new project 'IO.Astrodynamics.Performance' has been added to the solution for dedicated performance testing. * Remove unimplemented methods from maneuver classes Several classes under the 'maneuver' namespace contained unimplemented methods, specifically 'Execute', 'ManeuverPointComputation', and some related utility methods and properties. These have been removed across multiple files to clean up the codebase. This is part of an effort to refactor the astrodynamics components and prioritize planned features. * Remove Performance.cs and update tests Deleted Performance.cs test file as it's no longer necessary. Updated logic in APITest.cs, Vector3.cs and Vector3Test.cs for better performance and accuracy. Also modified the attribute in Scenario.cs for Markdown export. * Update astrodynamics test data and assert conditions This commit updates the maneuver windows start dates, end dates, length, deltaV, and fuel burned values in ScenarioTests.cs and APITest.cs. Also, the IO.Astrodynamics version has been changed from 1.9.1 to 1.9.2. This reflects the recent changes in the maneuver calculations and astrodynamics data.
- Loading branch information
1 parent
3cc8211
commit adacdb2
Showing
32 changed files
with
551 additions
and
175 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
IO.Astrodynamics.Performance/IO.Astrodynamics.Performance.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\IO.Astrodynamics.Tests\IO.Astrodynamics.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Update="Data\SolarSystem\de440s.bsp"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\earth_assoc_itrf93.tf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\earth_fixed.tf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\earth_latest_high_prec.bpc"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\earth_topo_201023.tf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\earthstns_itrf93_201023.bsp"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\geophysical.ker"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\gm_de431.tpc"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\moon_080317.tf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\moon_assoc_me.tf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\moon_pa_de421_1900-2050.bpc"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\pck00011.tpc"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="Data\SolarSystem\latest_leapseconds.tls"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using BenchmarkDotNet.Running; | ||
|
||
namespace IO.Astrodynamics.Performance; | ||
|
||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var summary = BenchmarkRunner.Run(typeof(Program).Assembly); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2023. Sylvain Guillet (sylvain.guillet@tutamail.com) | ||
|
||
using BenchmarkDotNet.Attributes; | ||
|
||
namespace IO.Astrodynamics.Performance; | ||
|
||
[MarkdownExporterAttribute.GitHub] | ||
[MemoryDiagnoser] | ||
[SkewnessColumn] | ||
[KurtosisColumn] | ||
[StatisticalTestColumn] | ||
[ShortRunJob] | ||
public class Scenario | ||
{ | ||
[Benchmark(Description = "Spacecraft propagator")] | ||
public void Propagate() | ||
{ | ||
var scenario = new IO.Astrodynamics.Tests.Mission.ScenarioTests(); | ||
scenario.Propagate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.