# Investigation into the Uniformization of Proton Beams for FLASH Therapy
## 2 Materials and Methods
### The Physical Principle of Beam Uniformization Using Nonlinear Magnets
#### 2.1.1 Multipole Magnet  
According to the Taylor expansion of Cartesian coordinates, the expansion of the magnetic field in the \(x\) and \(y\) directions is expressed as follows:  
\[B_{X}=B_{0}(-a_{1}+\frac{b_{2}y-a_{2}x}{r_{0}}+\frac{a_{3}\big{(}y^{2}-x^{2} \big{)}+2b_{3}xy}{r_{0}^{2}}+\ldots) \tag{1}\]  
\[B_{Y}=B_{0}(b_{1}+\frac{a_{2}y+b_{2}x}{r_{0}}+\frac{a_{3}\big{(}y^{2}-x^{2} \big{)}+b_{3}\big{(}x^{2}-y^{2}\big{)}}{r_{0}^{2}}+\ldots) \tag{2}\]  
where \(a_{n}\) and \(b_{n}\) represent the coefficients of the \(2n\)th polar field. \(n\) is the number of axes of symmetry, \(b_{n}\) is the positive multipole field, and \(a_{n}\) is the oblique multipole field. \(B_{0}\) and \(r_{0}\) represent the reference magnetic field and the corresponding reference orbit. Therefore, each term of the \(x\) and \(y\) expansions above represents the formula for the magnetic field strength of the \(2n\) pole, respectively. When \(n=4\) and \(n=6\), the magnetic field formula of the normalized positive octupole-pole field and dodecapole-pole field is [21; 22] listed in Table 1:  
In the formula, \(G\) and \(M\) represent the focusing constant of the multipole magnet, indicating the strength of the magnet's focusing capability. The initial proton beam density distribution \(\rho_{0}\) at the multipole magnet follows the Gaussian distribution formula:  
\[\rho_{0}=N/\left(\sqrt{2\pi}\sigma_{0}\right)\times exp\left[-x_{0}^{2}/\left( 2\sigma_{0}^{2}\right)\right] \tag{3}\]  
where \(\sigma_{0}\) represents the RMS radius of the beam envelope and \(x_{0}\) represents the particle coordinates. The formula for the uniformized density at the target \(\rho_{t}\) is given by \(\rho_{t}=N/2\tau_{t}\), where \(2\tau_{t}\) is the beam spot width. The density formula at the target under the function of a multipole magnet is [23]:  
\[\rho_{t}=\rho_{0}\left(\frac{dx_{t}}{dx_{0}}\right)^{-1}=\rho_{0}/\left[\sqrt {\frac{\beta_{t}}{\beta_{0}}}cos\varphi-\sqrt{\beta_{0}\beta_{t}}sin\varphi{ \sum_{n=3}^{\infty}}\frac{K_{2n}}{(n-2)!}x_{0}^{n-2}\right] \tag{4}\]  
where \(K_{2n}\) represents the focusing constant of the multipole magnet and \(\varphi\) is the phase advance between the multipole magnet and the target. \(\beta_{0}\) and \(\beta_{t}\) are the beta function at the multipole magnet and the target. Substituting these into Equation (4) can obtain [23]:  
\[\left\{K_{2n-1}=0\right. \tag{5}\] \[\left. \begin{array}{l}K_{2n}=\frac{(-1)^{n/2}(n-2)!}{\left(\frac {n}{2}-1\right)!(2\rho_{0})^{\frac{n}{2}-1}\beta_{0}tan\varphi}\\ 2\tau_{t}=\sqrt{2\pi\epsilon\beta_{t}}|cos\varphi|\end{array} \right.\]  
Through analysis, it was determined that for \(n=4\), \(6\), \(8\), \(\ldots\), corresponding to odd-order nonlinear terms in the respective magnets, a uniformized beam distribution can be achieved. According to formula (5), the beam spot width is unrelated to the strength of the nonlinear magnet but depends on the phase advance in other linear elements during propagation and the amplitude function at the target. To achieve uniformization, the strength of the multipole nonlinear magnet used is inversely proportional to the \(\beta\) function before entering the multipole magnet. The primary principle of uniformization using a nonlinear magnet is shown in Figure 1. First, the two bow sections with low particle density in the normalized phase diagram were translated up and down by a small phase difference, and then the bow section was rotated through the drift space or the lateral phase shift of the focusing element, so that the projection of its \(x\) coordinate was overlapped within the uncut part, thus achieving beam uniformization. To achieve uniformization in both the \(x\) and \(y\) directions, at least two pairs of nonlinear magnetic fields are required to act separately in each direction. To minimize coupling effects, it is essential to \"flatten\" the beam before the nonlinear magnets. The resulting beam envelope, when inserting a nonlinear magnet into this transport line segment, is depicted in Figure 4 (1).