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

Finite Build Coils #1421

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

Conversation

ryanwu4
Copy link

@ryanwu4 ryanwu4 commented Dec 3, 2024

Resolves #1169 with implementation specifically for rectangular cross section self field. Includes class implementation for FourierPlanarFiniteBuild. Test implementation is still work in progress, inclusion in coil objective function is also work in progress. Includes a garbage jupyter notebook just to show how the function works.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@dpanici
Copy link
Collaborator

dpanici commented Dec 4, 2024

See CoilCoilMinDistance objective for masking logic for avoiding doing biot savart of a coil over itself.

@ryanwu4
Copy link
Author

ryanwu4 commented Dec 6, 2024

I identified the 2 issues preventing JAX grad:

  1. safenorm is necessary if eval points and coil points are the same, which is the case for the centerline self field. I changed the biot savart integral to do that, and also implemented an improved singularity-subtracted integral from the paper which should require fewer quad points, specifically for the compute_self_field function.
  2. NaNs appearing in the unregularized biot savart integral were screwing with the gradient as well. I now have compute_self_field output a mask of where centerline points are, and the maxNormB objective function ignores those points (in a kinda gross way). I decided to do this over having a biot-savart safemode flag where it regularizes for points close to a centerline since the latter is more computationally expensive and might not play well with JAX JIT control flow logic. We don't expect peak field conditions to be anywhere in the vicinity of the coil centerline in any case.

…nd fadding centerline masking for jacrev AD)
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

Successfully merging this pull request may close these issues.

finite-build coils
2 participants