Baillod, A.Loizu, J.Graves, J. P.Landreman, M.2022-05-202022-05-202022-05-202022-04-2110.1063/5.0080809https://infoscience.epfl.ch/handle/20.500.14299/187934Good magnetic surfaces, as opposed to magnetic islands and chaotic field lines, are generally desirable for stellarators. In previous work, Landreman et al. [Phys. of Plasmas 28, 092505 (2021)] showed that equilibria computed by the Stepped-Pressure Equilibrium Code (SPEC) [Hudson et al., Phys. Plasmas 19, 112502 (2012)] could be optimized for good magnetic surfaces in vacuum. In this paper, we build upon their work to show the first finite-β, fixed- and free-boundary optimization of SPEC equilibria for good magnetic surfaces. The objective function is constructed with the Greene's residue of selected rational surfaces and the optimization is driven by the SIMSOPT framework [Landreman et al., J. Open Source Software 6, 3525 (2021)]. We show that the size of magnetic islands and the consequent regions occupied by chaotic field lines can be minimized in a classical stellarator geometry (rotating ellipse) by optimizing either the injected toroidal current profile, the shape of a perfectly conducting wall surrounding the plasma (fixed-boundary case), or the vacuum field produced by the coils (free-boundary case). This work shows that SPEC can be used as an equilibrium code both in a two-step or single-step stellarator optimization loop.stellaratoroptimizationchaosequilibriumplasmaStellarator optimization for nested magnetic surfaces at finite β and toroidal currenttext::journal::journal article::research article