$z$ dependence of the $B_y$ component in Figure 2(b). In this case, using a Gaussian functional form would not be satisfactory. Thus, a simple functional form does not have the versatility to model the wide variety of potential LGB magnetic fields.

At the sacrifice of simplicity, there does exist a class of model with the versatility to represent any magnetic field to arbitrary precision. Instead of using a functional form, we may fit the magnetic field data with a series of basis functions, just as one might model a wave phenomenon with a Fourier Series. Indeed, this provides maximal versatility, since any well-behaved function can be written as an infinite sum of suitable basis functions, so long as the set of basis functions is complete in the mathematical sense. Of course, one must terminate the series after a finite number of terms, but by including a larger and larger number of them, arbitrary precision may be achieved. This is the course taken in reference [@wiggler] to model wiggler and undulator magnets.\

Deriving a Suitable Set of Basis Functions
------------------------------------------

Now that the class of model has been chosen, the problem becomes finding a proper set of basis functions. In particular, 