MATLAB Herding

Language: MATLAB

Distributed Systems and Fields – Scalar Potential Lab

Objective: Apply scalar potential theory to design arrays of magnets and produce a useful spatial pattern of magnetic vector fields. During the lab, you will move one of your chosen arrays, turn by turn, across a game board toward a scattered group of four magnetic field sensors. The sensors will then be moved away from your magnet array, according to the measured strength and direction of the magnetic fields created by your array. Each turn, you may advance your array by a few squares while optionally re-deploying it into a different array. Your objective is to “gather” all of the magnetic sensors and “herd” them toward a specified location. Notionally, the scattered sensors are a flock of sheep to be guided back to their barn before an ice storm hits, and the magnets are your team of highly-trained Border Collies.

Pictured below are three plots (and their coding) correlating to one of eight spatial patterns of magnetic vector fields I developed in preparation for this lab.