nyx-space / nyx

Nyx is a high fidelity, fast, reliable and validated astrodynamics toolkit library written in Rust and available in Python
https://nyxspace.com
GNU Affero General Public License v3.0
198 stars 20 forks source link

Consolidated accel and sum into Vector4 #369

Closed gregjesl closed 1 month ago

gregjesl commented 1 month ago

Summary

Updated harmonics calculations using Vector4

Architectural Changes

No change

New Features

No change

Improvements

Leveraged Vector4 for acceleration and sum terms of Pines' algorithm. Slight performance improvement expected.

No change

Bug Fixes

No change

Testing and validation

All tests passing

Documentation

This PR does not primarily deal with documentation changes.

gregjesl commented 1 month ago

Found an issue, closing pull request. Will reopen if/when fixed.

ChristopherRabotin commented 1 month ago

That's a useful change, thanks! I'll be happy to review and merge it quickly when you're content with the proposed change.

gregjesl commented 1 month ago

Found the issue - I missed the -= hiding in there...

gregjesl commented 1 month ago

My goal is to implement a multi-threaded version of Pines' algorithm, now I can throw a std::sync::mutex around accel4 and farm out the calculations. Once I get that done I'll open a separate pull request.

gregjesl commented 1 month ago

Forgot to mention: I found the issue and tested the fix by running the LRO example. Now the results are the same.

ChristopherRabotin commented 1 month ago

Thanks for the quick turn around! I'll go ahead and merge this.

Multithreading the Pines algorithm probably won't improve the computational speed. I've been keeping an eye on @MartinAstro 's work on physics informed neural networks for the past few years: https://github.com/MartinAstro/GravNN . The first iteration of this model shows impressive performance improvements compared to the typical algorithms, including Pines. The subsequent versions of his work improve the quality of the solution even when far from the central object. I'll reach out to assess the complexity in implementing this in Nyx.