project, we were given the task of fitting the magnetic field data of two different LGB prototypes. The LGB prototypes were developed by a group specializing in magnet design using a CAD program. CAD models for each component and their respective magnetic field maps are presented in Figures 1 and 2. Because the $B_x$ component for the C-shaped LGB is so small compared to the other components of the field ($\sim$10 times smaller than the $B_z$ component and $\sim$100 times smaller than $B_y$ component) and so disorderly, we took it to be noise, and set it to be zero before fitting to the complete field. On the other hand, the $B_x$ component for the canted solenoid LGB is not small enough to justify setting it to zero before fitting.

To perform the fitting, we coded equation (4) into MATLAB and employed one of its built-in optimizers. We had the option of using a trust-region-reflective algorithm or a Levenberg-Marquardt algorithm. A trust-region algorithm first approximates the function one wishes to optimize with a simpler function. It then proceeds to optimize this new function. In particular, the algorithm requires the function being optimized to have more components than fit parameters [@trust]. However, 