Halbach array and multipole feature #491
Replies: 8 comments 20 replies
-
Its my understanding that Discrete Halbach Arrays are mostly used to create strong homogeneous fields with off-the-shelf magnets. There are tons of papers with various designs that look like this Small and large diameters, a variety of magnet numbers (6-50) per ring, single rings, nested rings, stacks, and so on. But all Halbachs iv'e seen so far follow the original Halbach magnetization pattern Cos(2\phi) - and depending on how the (axially magnetized) magnets must be rotated, lower and higher filling fractions, fields and homogeneity are achieved. Some Magpylib developers(myself, @Alexboiboi, @pribossek) have been using such arrays and we all have our own codes. I think we all agree that developing a Magpylib Halbach Class would be extremely beneficial. Currently we are quite busy to complete the v4 release, but for v4.1 or 4.2 I think that there should be such a Halbach class - also some of our research goes in this direction. However, this will require a lot of work in terms of
I think it would make a lot of sense to outline in this discussion what should be the format of the Halbach class, and I'd be happy if everyone participated in this discussion. @BillyTheKidPhysicist sincerely, |
Beta Was this translation helpful? Give feedback.
-
2+3: Its likely that the symmetry of your problem results in a similar lens field amplitude extremum position when you include material interaction, but that the field gradient ("lens curvature" that you also show above) is changed a little. Yes you can deal with this problem with Magpylib at 3 stages - each stage leads to more precision, but also more computational effort. First stage: only include the magnet self-interaction by simply reducing the magnetization by the demagnetization factor 2nd stage: Include the magnet-magnet interaction. You have 24 magnets, this will result in 24x24 matrix diagonalization (piece of cake even for your m1). This will fix the homogeneous contribution to the demagnetization which typically accounts for a large part of the effect. 3rd stage: Split up every Magnet into a lot of small pieces and compute the compute the full interaction. If you split up every magnet into 10x10x10 pieces you will have to diagonalize a dense 24000x24000 matrix ... which is where things become slow. I solve 10k pieces (in total) within a few minutes on my 4 core i5 laptop. In the worst case you can let the solver run for a while for some fine discretization, just to understand your error. I'll review the code that I have tomorrow and send it to you by email - it's kind of simple - you just apply it to a Collection, hand it a material parameter xi, and it adjusts the object magnetization vectors. 4 : We optimize and calibrate magnetic position systems. We always have magnets and sensors around with a lot of tolerances - usually not more than 20-30. For this DE works like a charm. pygmo is a pretty cool package if you want more sophisticated DE and more parallelization. 5: Well I imagine just a short story to get ppl interested. And its always cool to know that this is real stuff - so a nice photo would help. An outline could be Magnetic lenses for particle accelerator and storage rings
We could make a magpylib github branch and just add a blank example file to the doku where you can work. If you feel uncomfortable with markdown you could just post the text in here and I add it, or send me a text file. Probably I would help with magnetic field visualization - maybe we do something like this: |
Beta Was this translation helpful? Give feedback.
-
In terms of fitting into Magpylib , should I think of a Halbach array (in this case a hexapole lens to get started) as a wrapper around a Collection object, or some other abstraction? I'm refactoring my code to apply the method of moments to a bending segment. My previous approach to the bending segment did not allow for this in a reasonable manner. |
Beta Was this translation helpful? Give feedback.
-
Hello all,
I have the complete Halbach class implementation covering more or less the
entire functionality summarized in the last post from Michael. Few extra
goodies are included as well. The class was written to work with a
pre-release of the MagPylib3, so probably it has to be slightly adapted to
newest changes introduced with the latest version, which I have not been
closely following over the last year.
@michael: if there is enough interest, I can file a PR or we can review the
functionality in the upcoming days together.
Regards,
Jaka Pribosek
V V sob., 26. mar. 2022 ob 19:10 je oseba mortner ***@***.***>
napisala:
… ok so what properties would one ring have ?
- magnet base form, str, e.g. 'Cuboid', 'Cylinder', ...
- number of magnets, int n, (equidistant spacing by default)
- magnet dimension, array_like, shape (d,) or (n,d), single dimension
or array_like with n individual dimensions to deal with variations between
magnets
- ring radius, float
- ring position on z-axis, float
- halbach magnetzation type: int? (2pi, 4pi, 6pi ...), i think this
would cover our use cases
- individual magnet position variations, array_like, shape (n,3),
should probably be in cylindrical coordinates (dr, dphi, dz)
- individual magnet orientation variations, scipy rotation object with
length n
i think this would cover it for our purposes ... what do you think ?
—
Reply to this email directly, view it on GitHub
<#491 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIHNA26W5QXNFOZFNYFQS3VB5HINANCNFSM5QNDGDGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
|
Beta Was this translation helpful? Give feedback.
-
Hi @pribossek and @BillyTheKidPhysicist I think it would be great to work on such a PR together. @pribossek my proposal is mostly based on the implementation you showed me some time ago. But I think we should first discuss all the features in detail - there might be some missing that would be critical for the problem of @BillyTheKidPhysicist, who introduces yet another new use case. Also, the new Halbach class should follow the compound philosophy outlined in the new Magpylib guidelines. They are not published yet - but we are very close to the release. Once its out I would like to focus more on the Halbach problem. @pribossek can you outline what functionality is missing in my first proposal ? @BillyTheKidPhysicist can you please review the functionality and comment on missing features that come to your mind ? What do you mean by "superposition of multipoles" ? |
Beta Was this translation helpful? Give feedback.
-
@MOrtner I can confirm that current class implementation include all
functionality you have summarized. There are some extra goodies, in-built
export to CAD, in-built methods for magnetic field evaluation
(inhomogeneity and some other statistics) etc. Some simple and fast
in-built geometry optimizer might be nice too. This was already
implemented, but later removed because of increased class complexity.
Still, I believe it can be useful in daily work with Halbach systems.
In my view, what is missing is the following:
Current class constructs systems in the XY plane. I can imagine, a real
application would demand to arrange several such Halbach rings into a 3D
arrangement as in @BillyTheKidPhysicist example few posts above. This is
currently not supported in my class.
What a user can do of course is to use Halbach class to generate a
Collection and further manipulate this collection using in-built scipy
rotation class. However, most of the functionality of the Halbach class is
then lost (field evaluation, export, individual magnet pose definition..)
Yet, I think it might be a benefit, if we expand current Collections to be
able to take Halbach objects as well. This should probably be quite easy,
because Halbach objects are Collections themselves. I am not sure if in
current MagPyLib version Collections class can manipulate subcollections,
but I imagine this would find also many other nice applications. This way,
one would have the possibility to arrange group of rings in a 3D space
freely, yet maintain the functionality to manipulate each such ring in its
respective native plane.
@MOrtner: I don't know what you mean by compound philosophy. Can you
elaborate a bit?
@BillyTheKidPhysicist: yes, multipoles are supported.
V V tor., 29. mar. 2022 ob 22:27 je oseba mortner ***@***.***>
napisala:
… Hi @pribossek <https://github.com/pribossek> and @BillyTheKidPhysicist
<https://github.com/BillyTheKidPhysicist>
I think it would be great to work on such a PR together. @pribossek
<https://github.com/pribossek> my proposal is mostly based on the
implementation you showed me some time ago. But I think we should first
discuss all the features in detail - there might be some missing that would
be critical for the problem of @BillyTheKidPhysicist
<https://github.com/BillyTheKidPhysicist>, who introduces yet another new
use case.
Also, the new Halbach class should follow the compound philosophy outlined
in the new Magpylib guidelines. They are not published yet - but we are
very close to the release. Once its out I would like to focus more on the
Halbach problem.
@pribossek <https://github.com/pribossek> can you outline what
functionality is missing in my first proposal ?
@BillyTheKidPhysicist <https://github.com/BillyTheKidPhysicist> can you
please review the functionality and comment on missing features that come
to your mind ?
—
Reply to this email directly, view it on GitHub
<#491 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIHNA6L7OS5I67OJSNSDOLVCNRRFANCNFSM5QNDGDGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
|
Beta Was this translation helpful? Give feedback.
-
@OrtnerMichael @pribossek source: [Halbach Magnets for CBETA, D. Trbojevic et al., Brookhaven National Lab] |
Beta Was this translation helpful? Give feedback.
-
New list (because the other one is hidden in the answers)
|
Beta Was this translation helpful? Give feedback.
-
Halbach arrays are configurations of permanent magnets that allow for field amplification/attenuation, and the construction of multipole magnets [1]. With Halbach arrays a magnetic field can be generated with off the shelf permanent magnets with values nearly twice the remnant field value. Halbach arrays also allow for the construction of low cost permanent multipole fields for use in accelerators or atom optics. A version of this would be great in magpylib, and I imagine many people would appreciate it. I have a simple version of a sextuple halbach array magnet composed of magpylib cuboids (previously boxes) that I actively use in my simulations. It's a simple matter to implement and requires only rotating and positioning cuboids.
Currently the field is calculated from each cuboid, but I think a more efficient approach would be to use a single cuboid and pass an array of coordinates which exploit symmetry. Additionally, a feature which searches for wether the remnance is being exceeded by fields would be a nice feature eventually because that is a problem with multiple layers. I've attached an image of a sextuple field in figure for an upcoming publication.
Does this seem reasonable?
0
Beta Was this translation helpful? Give feedback.
All reactions