## 3 Optimization of Discharge Chamber Size and Magnetic Field
### The Impact of the Discharge Chamber's Dimensions on the Ionization Properties  
The axial magnetic field distribution is determined to be a saddle-shaped magnetic field. The discharge chamber radius and length of the ion source model are modified. When adjusting the radius of the cavity, keep the length of the discharge chamber at 40 mm and the radius variation range at 10 mm-1.25 mm-20 mm. When adjusting the cavity length, keep the discharge chamber's radius at 15 mm and the variation range of changes (L) at 30 mm-2.5 mm-50 mm. Some results of the spatial electron density distribution after changing the radius and length of the cavity are shown in Figure 6a,b.  
As shown in Figure 6, the maximum electron density distribution mainly distributes near the center of the discharge chamber. In contrast, the minimum electron density is primarily distributed near the wall of the discharge chamber. The plasma is mainly concentrated in the center of the discharge chamber regardless of how the cavity's size changes, but as the cavity's size increases, the degree of plasma concentration in the chamber's center will fluctuate and decrease with larger cavities.  
Due to the limitations of the ion source's placement conditions, the parameters of the permanent ring, such as the structure values, are determined first in our design. We consider the simulation results of the discharge cavities with different sizes to meet the needs of power feeding and beam extraction at the same time. The plasma state under varied size conditions, including the size of the space for accommodating the plasma and the magnetic field distribution that defines the plasma discharge state, are distinct. The simulation work judges whether the system meets the design requirements by examining the electrons in the plasma, including the number of electrons, the average electron density and the maximum electron density.  
The number of particles is calculated by the volume integral of the electron density, the average electron density represents both the total number and the volume change, and the maximum electron density usually appears in the central region of the plasma. Figure 7a,b demonstrate the effects of various radii and lengths on the number of particles, average electron density, and maximum electron density in the discharge chamber, respectively. The typical tendency of the average electron density and the maximum electron density variation decreases with increasing size. Figure 7 demonstrates that the total number of electrons initially increases and then decreases as the dimensions of the discharge chamber change. As the dimensions increase, there is a peak value at a certain point, indicating a behavior that does not align with the volume scaling law. This observation is consistent with the results from reference [24], which showed a reverse volume scaling effect for the extraction current in the axial dimension for high charge states. Furthermore, our simulation results suggest that this trend is not limited to high charge states but also applies to low charge states of the ion source. Whether a higher volume contributes to the production of more intense currents requires further discussion. In practical design, optimizing the axial and radial dimensions of specific models is crucial. The results of the parameter sweep calculations of the model show that the number of particles is at the maximum when the radius of the discharge chamber is 15 mm and the length of the chamber is 40 mm. For an ion source that does not require a particularly high extraction current (more than 20 mA), the primary demand is to lower the whole size of the system including the microwave system; this size can satisfy the overall needs of the accelerator.  
Figure 6: Spatial variation in electron density at different cavity sizes: (**a**) is the electron density distribution variation with discharge cell radius; (**b**) is the electron density variation with the length of the discharge cell.