Interpolation & Extrapolation


Here we consider the real-life example of making a model of the magnetic field everywhere inside a magnet given measurements in only a few places.


You are given the magnetic fields measured in Gauss along three axes. You need to build a 2D map of the magnetic field everywhere in the magnet at 1mm space intervals. For magnet dimensions and axis locations see attached drawing.


  1. Interpolation in 1-D. Interpolate the given data on the given axes to a 1mm spacing. What do you do at the end of the magnet itself? Try different conditions for the edge points, comment on what your choices do and which one works best. For around the “knot” points, try both high and low order functions. Comment on the differences (take things to extremes if you have to), and explain which works best for you and why.

  2. Extrapolation in 1-D. Extrapolate the fringe mangnetic fields out of the magnet along the given axes. Here you don't have much data, so you must make some physical choices and make a simple model of what will happen.

  3. Take it to 2-D. This is hard. Taking the given sparse, irregularly spaced data and throwing a 2-D interpolation function at it won't work. You will have to use the given data, make some physical assumptions, and do a hybrid interpo-/extrapo-lationfest to construct a reasonable grid before any sane canned function can fill in the gaps for you.


I'm less interested in the finished product (a 2-D field map inside the magnet) than I am the process of how you got it. After all, I did this already for real five or six years ago. Turns out that I got it wrong somehow (still not sure what went wrong, exactly) and the second prototype magnet they made based on my model didn't work well, costing my experiment some large but unknown number of mystery Yen. But, the next iteration magnet worked, and a detailed model of its field is used in our Monte Carlo simulation.


Save your maps when we're done, a future assignment will do the next step of seeing how the magnet operates on electrons.


Data files: