Rules of Attraction: Improving the Design of Magnetic Field Control Systems - User Case Studies - Maplesoft

User Case Study: Rules of Attraction: Improving the Design of Magnetic Field Control Systems
Maple's multiprocessor support is helping to speed up and simplify the design of complex magnetic field control systems

Oxford Instruments was established in 1959 to manufacture superconducting magnets that would prove to be a key enabling technology in a host of applications ranging from medical imaging to industrial quality control. Since then the company has expanded its scope and designs, and it currently manufactures and supports a broad range of products for academic researchers and industrial users. With applications in fields such as superconducting physics, measurement and nanotechnology, Oxford Instruments today employs nearly 2,000 people at its Oxford headquarters and offices worldwide.

Magnets remain as important to Oxford Instruments today as they were when the business was founded. Among many industrial and research applications of magnet technology in the company’s portfolio is a range of bench top nuclear magnetic resonance (NMR) scanning devices. NMR techniques can be used to identify the chemical constituents of a sample of material, based on the tendency for nuclei located in a strong magnetic field to absorb and emit electromagnetic radiation. Oxford Instruments’ NMR devices are used for a broad range of measurements, including analysis of the oil content of seeds and foods, the composition of plastic materials and the fluoride content of toothpaste.

To work well, NMR devices require an exceptionally strong and regular magnetic field and Dr Cédric Hugon, a magnet engineer at the company, takes part in the development of the equipment required to deliver such fields. “The magnetic field we need for NMR must usually be as strong as possible, but even more importantly, it must be as homogeneous as possible across the whole sample to be analyzed,” he explains. “That means we want a field that varies between a few hundred parts per million in the simplest devices, down to a few parts per billion in the most sophisticated.”

The primary magnetic field in an NMR analyzer is usually generated by a permanent magnet, made from a ferrous or rare earth material. The first part of his job, Dr Hugon notes, is optimizing the geometry of the magnet to produce the best possible field. In practice, however, even the best magnets produce fields that must be ‘tuned’ to give appropriate characteristics for NMR equipment. This tuning is carried out by up to a dozen ‘shim coils’: electromagnets which are precisely controlled to even out imperfections in the field. After the shim coils, an NMR device will also use up to three ‘gradient coils’ which modify the magnetic field in three dimensions as a sample is scanned.

The design of these shim and gradient coils, and of the algorithms used to control them, is an extremely complex process, and it is for this that Dr. Hugon relies on Maplesoft’s technical computing software Maple. “Maple is good for this sort of complex work because it combines ease of use with a high level of control, which is particularly important when we are trying to optimize complex systems,’ he says.

Even though Maple makes the process of setting up the required calculations as straightforward as possible, the sheer complexity of the system still requires significant processing power, and that means it can be time consuming. “Some of my most complex optimizations were taking around half an hour to run,” notes Dr. Hugon, “And that can make the work slow and frustrating when on each run you may only be changing a single parameter to see what effect it has.”

In an effort to improve the speed of his analysis work, Dr. Hugon was advised to take advantage of Maple’s multiple processor capability. “I was very impressed with the support I received,” he recalls. “I sent a portion of my code to the technical support team and they made the changes required to run the calculations in parallel across multiple processor cores. They also helped me to adapt the same code later on to keep it working with the latest version of Maple.”

Since adapting his Maple worksheets to run on multiple processors Dr. Hugon estimates that the time taken to complete complex analyses has been roughly divided by three, dramatically improving the ease and speed at which optimizations can be carried out. “Maple is proving to be a powerful and versatile tool and we are constantly finding new uses for it as we tackle different projects,” he concludes.