A demonstration of magnetic field optimization in LHD