Magnetic field from a ‘thick coil/solenoid’ or ‘annular conductor’ or &c.

It happens that the integrals for calculating the magnetic field from all but the simplest objects (cuboid and cylindrical magnets) quickly become very difficult to solve, and in most cases closed-form solutions are not known. But reducing the integral required to a simpler form makes a huge difference in whether the result can be efficiently calculated on a computer.

I was amused recently when looking into the literature on the magnet field produced by ‘thick coils’ — i.e., a coil winding with many turns both long and deep — to find at least one new paper every decade for the last five consecutive decades on essentially the same work (by different authors). Here’s a probably incomplete list:

I haven’t implemented any of them to evaluate whether they give consistent results; my testing of Ravaud’s 2010 integral seems to give good results so I’m happy enough with his work for now. (I’m using his integral to — attempt to — derive the force produced on a permanent magnet in the vicinity of the coil, so I haven’t written code to reproduce his work exactly.)

What I find interesting is that although the work has been generalised to some extent over the years (see, e.g., the 1982 paper in which only arc segments are considered) in each case an equation is presented to calculate the magnetic field and presumably they all give identical results (they’re just solutions to a certain integral, after all). But in each case the papers were deemed worthy of publication. Hopefully new researchers looking for such works don’t miss the newer — and hopefully more useful — ones!

It’s worth noting that the 2010 paper links to a location with the claim that you can download their Mathematica code containing their equations. (Although I can’t see it there right now—hurrumph.) I think that the proliferation of code for the reproduction of such works is one of the best things we can do to accelerate the progress of the academic world. I’ll have more to say about this sort of thing in the future.

Recent work in humanoid robotics

Since I graduated from Mechatronic engineering oh so many years ago, I sometimes regret not going into the field of robotics. It’s certainly an area I like to keep an eye on, even if our school here isn’t very strong in the area.

Now that I’m also keeping a toe in the water for Sports Engineering, I’m trying to collect as many examples as I can that form a bridge between mechatronics and sports eng., as it’s that connection that I’m ostensibly occasionally employed to expound to the students.

Recently there have been a few papers published on the analysis of bipedal/humanoid-style robots; I’m not intending to review them here but I’ll be keeping them in mind for the future.

Elliptic integrals in Matlab

In recent work, I was taking some equations out of a paper and needed to calculate elliptic integrals with parameter ranges outside the traditional. I hence stumbled into a world that I was only vaguely aware of and resolved to spend some time writing some Matlab code to help out others in my situation.

I didn’t exactly get very far, but I’ve had a summer research student working on the problem for me—and while we haven’t completely solved the problem, I hope what we’ve written is of some use to some one. The short of it is that if you need to calculate the complete or incomplete elliptic integrals in Matlab, you might find our elliptic123 function here to be useful.

The usual elliptic integrals you see are the incomplete elliptic integrals of the first, second, and third kinds, respectively,F(\phi|m) , E(\phi|m) , and \Pi(n;\phi|m) . They are referred to as complete when \phi=\pi/2 and denoted as K(\phi) , E(\phi) , and \Pi(n; m) in turn.

Of these, Matlab can calculate only K(m) and E(m) for parameter range 0\le m\le 1 using its [K,E]=ellipke(m) function.

It turns out that calculating \Pi(n;m) is very easy, and it’s a trivial task to extend Matlab’s ellipke to calculate the third complete elliptic integral using the a faster-than-quadratically converging algorithm involving the arithmetic-geometric mean.

However, calculating the incomplete elliptic integrals is a far more difficult task, and for this purpose we based our work on Igor Moiseev’s work; again his functions assumed small input ranges with 0\le\phi\le\pi/2 , 0\le m\le1 and 0\le n\le 1 . Using transformation formulae from the DLMF and other sources, we we able to extend these parameter ranges, in some cases, to be without bound.

The function we have written to do this can be called as

[K, E] = elliptic123(m)
[K, E, PI] = elliptic123(m,n)

in the complete case, and

[F, E] = elliptic123(m,phi)
[F, E, PI] = elliptic123(m,phi,n)

in the incomplete case.

The idea of this elliptic123 function is to provide a wrapper around these transformation formulae and the standard methods for calculating the integrals, but we didn’t achieve our goal of entirely unrestricting the input parameter ranges, as in Mathematica. (See the help text of the function for the exact ranges where our transformations failed.)

I believe the only way around these limitations is to implement the Carlson symmetry elliptic integrals and use them to calculate the traditional elliptic integrals, as has been done by Fredrik Johansson for mpmath. His Python code could be ported to Matlab with too much difficulty, I think. Alas, I am out of time for this project.