Computing Hr and Hz from Magnetic potential

Click For Summary

Discussion Overview

The discussion centers around the computation of magnetic field values Hr and Hz from the magnetic vector potential A, particularly in the context of using FEMM software for finite element analysis. Participants explore the relationship between the vector potential and magnetic fields, as well as the specifics of the data format in FEMM's output files.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant seeks to understand how to compute Hr and Hz from the magnetic vector potential A provided in FEMM's output files.
  • Another participant notes that the magnetic field B is the curl of the vector potential A, suggesting that direct calculation from A requires knowledge of the spatial derivatives and locations of the potential points.
  • A participant clarifies the structure of the .ans file, explaining that it contains nodal values of the vector potential and that FEMM's postprocessor computes the magnetic field values from these potentials.
  • Discussion includes the complexity introduced by the finite element method (FEM), which uses basis functions to interpolate vector potential values over mesh patches, complicating the extraction of magnetic field values.
  • One participant expresses a desire to bypass the .ans file by using a Lua script to directly retrieve Hr and Hz values generated by FEMM's solver.

Areas of Agreement / Disagreement

Participants generally agree on the relationship between the vector potential and magnetic fields, but there is no consensus on the specific methods to compute Hr and Hz from A, and the discussion remains unresolved regarding the exact processes used by FEMM.

Contextual Notes

Participants mention the need for knowledge of the basis functions used in FEM to accurately compute magnetic fields from vector potentials, indicating that further mathematical steps may be necessary to fully understand the computations involved.

rsr_life
Messages
48
Reaction score
0
Hello everybody,

My question to you is how can I compute the values of Hr and Hz given the value of A - the magnetic vector potential.

The reason I seek this: I'm using the FEMM software to obtain the H values at points around a solenoid. The .ans file that FEMM creates has a huge list of numbers which I found to be the magnetic potential. FEMM manages to retrieve the values of Hr and Hz from this list of Magnetic potential values.

Here's a sample of the .ans file:

...
[Solution]
2941
1.2085532825853653 4.0843637420137959 -3.9469544215389256e-005
1.1273460445780257 4.3874332801995255 -7.8792243048921603e-006
1.3411542731880106 3.7999999999999998 -7.0806330952824349e-005
1.4562831499937583 4.2684393799265425 -3.0708797381233563e-005
1.1000000000000001 4.7000000000000002 2.6544667022034454e-005
1.4823341543420145 4.5759703098370341 8.5327589548402048e-006
1.52112000238584 3.5429823025642291 -9.6872108040739851e-005
...

The first column is the r value, the second the z value and the third is our A.

I need to compute Hr and Hz (or Hx and Hy in the planar case) so that I can use Matlab directly on the .ans file that FEMM creates.

Seems simple enough, but how do I do this? Can somebody point me to the formula, OR if you know FEMM well, can you explain the .ans file for me?

Thanks,

-rsr_life.
 
Physics news on Phys.org
The B field is the curl of the vector potential. You cannot calculate this directly from just given vector potential values. You could estimate the derivatives using finite-difference, but you would need to know the location of each vector potential point. I do not understand your results, A is a vector. Do you know only the magnitude and location of A, or do you know the direction and magnitude of A but not the location?
 
Born2bwire,

Thanks for that. I was aware of the equation you mentioned, which was why I was confused as to how FEMM managed to compute the values of H/B from A given the data I've posted.

To answer your query, the first number 2941 is the number of nodes in the mesh. Then, the first column is the r, the second column is the z, (or x and y) of the respective node, and the third column is the nodal value of magnetic potential - A in the case of a planar type model, [tex]\Phi[/tex] = 2*[tex]\pi[/tex]*r*A in the case of an axisymmetric problem.

But, as it turns out,

"... I’d also written a verbal explanation a while ago at http://www.femm.info/list/msg00360.html that’s still pretty much accurate.

However, the information in the .ans file is nodal values of vector potential. The post processor does some work to get values of B and H from the vector potential—these quantities are not stored in the file. ..."


to quote FEMM author David Meeker, who responded to an email I'd sent. Matlab, only calls on FEMM to pass the values of Hr and Hz by pointing to the .ans postprocess file. FEMM's postprocessor still does the computation by itself, using the values of A directly from the .ans file.

Finally, to quote the author again,

If you’re interested in reverse-engineering the solution file format, the best thing to do is just look at the source code that reads in the .ans file. If you download the source, the routine that does it is OnOpenDocument in FemmviewDoc.cpp, which lives in the femm subdirectory of the source code.

For future reference, I will look at the file and update this post on how the computation is done.

But if somebody knows how that could possibly be done, you could still suggest ideas here while I update you guys.
 
Ahh, it is an FEM code. That complicates things then. Because in FEM, you would have a vector basis function that interpolates the value of the vector potential over the patch. What you have solved for is the signed magnitude of the vector potential that is interpolated over the patch. If you knew the basis function of a patch, you could take the curl of the basis function and apply the solved A to find the magnetic field over the patch.

For example, in a method of moments solver, we use the RWG basis function on triangular patches. We solve for a single value for the current, but the current is defined as:

[tex]\mathbf{J}_n = J_n \frac{L_n}{2A_n^\pm}\boldsymbol{\rho}^\pm(\mathbf{r})[/tex]

What all this means is immaterial. It is suffice for you to know that the vector \rho is a vector that points from the vertex of our mesh triangle into the interior of the patch. This vector is the local current vector, we have only solved for a weight on this vector. So if we wanted to know the actual current, we would have to do more math to find the vector currents at the desired points on each mesh element. If we want to find the charge density on the element, we take the divergence of the current which is

[tex]\nabla\cdot\mathbf{J_n } = \mp \frac{L_n}{A_n^\pm}[/tex]

In a similar way we would take the curl of your basis function to find the associated B field. So having solved for the weights for the basis functions you see that you need to go even further to actually get the real vector potential or magnetic field values.
 
Ok... wow. That helps a lot. Thanks. This is precisely the reason I post queries here.

At this stage, I'm attempting to simply retrieve values of Hr & Hz that FEMM's solver generates into a .mat/.csv file - thus bypassing the solver result .ans file completely - using a Lua script (which is compiled into FEMM and is then much faster) and thankfully, for the moment at least, I don't need to work at the level of detail you seem good at. Will be taking my FEM classes next semester - for now, I'm content at just manipulating things at a higher level.

Thanks again. Will keep you guys posted.
 
Last edited:

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 37 ·
2
Replies
37
Views
7K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K