Variational methods for studying tokamak stability in the presence of a thin resistive wall | Synapse