Temporarily use Euler-derived location instead of NonlinearMagneticDipoleBz location estimates#121
Merged
YagoMCastro merged 1 commit intomainfrom Oct 17, 2025
Merged
Conversation
YagoMCastro
added a commit
that referenced
this pull request
Nov 11, 2025
This PR restores the use of source locations estimated by `NonlinearMagneticDipoleBz`, replacing the temporary use of Euler Deconvolution results. The inversion algorithm was corrected to fix the inaccurate location estimates previously produced. After the fix, `NonlinearMagneticDipoleBz` now provides accurate and consistent positions, better than those from Euler Deconvolution. This update affects the `iterative_nonlinear_inversion` function, which implements the full methodology presented by [Souza-Junior (2025)](https://eartharxiv.org/repository/view/8869/). In our implementation, the original Nelder–Mead–based inversion from the paper is replaced by a more robust Levenberg–Marquardt–based inversion **Changes made** - **Set a lower limit to `r²`** to avoid excessively large derivatives when source–data distances become very small. - **Construct the damping matrix proportional to the diagonal of the Hessian**, ensuring that regularization adapts to parameter sensitivity. - **Reduce the global scaling factor** to stabilize updates and prevent overshooting during optimization. Together, these changes make the inversion more robust against numerical instabilities and improve convergence consistency across different datasets. **Relevant issues/PRs:** #121 #120 #107
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR temporarily replaces the source location estimated by the
NonlinearMagneticDipoleBzinversion with the one obtained from Euler Deconvolution.Recent tests show that the Euler-derived locations produce more accurate and consistent results, while the positions estimated by
NonlinearMagneticDipoleBzsometimes exhibit instability or unrealistic values.This suggests there may be a bug in the nonlinear inversion algorithm.