A gas model made of magnets