compute_magnetic_dipole#

namespace saltro
namespace orbits

Functions

bool compute_magnetic_dipole(const Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &R, const Eigen::Matrix<double, 1, saltro::limits::MAX_LENGTH_TRAJ> &jtime, const int jtime_length, Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &B)#

Compute geomagnetic field using a tilted dipole model.

Computes the Earth magnetic field vector along a trajectory using a simplified tilted dipole approximation of the geomagnetic field.

For each trajectory sample (k), the magnetic field is evaluated as:

\[ \mathbf{B}_k = \mathbf{B}_{\text{dipole}}\!\left(\mathbf{R}_k, t_k\right) \]

where \(\mathbf{R}_k\) is the position in an Earth-centered frame and \(t_k\) is the corresponding Julian time. The dipole model assumes a centered magnetic dipole that is tilted with respect to the Earth’s rotation axis.

The output field is written column-wise:

\[ \mathbf{B} = \begin{bmatrix} \mathbf{B}_0 & \mathbf{B}_1 & \cdots & \mathbf{B}_{N-1} \end{bmatrix} \]

Parameters:
  • R – Position vectors of the trajectory in ECEF/ECI frame (meters). Each column \(\mathbf{R}_k\) corresponds to one time sample.

  • jtime – Julian time values associated with each trajectory sample.

  • jtime_length – Number of valid trajectory samples.

  • B – Output magnetic field vectors (Tesla). Each column corresponds to the field at the matching trajectory sample.

Returns:

True if the computation succeeds for all samples, false otherwise.