Analysis of equilibrium and topology of tokamak plasmas