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

Magnetic disturbances #202

Merged
merged 104 commits into from
Jan 31, 2024
Merged

Magnetic disturbances #202

merged 104 commits into from
Jan 31, 2024

Conversation

Mr-Medina
Copy link
Collaborator

@Mr-Medina Mr-Medina commented Jan 29, 2024

Description

Summary of changes

  • Added "_earth_magnetic_dipole_moment" function in the attitude model returning the time-dependent Earth dipole moment. (based on data from World Data Center for Geomagnetism)
  • Implemented resulting torque calculations in the disturbance_calculations file to be considered in the attitude modelling. (Based on magnetic dipole formulas from Tai L. Chow (2006) p. 148 - 149 and SMAD)
  • Added a test in "attitude_test"

Resolved Issues

How Has This Been Tested?

Place two actors in GEO orbit in the magnetic dipole moment vector plane of the Earth, one magnetic, one non-magnetic. Alligning body pointing vectors (and for the magnetic actor: its magnetic dipole) with the local field vector of the Earth. Run simulation and check if magnetic actor follows field lines, and non-magnetic actor doesn't change attitude.

Related Pull Requests

…of floats, outputs: numpy arrays (needs to be reviewed in implementation)
…l and magnetic) on actor. started with set_attitude_model and attitude model class as well.
deleted redundant function (which I added myself)
pointing vector function
@Mr-Medina Mr-Medina self-assigned this Jan 29, 2024
@Mr-Medina Mr-Medina added tests Anything related to the tests feature implementing a new feature physical-model All things involving some physical models labels Jan 29, 2024
@Mr-Medina Mr-Medina requested review from gomezzz and GabrieleMeoni and removed request for gomezzz January 29, 2024 23:51
@Mr-Medina Mr-Medina linked an issue Jan 29, 2024 that may be closed by this pull request
Copy link
Collaborator

@GabrieleMeoni GabrieleMeoni left a comment

Choose a reason for hiding this comment

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

Make sure to merge with the final student branch.

u = np.array(self._actor.get_position(self._actor.local_time))
return -u / np.linalg.norm(u)

def _earth_magnetic_dipole_moment(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a feature of the center body. I would move it there

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is true, I put it in central_body. I put a todo to implement other central bodies instead of Earth, I can remove that todo and add an issue later (or don't do any). Is this okay?

# get Earth B vector at specific timestep

# Earth magnetic dipole moment:
m_earth = actor._attitude_model.earth_magnetic_dipole_moment()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would not make it a property of the attitude model but of the central body, as mentioned before.

@GabrieleMeoni GabrieleMeoni merged commit 084ae6d into student Jan 31, 2024
0 of 3 checks passed
@GabrieleMeoni GabrieleMeoni deleted the attitude-magnetic-disturbance branch January 31, 2024 08:20
@GabrieleMeoni GabrieleMeoni restored the attitude-magnetic-disturbance branch January 31, 2024 10:00
@GabrieleMeoni
Copy link
Collaborator

@Mr-Medina please notice that your test on the magnetic disturbances is failing me. It passes only if I use at least assert angle < 6. With a rough calculation, at that latitude, you should have a rotation in 4000 s of about 2 degrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature implementing a new feature physical-model All things involving some physical models tests Anything related to the tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Magnetic disturbances in attitude model
3 participants