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

ENH: Add better singularity warnings. #83

Open
jcapriot opened this issue Nov 2, 2024 · 1 comment
Open

ENH: Add better singularity warnings. #83

jcapriot opened this issue Nov 2, 2024 · 1 comment

Comments

@jcapriot
Copy link
Member

jcapriot commented Nov 2, 2024

We should have a bit better handling of singular points in the analytic solutions.
At the very least:

  • Create a SingularWarning class issued if any of the functions try to evaluate at known singular points. (i.e. when evaluating points directly at source locations.) We should also include in the message, where this happened if possible.

Inside the functions we should probably:

  1. Temporarily replace the singular points with something that won't be singular
  2. Then before returning, insert $\pm\infty$ back into those singular points if those points are infinite, or nan if that isn't the case.

I don't think filling them with zeros is a good practice, but issuing better warnings will be greatly helpful.

@jcapriot
Copy link
Member Author

jcapriot commented Nov 2, 2024

A quick list of singularities to consider:

  • fdem.ElectricDipoleWholeSpace
  • fdem.MagneticDipoleWholeSpace
  • fdem.MagneticDipoleHalfSpace
  • fdem.MagneticDipoleLayeredHalfSpace
  • tdem.ElectricDipoleWholeSpace
  • tdem.VerticalMagneticDipoleHalfSpace
  • static.LineCurrentFreeSpace
  • static.LineCurrentWholeSpace
  • static.CircularLoopWholeSpace
  • static.MagneticDipoleWholeSpace
  • static.MagneticPoleWholeSpace
  • static.PointCurrentWholeSpace
  • static.PointCurrentHalfSpace
  • static.DipoleHalfSpace
  • gravity.PointMass
  • gravity.Prism.gravitational_gradient, technically undefined at some edge/orientation combinations,
  • gravity.Sphere.gravitational_gradient, Technically undefined at the sphere boundary

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

No branches or pull requests

1 participant