The Grad–Shafranov equation (Vitalii Dmitrievich Shafranov (1957); H. Grad and H. Rubin (1958)) is the equilibrium equation in ideal magnetohydrodynamics (MHD) for a two dimensional plasma, for example the axisymmetric toroidal plasma in a tokamak. This equation takes the same form as the Hicks equation from fluid dynamics. This equation is a two-dimensional, nonlinear, elliptic partial differential equation obtained from the reduction of the ideal MHD equations to two dimensions, often for the case of toroidal axisymmetry (the case relevant in a tokamak). Taking
as the cylindrical coordinates, the flux function
is governed by the equation,

where
is the magnetic permeability,
is the pressure,
, and the magnetic field and current are, respectively, given by![{\displaystyle {\begin{aligned}\mathbf {B} &={\frac {1}{r}}\nabla \psi \times {\hat {\mathbf {e} }}_{\theta }+{\frac {F}{r}}{\hat {\mathbf {e} }}_{\theta },\\\mu _{0}\mathbf {J} &={\frac {1}{r}}{\frac {dF}{d\psi }}\nabla \psi \times {\hat {\mathbf {e} }}_{\theta }-\left[{\frac {\partial }{\partial r}}\left({\frac {1}{r}}{\frac {\partial \psi }{\partial r}}\right)+{\frac {1}{r}}{\frac {\partial ^{2}\psi }{\partial z^{2}}}\right]{\hat {\mathbf {e} }}_{\theta }.\end{aligned}}}](data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221%22%20height%3D%221%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3Ctitle%3E%7B%5Cdisplaystyle%20%7B%5Cbegin%7Baligned%7D%5Cmathbf%20%7BB%7D%20%26amp%3B%3D%7B%5Cfrac%20%7B1%7D%7Br%7D%7D%5Cnabla%20%5Cpsi%20%5Ctimes%20%7B%5Chat%20%7B%5Cmathbf%20%7Be%7D%20%7D%7D_%7B%5Ctheta%20%7D%2B%7B%5Cfrac%20%7BF%7D%7Br%7D%7D%7B%5Chat%20%7B%5Cmathbf%20%7Be%7D%20%7D%7D_%7B%5Ctheta%20%7D%2C%5C%5C%5Cmu%20_%7B0%7D%5Cmathbf%20%7BJ%7D%20%26amp%3B%3D%7B%5Cfrac%20%7B1%7D%7Br%7D%7D%7B%5Cfrac%20%7BdF%7D%7Bd%5Cpsi%20%7D%7D%5Cnabla%20%5Cpsi%20%5Ctimes%20%7B%5Chat%20%7B%5Cmathbf%20%7Be%7D%20%7D%7D_%7B%5Ctheta%20%7D-%5Cleft%5B%7B%5Cfrac%20%7B%5Cpartial%20%7D%7B%5Cpartial%20r%7D%7D%5Cleft(%7B%5Cfrac%20%7B1%7D%7Br%7D%7D%7B%5Cfrac%20%7B%5Cpartial%20%5Cpsi%20%7D%7B%5Cpartial%20r%7D%7D%5Cright)%2B%7B%5Cfrac%20%7B1%7D%7Br%7D%7D%7B%5Cfrac%20%7B%5Cpartial%20%5E%7B2%7D%5Cpsi%20%7D%7B%5Cpartial%20z%5E%7B2%7D%7D%7D%5Cright%5D%7B%5Chat%20%7B%5Cmathbf%20%7Be%7D%20%7D%7D_%7B%5Ctheta%20%7D.%5Cend%7Baligned%7D%7D%7D%3C%2Ftitle%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22transparent%22%2F%3E%3C%2Fsvg%3E)
The nature of the equilibrium, whether it be a tokamak, reversed field pinch, etc. is largely determined by the choices of the two functions
and
as well as the boundary conditions.