# Solution of Orifice Hollow Cathode Plasma Model Equations by Means of Particle Swarm Optimization
## 3 Particle Swarm Optimization Methodology
### PSO General Model  
As aforementioned, the solution of the equation's system has to be searched in a certain domain. The constraints are set to the ten independent variables, i.e., neutral and plasma densities in the orifice and the emitter (\(n_{n,e},n_{e,e},n_{n,o},n_{e,o}\)), the electron and wall temperatures (\(T_{e,e},T_{e,o},T_{s},T_{w,o}\)), the emissionength (\(L_{eff}\)) and the plasma potential (\(V_{p}\)). In fact, by analysing Equations (1)-(3), it is simple to verify that the keeper plasma unknowns (\(n_{n,k},n_{e,k},T_{e,k}\)) depend on the plasma density and the electron temperature of the orifice. Moreover, the keeper wall temperature (\(T_{w,k}\)) is set constant to the typical value. The ten parameters govern the entire problem and therefore represent the 10-dimensional exploration domain of the PSO method. The boundaries of the exploration domain (min and max) for each variable can be arbitrarily defined; clearly, reasonable values must be used to foster the research and not waste computational effort in regions representing non-physical operative conditions. Thus, a good way to proceed is to use values in agreement with the typical value reported for cathodes, which is well characterized in the open literature. Once the domain has been defined, it is necessary to initialize the swarm assigning an initial state and velocity for each individual. Between the ten variables defined above, some of those, such as the electronic temperature \(Te\), have a range with a minimum and maximum in the same order of magnitude, and the value of the specific variable can be assigned with a simple random approach as in Equation (26). Other variables, instead, are defined in a range with an order of magnitude much greater than one, such as neutral density \(n_{n,e}\), that spans from \(10^{21}\) up to \(10^{24}\). For this second type of variable, a different equation for the state generation is required (Equation (27)). Indeed, if Equation (26) were used for these variables, an in-homogeneous swarm distribution would be obtained, with a greater concentration near the upper boundary. This undesirable condition is overcome thanks to Equation (27). Using the notation of \(X_{min}\) and \(X_{max}\), respectively, for the minimum and maximum of a general variable \(X\) of the state vector \(\hat{X}\) of the problem, the two different expressions can be considered:  
\[X=X_{min}+(X_{max}-X_{min})*rand \tag{26}\]  
with \(X=\{V_{p},T_{e},T_{e,o},T_{s},L_{eff},T_{w,o}\}\)  
and  
\[X=10\exp(\log(X_{min})+[\log(X_{max})-\log(X_{min})]*rand) \tag{27}\]  
with \(X=\{n_{n,e},n_{e,e},n_{n,o},n_{e,o}\}\). Here, \(rand\) is a random operator that randomly assumes values between 0 and 1. The wider order of magnitude of certain variables is irrelevant to the initial velocity definition as it is quickly updated during the first iterations. Hence, in a simple manner, it also defines the first velocity of each variable as follows:  
\[(V_{X})_{z}=(X_{min})_{z}+[(X_{max})_{z}-(X_{min})_{z}]*rand \tag{28}\]At this point, after the swarm initialization, each individual, with its own state vector, represents a possible solution to the problem; hence, it is processed in the numerical model in order to solve the associated equations (plasma density, electronic temperature, etc...) and obtain the residuals \(\epsilon\) of that specific running setup.