## 2 Modeling of the Poloidal Field Coil System on HL-3
### Mathematical Model  
#### 2.1.1 Conductors Model  
The design and optimization of the field-null configuration primarily focus on the poloidal component of the magnetic field. The poloidal magnetic field component induced by the TF coils is negligible according to a careful analysis of the magnetic probe data. Consequently, only the CS and PF coils and passive conductor structures are needed for the modeling. Primarily, the passive conductor structures include only the vacuum vessel, as the first wall modules on HL-3 are isolated from each other, and no passive coils are present inside the vessel.  
The HL-3 tokamak is toroidally axisymmetric, where all CS coils and PF coils can be approximately treated as multilayer, tightly wound circular coils with rectangular or parallelogram cross-sections, distributed in parallel and coaxially. Assuming that the vacuum vessel material has a uniform medium, it can be equivalently modeled as a number of closed circular passive conductor loops distributed coaxially in the poloidal direction and connected in parallel. In the following model, the number of passive conductor loops is chosen to be 88 to obtain high accuracy while retaining a reasonable computational cost.  
After simplifying the conductors circuit, the relationship between the voltages and currents in the conductors can be expressed as follows:  
\[V_{i}=R_{i}I_{i}+L_{i}\frac{dI_{i}}{dt}+\sum_{j=1}^{j=105}M_{ij}\frac{dI_{j}}{ dt}\ \ (i\
eq j) \tag{2}\]  
The subscript \(i=1,\ 2,\ldots,105\) represents all the CS, PF coils and passive conductor loops, among which \(i=1\) represents the CS coil, \(i=2\)\(\sim\)17 represents the 16 PF coils, and \(i=18\)\(\sim\)105 represents the 88 passive conductors. Here, \(I_{i}\) and \(V_{i}\) are the current and terminal voltage of the \(i\)th conductor, respectively, \(R_{i}\) is the total resistance of the \(i\)th coil and its transmission line, \(L_{i}\) is the self-inductance of the \(i\)th coil, and \(M_{ij}\) is the mutual inductance between the \(i\)th and \(j\)th coil. Apparently, \(V_{i}\) is zero for \(i=18\)\(\sim\)105 as they are passive conductors and there is no power supply that energizes them.  
Equation (1) can be rewritten in its matrix form:  
\[\begin{bmatrix}V_{1}\\ V_{2}\\ \vdots\\ V_{105}\end{bmatrix}=\begin{bmatrix}R_{1}&0&\ldots&0\\ 0&R_{2}&\ldots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\ldots&R_{105}\end{bmatrix}\begin{bmatrix}I_{1}\\ I_{2}\\ \vdots\\ I_{105}\end{bmatrix}+\begin{bmatrix}M_{1,1}&M_{1,2}&\ldots&M_{1,105}\\ M_{2,1}&M_{2,2}&\ldots&M_{2,105}\\ \vdots&\vdots&\ddots&\vdots\\ M_{105,1}&M_{105,2}&\ldots&M_{105,105}\end{bmatrix}\begin{bmatrix}I_{1}\\ I_{2}\\ \vdots\\ I_{105}\end{bmatrix} \tag{3}\]  
which can be simplified as follows:  
\[\mathbf{V}=\mathbf{R}\mathbf{I}+\mathbf{M}\mathbf{I} \tag{4}\]  
In Equation (4), \(\mathbf{I}\) and \(\mathbf{V}\) are the \(105\times 1\) current and voltage vector, respectively, and \(\mathbf{\dot{I}}\equiv d\mathbf{I}/dt\) is the time derivative of coil currents \(\mathbf{I}\), \(\mathbf{M}\) is a \(105\times 105\) symmetric matrix containing all of the self-and-mutual inductance values, and \(\mathbf{R}\) is a \(105\times 105\) diagonal matrix containing all of the resistance values of coils and passive conductor loops.  
The Equation (4) can be rewritten as follows:  
\[\mathbf{\dot{I}}=\mathbf{A}\mathbf{I}+\mathbf{B}\mathbf{V} \tag{5}\]  
In Equation (5), \(\mathbf{A}=-\mathbf{M}^{-1}\mathbf{R},\ \mathbf{B}=\mathbf{M}^{-1}\).  
The tool used to calculate the self-inductance and mutual inductance of the coils is TokSys, which calculates the self-inductance of each coil and the mutual inductance between coils based on the Biot-Savart law and elliptic integrals [24].