Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics unit tests #6

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ReeceHumphreys
Copy link
Collaborator

@ReeceHumphreys ReeceHumphreys commented Feb 22, 2025

Ignore the changes to numerics. This PR would be merged after the numerics. I just based this branch off of the numerics so the cargo.toml updates were included!

Edit: Need to recommit the orbital mechanics tests

Copy link
Contributor

@Natsoulas Natsoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need semi-extensive commenting for crucial physics unit tests like energy, gravity, orbital, and even attitude. I can't just trust random numbers and shouldn't really have to spend any time speculating about them when reading through them.

pub struct Quaternion {
pub data: na::Vector4<f64>,
}

#[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we editing numerics/quaternion in this pr? Why isn't it just in the numerics unit test pr?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR was just based on the numerics branch so I got the dependency changes. Once that is merged ill just rebase it off of main.

@@ -37,3 +37,125 @@ pub fn quaternion_derivative<T: SpacecraftProperties>(state: &State<T>) -> Quate
// Only use body angular velocity for quaternion propagation
compute_quaternion_derivative(&state.quaternion, &state.angular_velocity)
}

#[cfg(test)]
mod tests {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please comment explaining the different unit tests for quick readability. Also like the other PR explain/document the test value you used and how you decided upon or found them. Rn just a script in the google drive is sufficient

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. Will merge once I've uploaded my scripts and writeup to the google drive. The gist is I used a hybrid of some python scripts and hand calculations to verify values. I also used a few examples from Vallado.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants