Plasma confining with magnetic fields

How is it possible to confine plasma inside a container? I know that plasma consists of a mix of charged particles, electrons, and the positively charged ionized atoms. Researching, I have found out that the Lorentz force (because of an acting magnetic field) is an important principle used plasma propulsion (which results in circular acceleration), and then is transformed into linear momentum to produce thrust. So if you had a gas, for example, hydrogen, for simplicity, which was then ionized and turned into plasma, it would then consist in a positively charged nuclei, and negatively charged electrons. If you desired to confine that plasma, to prevent it from contacting the container's border, you would use a magnetic field, with either the negative or positive pole surrounding the plasma container (supposing multiple magnets around the container), but it would then repel the nuclei if the positive side was facing the container, and attract the electrons (probably damaging the container), the same applying vice versa. Note: this is not homework.

• the reasons why this is almost impossible are given in Seife's book about the history of artificial fusion power. Commented Jan 13, 2018 at 15:46
• Would a spiraling (electro)magnetic field be a possible solution to confining plasma? Or would it just result in the ions finally colliding against the container's border? Commented Jan 13, 2018 at 17:12
• all sorts of things have been tried and failed. see anna v's comments below. Commented Jan 13, 2018 at 19:17
• The basic idea would be to have the magnetic field lines wound inside the chamber avoiding its walls, but the particles don't exactly spiral around the magnetic field lines and, as niels said, there are considerable difficulties due to, among other things, several instabilities in the system. Commented Jan 14, 2018 at 10:27

negative or positive pole [...] would then repel the nuclei if the positive side was facing the container, and attract the electrons

The poles of a magnet are not electric charges. There's actually a deep, beautiful connection between the electric and magnetic forces, but for now consider them independent: a force originating from electric charges, and a force from magnets, whose poles are called North or South according to how they align with the Earth's magnetic field.

The most important ingredient, then, is the behavior of electrically charged particles in a magnetic field, which is given by the Lorentz force: A positive charge moving to the right through a magnetic field coming straight out of the screen will be curved down:

If the charged particle moves in the same direction as the magnetic field, there's no such force. And, in the general case, the particle will tend to spiral around the magnetic lines:

Knowing that, the outline of what it means to confine plasma magnetically is already in anna's answer, namely, to have the magnetic field lines wound inside the chamber in such a way as to keep away from the wall the particles spiraling around the field lines. As anna and niels point out, there are considerable difficulties due to, among other things, the fact that the particles only approximately follow the lines, as well as several instabilities in the system - not to mention that confining the plasma is only one of the requirements, you also want, for example, high enough plasma densities and temperatures.

The way plasma can be confined is by designing complicated magnetic field lines.

The plasma particles, positive or negative, spiral around those lines and thus can be manipulated and a geometry that does not touch the walls designed.

It is difficult to contain high energy plasma. For example see this article on Tokamaks which are used for nuclear fusion reactors that depend on plasma physics.