mindbf_gen.m
SYNTAX: [mut,br,bz,badindex] = mindbf_gen(ra,rb,za,zb,rdim,zdim,ndist,nsplit)
PURPOSE: Calculate mutual inductance, B_r, and B_z from a current source
"a" which is a coil carrying distributed current to a measurement point "b".
Note that the fields are calculated at point b due to current at point a.
Green functions are Henries and Tesla/Amp. This routine is a generalized
version of Dave Humphreys' mindbf.pro which handles carefully all the
problems that I could think of having to do with a distributed current
source and with points a and b close together.
INPUT:
ra,za = r and z coordinates of current source(s) (meters)
rb,zb = r and z coordinates of "measurement point(s)" (meters)
rdim = r dimension of rectangular distributed current element source(s) (m)
zdim = z dimension of rectangular distributed current element source(s) (m)
ndist = number of multiples of rdim in r dimension and zdim in z
dimension away from current element that a measurement point
point should be in order to use simple filament-to-filament
approximation (optional, default=3)
nsplit = number of pieces to split each coordinate (z,r) of current
source into for "near" calculation (optional, default=[8,8])
(Allows input of vectors of ra,za,rb,zb if size of a and b objects equal or one is scalar.)
OUTPUT:
mut = mutual inductance between 2 loops at locations (ra,za), (rb,zb)
(Henries)
br = multiplier of current at pt(s) a to produce radial field at pt(s) b
(Tesla/Amp)
bz = multiplier of current at pt(s) a to produce vertical field at pt(s) b
(Tesla/Amp)
badindex = if >= 0, index in input vector(s) for which elliptic integral
calculator could not give good value. This means values of
mut(badindex), br(badindex), and bz(badindex) are NOT VALID.
Note: I think I've fixed it so that a bad value is never returned, but I
want to leave this in for awhile so I can check if it's ever >=0.
RESTRICTIONS:
NOTE that this ASSUMES there will be AT MOST ONE instance of points
from the a and b vectors which are too close together to calculate responses
correctly.
If vector input, all vectors ra, rb, za, and zb must be same size. In this
case, output corresponds to pairings of elements in sets a and b.
For example, mut is calculated between (ra(k),za(k)) and (rb(k),zb(k)), but
not between (ra(k),za(k)) and (rb(j),zb(j)) for j different from k.
NOTE: A number of "divide by 0" messages may be generated on first pass
of some calculations. These are fixed later on by recomputation of
data for "too close" points.
Dependencies