------------------------------------------------------------ | Data for | | | | "Improved stellarator permanent magnet designs | | through combined discrete and continuous optimizations" | | | | K. C. Hammond and A. A. Kaptanoglu | ------------------------------------------------------------ Author information: Kenneth C. Hammond Princeton Plasma Physics Laboratory 100 Stellarator Road, Princeton, NJ 08540, USA Email: khammond@pppl.gov ORCID: 0000-0002-1104-4434 Alan A. Kaptanoglu Courant Institute of Mathematical Sciences, New York University 251 Mercer Street, New York, N.Y. 10012, USA ORCID: 0000-0002-6337-2907 This study was carried out from approx. December 2022 through January 2024. Methodology for data collection are described in the associated journal publication: https://doi.org/10.1016/j.cpc.2024.109127 Data are stored at Princeton University, Princeton, NJ, USA. This work was supported by the U.S. Department of Energy under contract number DE-AC02-09CH11466 and award number DE-FG02-93ER54197. The U.S. Government retains a non-exclusive, paid-up, irrevocable, world-wide license to publish or reproduce the published form of this manuscript, or alow others to do so, for U.S. Government purposes. Software used ------------- This work employed the following software: Simsopt: stellarator optimization code (used version 0.20.0) Documentation: https://simsopt.readthedocs.io/en/latest/index.html# Latest source code: https://github.com/hiddenSymmetries/simsopt DOI for v0.20.0: 10.5281/zenodo.4741269 STELLOPT: suite of stellarator optimization and modeling codes This study specifically utilized VMEC2000, BOOZ_XFORM, and NEO. Documentation: https://princetonuniversity.github.io/STELLOPT/STELLOPT.html Source code: https://github.com/PrincetonUniversity/STELLOPT FAMUS: permanent magnet optimization code For access, contact the author. MAGPIE: permanent magnet geometric design code For access, contact the author. Description of files -------------------- The data in this directory are organized in subfolders, most of which correspond to figures in the associated publication. In addition, the folder Plotting contains a Matlab plotting script, and the folder Simsopt_Example contains files for running an example Greedy Permanent Magnet Optimization with Simsopt. Details are described below. Figure_02 --------- fig2_vectors.csv: CSV-formatted file with the following columns: vx: Cartesian x component of each vector in Figure 2 vy: Cartesian y component of each vector in Figure 2 vz: Cartesian z component of each vector in Figure 2 Figure_03 --------- rc_dipole_solution.focus FOCUS/FAMUS-formatted input file specifying the magnet data for the RC solution plotted in this figure. fig3_moments.csv: CSV-formatted file giving the locations and dipole moments of each magnet in the solution shown in Figure 3. Note that the file contains many magnets with dipole moments of zero; these correspond to empty/unused positions in the solution space and are not shown in the figures. The columns are as follows: ox: Cartesian x coordinate [m] of the centroid of each magnet oy: Cartesian y coordinate [m] of the centroid of each magnet oz: Cartesian z coordinate [m] of the centroid of each magnet mx: Cartesian x component [A*m^2] of the dipole moment of each magnet my: Cartesian y component [A*m^2] of the dipole moment of each magnet mz: Cartesian z component [A*m^2] the dipole moment of each magnet (as shown in subplot c) mr: Cylindrical r component [A*m^2] of the dipole moment of each magnet (as shown in subplot a) mp: Cylindrical phi component [A*m^2] of the dipole moment of each magnet (as shown in subplot b) fig3_vertices.csv: CSV-formatted file providing the spatial coordinates for the vertices of each (cubic) magnet. Each row of this file corresponds to the dipole in the same row of fig_moment_data.csv, including magnets with dipole moments of zero. The columns are as follows: xt1, yt1, zt1, xt2, yt2, zt2, xt3, yt3, zt3, xt4, yt4, zt4, xb1, yb1, zb1, xb2, yb2, zb2, xb3, yb3, zb3, xb4, yb4, zb4 These correspond to the x, y, and z coordinates, in meters, of the 8 vertices (four "top" (t) vertices and four "bottom" (b) vertices). Viewed from the bottom face, the vertex numbers 1-4 are ordered counterclockwise about the face. Vertex 1 on the bottom face is connected via an edge to vertex 1 on the top face, etc. (see below). View toward View toward bottom face top face b4-------b3 t3-------t4 | bottom | | top | | | | | b1-------b2 t2-------t1 To visualize the solution in MATLAB, using the function qhex.m in the Plotting directory (make sure the MATLAB environment is in the Plotting directory when running): geomData3 = readtable('../Figure_03/fig3_vertices.csv'); momentData3 = readtable('../Figure_03/fig3_moments.csv'); sqMoment3 = momentData3.mx.^2 + momentData3.my.^2 + momentData3.mz.^2; inds = sqMoment3 ~= 0; % Select magnets with nonzero moments fvMagnets3 = qhex(table2array(geomData3(inds,:)), momentData3.mr(inds)); figure(); patch(fvMagnets3, 'FaceColor', 'flat'); set(gca, 'DataAspectRatio', [1 1 1]); The above code will color the magnets according to the cylindrical r component of their dipole moments, as shown in Figure 11a. To color according to the phi or z components, change the second argument of the call to the `qhex` function to `momentData.mp` or `momentData.mz`, respectively. Figure_04 --------- CSV-formatted files providing the optimization characteristics plotted in Figures 4a and 4b. For each file, the columns are as follows: iteration: iteration number quantity: number of magnets per half-period at the given iteration f_B: value of the f_B objective [T^2*m^2] at the given iteration Files are as follows: fig4_no_bt.csv: GPMO with no backtracking fig4_045deg_na020.csv: GPMOb with theta_thresh=45deg, N_adj=20 fig4_090deg_na124.csv: GPMOb with theta_thresh=90deg, N_adj=124 fig4_135deg_na124.csv: GPMOb with theta_thresh=135deg, N_adj=124 The data point for the RC solution in Fig. 4a has the following coordinates: quantity = 35436 f_B = 1.203264e-4 T^2*m^2 Figure_05 --------- gpmob_dipole_solution.focus FOCUS/FAMUS-formatted input file specifying the magnet data for the GPMOb solution plotted in this figure. fig5_moments.csv: CSV-formatted file giving the locations and dipole moments of each magnet in the solution shown in Figure 5. Note that the file contains many magnets with dipole moments of zero; these correspond to empty/unused positions in the solution space and are not shown in the figures. The columns are as follows: ox: Cartesian x coordinate [m] of the centroid of each magnet oy: Cartesian y coordinate [m] of the centroid of each magnet oz: Cartesian z coordinate [m] of the centroid of each magnet mx: Cartesian x component [A*m^2] of the dipole moment of each magnet my: Cartesian y component [A*m^2] of the dipole moment of each magnet mz: Cartesian z component [A*m^2] the dipole moment of each magnet (as shown in subplot c) mr: Cylindrical r component [A*m^2] of the dipole moment of each magnet (as shown in subplot a) mp: Cylindrical phi component [A*m^2] of the dipole moment of each magnet (as shown in subplot b) fig5_vertices.csv: CSV-formatted file providing the spatial coordinates for the vertices of each (cubic) magnet. Each row of this file corresponds to the dipole in the same row of fig_moment_data.csv, including magnets with dipole moments of zero. The columns are as follows: xt1, yt1, zt1, xt2, yt2, zt2, xt3, yt3, zt3, xt4, yt4, zt4, xb1, yb1, zb1, xb2, yb2, zb2, xb3, yb3, zb3, xb4, yb4, zb4 These correspond to the x, y, and z coordinates, in meters, of the 8 vertices (four "top" (t) vertices and four "bottom" (b) vertices). Viewed from the bottom face, the vertex numbers 1-4 are ordered counterclockwise about the face. Vertex 1 on the bottom face is connected via an edge to vertex 1 on the top face, etc. (see below). View toward View toward bottom face top face b4-------b3 t3-------t4 | bottom | | top | | | | | b1-------b2 t2-------t1 To visualize the solution in MATLAB, using the function qhex.m in the Plotting directory (make sure the MATLAB environment is in the Plotting directory when running): geomData5 = readtable('../Figure_05/fig5_vertices.csv'); momentData5 = readtable('../Figure_05/fig5_moments.csv'); sqMoment5 = momentData5.mx.^2 + momentData5.my.^2 + momentData5.mz.^2; inds = sqMoment5 ~= 0; % Select magnets with nonzero moments fvMagnets5 = qhex(table2array(geomData5(inds,:)), momentData5.mr(inds)); figure(); patch(fvMagnets5, 'FaceColor', 'flat'); set(gca, 'DataAspectRatio', [1 1 1]); The above code will color the magnets according to the cylindrical r component of their dipole moments, as shown in Figure 11a. To color according to the phi or z components, change the second argument of the call to the `qhex` function to `momentData.mp` or `momentData.mz`, respectively. Figure_06 --------- Contains CSV-formatted files with the optimization characteristics plotted in Figure 6. The columns in each file are as follows: iteration: iteration number quantity: number of magnets per half-period at the given iteration f_B: value of the f_B objective [T^2*m^2] at the given iteration Files are as follows: fig6_045deg_na006.csv: optimization with theta_thresh=45deg and n_adj=6 fig6_045deg_na026.csv: optimization with theta_thresh=45deg and n_adj=26 fig6_045deg_na050.csv: optimization with theta_thresh=45deg and n_adj=50 Figure_07 --------- fig7_data.csv: CSV-formatted file containing the data shown in the bar plots. Each row corresponds to one GPMOb run with a given theta_thresh and n_adj. Columns are as follows: theta_thresh: threshold angle [degrees] used for the GPMOb run n_adj: N_adjacent used for the GPMOb run f_B: value of the f_B objective [T^2*m^2] quantity: number of magnets per half period f_B_rel: value of f_B relative to the value for the RC solution quantity_rel: magnet quantity per half period relative to the RC solution Figure_08 --------- Contains CSV-formatted files with the optimization characteristics plotted in Figure 8. The columns in each file are as follows: iteration: iteration number quantity: number of magnets per half-period at the given iteration f_B: value of the f_B objective [T^2*m^2] at the given iteration Files are as follows: fig8_045deg_na026.csv: optimization with theta_thresh=45deg and n_adj=26 fig8_060deg_na015.csv: optimization with theta_thresh=60deg and n_adj=15 fig8_090deg_na050.csv: optimization with theta_thresh=90deg and n_adj=50 The coordinates of gray square, representing the result of the initial GPMOb run with theta_thresh=45 and n_adj=26 are: quantity: 24858 f_B: 2.45052808e-04 T^2*m^2 Figure_09 --------- Contains two CSV-formatted files with solution comparison metrics as plotted in Figure 9. Each file characterizes the differences between solutions from an earlier stage and a later stage ox: Cartesian x coordinate [m] of the centroid of each magnet oy: Cartesian y coordinate [m] of the centroid of each magnet oz: Cartesian z coordinate [m] of the centroid of each magnet added: 1 if a new magnet was added at this location in the later stage; 0 otherwise rotated: 1 if a magnet was present at this location in both stages but its dipole moment direction changed; 0 otherwise deleted: 1 if a magnet was present at this location in the earlier stage but was removed in the later stage; 0 otherwise absent: 1 if no magnet was present in this location in either stage; 0 otherwise angle: If rotated==1, provides the angle in degrees by which the dipole moment vector was rotated from the earlier stage to the later. If rotated==0, angle is 0. The files are as follows: fig9a_diff_stage1_stage2.csv: difference data from stage 1 to stage 2 as shown in Figure 9a fig9b_diff_stage2_stage3.csv: difference data from stage 2 to stage 3 as shown in Figure 9b The data on the solutions for each of the three stages can be found in the directory Figure_11 as described below. Figure_10 --------- fig10_data.csv: CSV-formatted file containing the data shown in the bar plots. Each row corresponds to one GPMOb run with a given theta_thresh and n_adj. Columns are as follows: theta_thresh: threshold angle [degrees] used for the GPMOb run n_adj: N_adjacent used for the GPMOb run f_B: value of the f_B objective [T^2*m^2] quantity: number of magnets per half period f_B_rel: value of f_B relative to the value for the RC solution quantity_rel: magnet quantity per half period relative to the RC solution Figure_11 --------- grg_stage1_dipole_solution.focus FOCUS/FAMUS-formatted input file specifying the magnet data for the first stage of the three-stage solution (GPMOb with thresh_angle=45deg and n_adj=26, initialized with an empty magnet array). grg_stage2_dipole_solution.focus FOCUS/FAMUS-formatted input file specifying the magnet data for the second stage of the three-stage solution (RC initialized to the stage-1 solution above, with the constraint that unused positions from stage 1 must remain unused). This solution is sometimes referred to as "GPMOb-RC" in the paper. grg_stage3_dipole_solution.focus FOCUS/FAMUS-formatted input file specifying the magnet data for the third and final stage of the three-stage solution (GPMOb initialized to the stage-2 solution above). This solution is sometimes referred to as "GPMOb-RC-GPMOb" in the paper. fig11_moments.csv: CSV-formatted file giving the locations and dipole moments of each magnet in the solution shown in Figure 11. Note that the file contains many magnets with dipole moments of zero; these correspond to empty/unused positions in the solution space and are not shown in the figures. The columns are as follows: ox: Cartesian x coordinate [m] of the centroid of each magnet oy: Cartesian y coordinate [m] of the centroid of each magnet oz: Cartesian z coordinate [m] of the centroid of each magnet mx: Cartesian x component [A*m^2] of the dipole moment of each magnet my: Cartesian y component [A*m^2] of the dipole moment of each magnet mz: Cartesian z component [A*m^2] the dipole moment of each magnet (as shown in subplot c) mr: Cylindrical r component [A*m^2] of the dipole moment of each magnet (as shown in subplot a) mp: Cylindrical phi component [A*m^2] of the dipole moment of each magnet (as shown in subplot b) fig11_vertices.csv: CSV-formatted file providing the spatial coordinates for the vertices of each (cubic) magnet. Each row of this file corresponds to the dipole in the same row of fig_moment_data.csv, including magnets with dipole moments of zero. The columns are as follows: xt1, yt1, zt1, xt2, yt2, zt2, xt3, yt3, zt3, xt4, yt4, zt4, xb1, yb1, zb1, xb2, yb2, zb2, xb3, yb3, zb3, xb4, yb4, zb4 These correspond to the x, y, and z coordinates, in meters, of the 8 vertices (four "top" (t) vertices and four "bottom" (b) vertices). Viewed from the bottom face, the vertex numbers 1-4 are ordered counterclockwise about the face. Vertex 1 on the bottom face is connected via an edge to vertex 1 on the top face, etc. (see below). View toward View toward bottom face top face b4-------b3 t3-------t4 | bottom | | top | | | | | b1-------b2 t2-------t1 To visualize the solution in MATLAB, using the function qhex.m in the Plotting directory (make sure the MATLAB environment is in the Plotting directory when running): geomData11 = readtable('../Figure_11/fig11_vertices.csv'); momentData11 = readtable('../Figure_11/fig11_moments.csv'); sqMoment11 = momentData11.mx.^2 + momentData11.my.^2 + momentData11.mz.^2; inds = sqMoment11 ~= 0; % Select magnets with nonzero moments fvMagnets11 = qhex(table2array(geomData11(inds,:)), momentData11.mr(inds)); figure(); patch(fvMagnets11, 'FaceColor', 'flat'); set(gca, 'DataAspectRatio', [1 1 1]); The above code will color the magnets according to the cylindrical r component of their dipole moments, as shown in Figure 11a. To color according to the phi or z components, change the second argument of the call to the `qhex` function to `momentData.mp` or `momentData.mz`, respectively. Figure_12 --------- fig12a_phi00.csv, fig12a_phi60.csv: CSV-formatted file for the data in subplot a, characterizing cross-sections of the plasma boundary at toroidal angle phi = 0 degrees (fig12a_phi00.csv) or phi = 60 degrees (fig12a_phi60.csv) for different magnet solutions, with the following columns: theta: Poloidal angle [radians] for each point r_target: r coordinate [m] for the target plasma boundary r_rc: r coordinate [m] for the rounded continuous (RC) solution r_gpmob: r coordinate [m] for the GPMOb solution r_rg: r coordinate [m] for the RC-GPMOb soulution r_gr: r coordinate [m] for the GPMOb-RC solution r_grg: r coordinate [m] for the GPMOb-RC-GPMOb solution z_target: z coordinate [m] for the target plasma boundary z_rc: z coordinate [m] for the rounded continuous (RC) solution z_gpmob: z coordinate [m] for the GPMOb solution z_rg: z coordinate [m] for the RC-GPMOb solution z_gr: z coordinate [m] for the GPMOb-RC solution z_grg: z coordinate [m] for the GPMOb-RC-GPMOb solution fig12c_iota.csv: CSV-formatted file for the data in subplot c, characterizing profiles of rotational transform (iota), with the following columns: s: Normalized enclosed toroidal flux (radial profile coordinate) target: Values of iota for the target plasma rc: Values of iota for the rounded continuous (RC) solution gpmob: Values of iota for the GPMOb solution rg: Values of iota for the RC-GPMOb solution gr: Values of iota for the GPMOb-RC solution grg: Values of iota for the GPMOb-RC-GPMOb solution fig12d_epsilon.csv: CSV-formatted file for the data in subplot c, characterizing the effective riple (epsilon effective to the 3/2 power, or "eps_eff^(3/2)"), with the following columns: s: Normalized enclosed toroidal flux (radial profile coordinate) target: Values of eps_eff^(3/2) for the target plasma rc: Values of eps_eff^(3/2) for the rounded continuous solution gpmob: Values of eps_eff^(3/2) for the GPMOb solution rg: Values of eps_eff^(3/2) for the RC-GPMOb solution gr: Values of eps_eff^(3/2) for the GPMOb-RC solution grg: Values of eps_eff^(3/2)for the GPMOb-RC-GPMOb solution This folder also contains input and output files for the VMEC code used to perform the free-boundary calculations. Documentation for the VMEC code can be found here: https://princetonuniversity.github.io/STELLOPT/VMEC Input files for VMEC calculations: input.target_plasma: input for a FIXED-boundary calculation for the target plasma equilibrium input.eq_[soln]: input for a FREE-boundary calculation for the the different magnet solutions with name [soln] plotted in Figure 12. Along with the above input namelist files, the folder contains magnetic field files in the MAKEGRID format used for free-boundary calculations. The files are as follows: makegrid.FAMUS_mg_[soln]: magnetic field calculated on a cylindrical grid for the magnet solution with name [soln], used for the free-boundary VMEC calculations. The output of the VMEC equilibrium calculations are as follows: wout_target_plasma.nc: VMEC output file for the target plasma wout_eq_[soln].nc: VMEC output file for free-boundary equilibrium calculations Figure_13 --------- fig13_data.csv: CSV-formatted file for the data plotted in Figure 13. Columns are as follows: theta_thresh: Threshold angle [degrees] for backtracking n_adj: N_adjacent for backtracking f_b: f_b metric [T^2*m^2] for the solution Plotting -------- qhex.m: Matlab function used to visualize arrangements of hexahedral magnets. Usage information is available in its documentation string. Simsopt_Example --------------- This directory contains files for running a GPMOb optimization in for the magnet arrangement and target plasma studied in this paper with theta_thresh=45deg and n_adj=26. Documentation for the Simsopt code can be found here: https://simsopt.readthedocs.io/en/latest/index.html To perform the optimization from a Linux command line, enter the following command: python gpmob_045deg_na026.py If the optimization is successful, a new directory will be generated with output files. Descriptions of the files: gpmob_045deg_na026.py: Python script for setting up and running the GPMOb optimization c09r00_B_axis_half_tesla.plasma: specification of the plasma boundary geometry as well as the contributions of plasma currents to the normal component of the magnetic field to the plasma boundary tf_only_half_tesla_symmetry_baxis.focus: specification of the TF coils employed in conjunction with the permanent magnets magnet_arrangement.focus: FOCUS/FAMUS-formatted input file specifying the locations of the point dipoles representing each magnet magnet_arrangement_corners.csv: Positions of the vertices of each magnet; contains the same data as ../Figure_05/fig5_vertices.csv but without the header row