- 1Earth, Ocean and Atmospheric Sciences, University of British Columbia, Vancouver, Canada (ssoler@eoas.ubc.ca)
- 2Imperial College London, London, United Kingdom
Analytic solutions for the gravitational potential of a homogeneous ellipsoid have existed since the first half of the nineteenth century, while analytic solutions for the magnetic field were developed by the end of the same century. The existence of such analytic solutions allowed geophysicists to use ellipsoidal bodies to approximate complex geological structures and model their respective gravity and magnetic fields. Ellipsoids are of particular interest for modelling ore bodies and structures with high magnetic susceptibilities, since they are the only geometric bodies with analytic solutions for their magnetic field that account for self-demagnetization effects. Nonetheless, modern, easy-to-use, up-to-date, and open-source implementations of these analytic solutions are scarce if non-existent.
We present an open-source Python implementation of the analytic solutions of the gravity acceleration and magnetic field generated by homogeneous ellipsoids with arbitrary rotations. This new code allows users to easily define ellipsoids by their semi-axes lengths, the coordinates of their geometric centers, and three rotation angles. The gravity acceleration and magnetic field they generate can be computed on any point in space, including internal and external points to the bodies, through specific functions for each field. The code supports triaxial, prolate and oblate ellipsoids, including spheres. Users can assign physical properties to each ellipsoid, like its mass density, magnetic susceptibility, and remanent magnetization. The magnetic susceptibility can be a single value for isotropic susceptibility, or a second-order tensor to account for anisotropy. The total magnetization of the ellipsoid is obtained as a combination of the induced and remanent magnetization, accounting for self-demagnetization effects.
This implementation can be used to predict the gravity and magnetic field of any set of ellipsoids for hypothesis testing, survey designing, and stochastic inversions. In future work, we plan to include analytic derivatives of the fields with respect to ellipsoid's parameters, so the code can also be used for deterministic inversions.
The ellipsoid class and their forward modelling functions have been included in Harmonica: an open-source Python package for processing and modelling gravity and magnetic data, part of the Fatiando a Terra project. We followed best practices for its development, including thorough testing and extensive documentation, leading to a robust, well-designed, and well-tested implementation of such analytic solutions.
How to cite: Soler, S., Baker, K., and Heagy, L.: Open-source gravity and magnetic forward model of ellipsoids, EGU General Assembly 2026, Vienna, Austria, 3–8 May 2026, EGU26-8366, https://doi.org/10.5194/egusphere-egu26-8366, 2026.