## 3 SPICE-Oriented Deflation Method
However, user intervention is required to enter the parameters of behavioral models, which depend on the previously determined solutions. The second version is a fully automated procedure operating on netlists, created by a host application written in the Delphi environment. All calculations are performed in IsSpice4, while the host application is responsible for creating batch files and processing the results. Once the first DC solution of the considered circuit has been found using the standard DC analysis procedure, an essential element of both versions is to modify the schematic to eliminate the possibility of recalculating this solution by using the concept of deflation. The assumption is that the auxiliary circuit connected to the original circuit should be simple to implement and that the built-in DC analysis will still be used. The limitation is that only the elements and functions available in SPICE can be utilized. As a result of preliminary research, it was decided to use nonlinear dependent current sources (B sources). The number of these sources is two in the case of searching the second solution and \(k+1\) for the third and subsequent solutions, where \(k\) is the index of solutions sought. The fundamental element is the source labeled BC (see Figures 3-5). The labeling of the dependent source with the abbreviation BC is due to the fact that the first letter is the designation required by the IsSpice software for a nonlinear controlled source, and the second letter denotes that it is the current source attached to the selected circuit node. The source BC is present in every schematic (netlist) and is, thus, not indexed like the other B-type sources. It is attached to a selected node of the circuit. When the circuit is supplied from a real voltage source or sources (i.e., a source with non-zero internal resistance), the external terminal of the source is selected as the connection node (see Figures 3-5). When the schematic is built using ideal voltage sources, we select any node except the ungrounded nodes of the sources. The value of the BC source current depends on the Euclidean norm of the difference between the solution in a current iteration and the previously determined solution (for \(k=2\)) or the minimum Euclidean norm of the difference between the solution in a current iteration and the previously determined solutions (for \(k>2\)). When approaching solutions already found, the current of the source should increase to infinity. However, for new solutions, the current of the source should be zero. Since the goal of the work was to create an algorithm that works in the IsSpice4 software, the selection of functions was limited to those available in the software. Preliminary studies were conducted using various exponential, hyperbolic, and trigonometric functions with different parameters. Using the hyperbolic function \(a/x\), for \(x>0\), sometimes led to errors in the simulation due to overflow. The lack of convergence to solutions close to each other caused an additional problem. It was therefore decided to use the function:  
\[f(x)=a\cdot\mathrm{e}^{-b\cdot x^{4}}, \tag{8}\]  
where \(a=10^{5}\) and \(b=10^{5}\). The plot of the function is shown in Figure 2.  
Figure 2: The plot of the function used in the dependent current source (BC source). Based on numerous simulation studies, the proposed function with the given values of parameters avoided many of the problems present with other functions, such as divergence, slow convergence, and losing solutions. The function in the iterative process enters saturation, at enormous current values, for solutions close to the solutions already determined. The function did not lead, in any case, to breaking the process due to numerical overflow. In addition, at \(x=0.15\), the function takes a value \(1\times 10^{-17}\). Above \(x=0.15\), we took 0 to avoid numerical problems (see e.g., Figure 3). Therefore, it is possible to determine solutions not close to each other in the Euclidean norm than 0.15.