I created a tokamak fusion reactor simulation in Matlab. It demonstrates how charged high-energy particles can be held in a magnetic bottle (the Tokamak), without touching its walls and
melting them due to extremely high temperatures. The magnetic field has a very complicated shape, as it is created by multiple current coils and a rotating charged plasma cloud.
A simplified version of the code is available on GitHub