Application of a Fuzzy Inference System for Optimization of an Ampliﬁer Design

: Simulation programs are widely used in the design of analog electronic circuits to analyze their behavior and to predict the response of a circuit to variations in the circuit components. A fuzzy inference system (FIS) in combination with these simulation tools can be applied to identify both the main and interaction effects of circuit parameters on the response variables, which can help to optimize them. This paper describes an application of fuzzy inference systems to modeling the behavior of analog electronic circuits for further optimization. First, a Monte Carlo analysis, generated from the tolerances of the circuit components, is performed. Once the Monte Carlo results are obtained for each of the response variables, the fuzzy inference systems are generated and then optimized using a particle swarm optimization (PSO) algorithm. These fuzzy inference systems are used to determine the inﬂuence of the circuit components on the response variables and to select them to optimize the ampliﬁer design. The methodology proposed in this study can be used as the basis for optimizing the design of similar analog electronic circuits.


Introduction
Fuzzy inference systems (FISs) are powerful tools for analyzing the behavior of electronic circuits to optimize circuit design. They can be used for modeling the response of electronic circuit variables and to simultaneously identify the influence of circuit parameters on an output response. Circuit optimization presents some drawbacks due to the non-linearities in the components that affect the response. In addition, introducing tolerances into the components of the circuit affects the complexity of the resulting equations. Likewise, the use of optimization techniques without feedback from the design process can lead to impractical solutions because the optimized values may not be feasible due to the tolerances of some components and the instabilities that may be generated within the circuit. Therefore, the solution of the optimization process should be verified so that the circuit will remain stable despite any variations in the tolerances of the components.
In the present study, zero-order Sugeno fuzzy inference systems were used to optimize the design of a single stage of a small signal BJT amplifier. The response of this electronic circuit to variations that may arise from tolerances of the passive elements of the circuit were firstly obtained through a Monte Carlo analysis using Cadence ® OrCAD ® electronic simulation software. These obtained values were then used to build and train two zeroorder Sugeno FISs in order to model both the voltage gain (Av) and the total harmonic distortion (THD), which, in itself, is complex to model analytically. The reduction in the THD is important and should be mentioned as it generates perturbations in the output voltage function. It is, therefore, of great technological interest to analyze its behavior in the design of analog circuits.
Any analytical determination of circuits with a high number of components is challenging due to both the existence of non-linearities and their complexity. Simulation together with fuzzy logic techniques can, therefore, contribute to adequately modeling

Literature Review
Mamdani [1] and Takagi-Sugeno [2] are the most commonly employed types of FIS for modelling circuit parameters. Several studies can be found in the literature dealing with the application of fuzzy systems [3,4]. Likewise, Oltean et al. [5] studied the application of various types of FISs both for modeling and designing electronic circuits; they proposed the application of a fuzzy optimization method to a CMOS operational amplifier. They employed an adaptive neuro-fuzzy inference system (ANFIS) to tune the initial zero-order Sugeno FIS. Sahu and Dutta [6] also employed fuzzy logic for the optimization of MOS operational amplifiers, and Hayati et al. [7] used a Takagi-Sugeno model and an ANFIS for modeling CMOS logic gates. In other studies, Hostos et al. [8] presented a design approach for active analog circuits using genetic algorithms, where the fitness function of the genetic algorithm is implemented by means of a fuzzy inference system; Wang et al. [9] designed integrated analog and radio frequency circuits. Regarding total harmonic distortion (THD) modeling, it is worth mentioning the studies of both Chang et al. [10], in which a FIS for shunt capacitor placement was employed in a distribution system considering harmonic distortions, and Panoiu et al. [11], in which an ANFIS was used for modeling the total harmonic distortion of the current and the voltage for a nonlinear high power load.
The use of fuzzy inference systems in electronic circuits for a faults' classification was examined by Arabi et al. [12], where an ANFIS is used to predict the faults in analog circuits. El-Gamal et al. [13] employed a fuzzy inference system for single analog fault diagnosis, and Kavithamani et al. [14] presented a fault detection algorithm based on SBT (Simulation Before Test) for verifying linear analog circuits by employing a fuzzy inference system as a classifier. They concluded that both single and multiple faults can be detected with their proposed method. Among many other studies, Ram et al. [15] applied a Mamdani FIS for the diagnosis of single and multiple faults in analog circuits, employing SBT approach.
Fuzzy inference systems are widely applied in several industrial areas, as they permit the efficient modeling of response variables. Among the studies that can be found in the relevant literature, Calcagno et al. [16] employed a Sugeno FIS to detect defects on thin metallic plates as a function of both their position and depth. Some other relevant studies are those of Guo et al. [17], who described the application of an ANFIS for partial discharge pattern recognition, and Voloşencu [18], who applied an ANFIS for the speed control systems of electric drives based on fuzzy PI controllers. Likewise, in another study, Napole et al. [19] employed fuzzy logic control to reduce the hysteresis effect and to increase the performance of piezoelectric actuators.
In other studies, Eboule et al. [20] compared artificial intelligent techniques and fuzzy logic to detect, classify, and locate faults on power transmission lines. Alhato et al. [21] employed an adaptive fuzzy extended state observer to improve the control performance of a DC-link voltage loop regulation in a double-fed induction generator-based wind energy converter.
Further examples of the industrial applications of fuzzy systems can be found in a study by Bagua et al. [22], where type-1 and type-2 fuzzy systems were used to monitor a gas turbine process or in a study by Angiulli et al. [23], who evaluated the resonant frequency of microstrip antennas. Likewise, the module faults in photovoltaic modules were characterized by Belaout et al. [24] and two ANFIS were used to detect photovoltaic system faults by Bendary et al. [25]. Finally, Chang et al. [26] studied laser module temperature control; many other research studies can be found in the literature in this field.

Methodology
As previously shown, fuzzy inference systems are commonly employed for modeling the behavior of electronic circuits and to detect and classify failures modes, among many other applications. In the present study, zero-order Sugeno fuzzy inference systems were used to optimize the design of a single stage of a small signal BJT amplifier. First, the response of the amplifier circuit versus variations that can arise from the tolerances of the passive elements of the circuit were obtained through a Monte Carlo analysis. Therefore, the resistive and capacitive components of the circuit varied as a function of their prescribed tolerances, from software simulations. As described below, the methodology proposed in this paper shows that a FIS may be trained to model the response variables of interest and, thereby, to acquire information on the circuit components and their influence on the selected response variables.

Initial Design
The electronic circuit analyzed in this study is depicted in Figure 1, showing an electrical diagram of a single stage of a small signal amplifier that was used as the circuit for modeling its behavior using two fuzzy inference systems. It is possible to use the proposed methodology for other types of analog circuits, either with more amplification stages or with a different configuration to the one shown in Figure 1.
In other studies, Pouabe et al. [20] compared artificial intelligent techniques and fuzzy logic to detect, classify, and locate faults on power transmission lines. Alhato et al. [21] employed an adaptive fuzzy extended state observer to improve the control performance of a DC-link voltage loop regulation in a double-fed induction generator-based wind energy converter.
Further examples of the industrial applications of fuzzy systems can be found in a study by Bagua et al. [22], where type-1 and type-2 fuzzy systems were used to monitor a gas turbine process or in a study by Angiulli et al. [23], who evaluated the resonant frequency of microstrip antennas. Likewise, the module faults in photovoltaic modules were characterized by Belaout et al. [24] and two ANFIS were used to detect photovoltaic system faults by Bendary et al. [25]. Finally, Chang et al. [26] studied laser module temperature control; many other research studies can be found in the literature in this field.

Methodology
As previously shown, fuzzy inference systems are commonly employed for modeling the behavior of electronic circuits and to detect and classify failures modes, among many other applications. In the present study, zero-order Sugeno fuzzy inference systems were used to optimize the design of a single stage of a small signal BJT amplifier. First, the response of the amplifier circuit versus variations that can arise from the tolerances of the passive elements of the circuit were obtained through a Monte Carlo analysis. Therefore, the resistive and capacitive components of the circuit varied as a function of their prescribed tolerances, from software simulations. As described below, the methodology proposed in this paper shows that a FIS may be trained to model the response variables of interest and, thereby, to acquire information on the circuit components and their influence on the selected response variables.

Initial Design
The electronic circuit analyzed in this study is depicted in Figure 1, showing an electrical diagram of a single stage of a small signal amplifier that was used as the circuit for modeling its behavior using two fuzzy inference systems. It is possible to use the proposed methodology for other types of analog circuits, either with more amplification stages or with a different configuration to the one shown in Figure 1.   Table 1 shows the nominal values and the tolerances of the circuit components that were analyzed in this study. Table 2 shows the values of the power supply, the sinusoidal voltage source, and the load resistance. The amplifier circuit shown in Figure 1 was initially designed to operate in the active region. The output voltage of this circuit is shown in Figure 2.  Table 1 shows the nominal values and the tolerances of the circuit components that were analyzed in this study. Table 2 shows the values of the power supply, the sinusoidal voltage source, and the load resistance. The amplifier circuit shown in Figure 1 was initially designed to operate in the active region. The output voltage of this circuit is shown in Figure 2.  As previously mentioned, the output variables are the amplifier voltage gain (Av) and the total harmonic distortion (THD (%)), which are determined from Equations (1) and (2), respectively. The THD (%) was defined from the voltage harmonics, as shown in Equation (2) Figure 2b. In this case, the amplifier voltage gain was Av = 27.2472 and the total harmonic distortion was THD = 0.2795% when the circuit was working with the nominal values of the components shown in Table  1.
However, the tolerances of the circuit components, as specified in Table 1, mean that the circuit may undergo variations in its output response, depending on the tolerance values, which, in turn, vary the circuit response. This behavior is represented in Figure 3, which shows the different voltage gain and harmonic distortion values from a Monte As previously mentioned, the output variables are the amplifier voltage gain (Av) and the total harmonic distortion (THD (%)), which are determined from Equations (1) and (2), respectively. The THD (%) was defined from the voltage harmonics, as shown in Equation (2), where V j is the Fourier component of the harmonic j . Figure 2a shows both the output and the input voltage of the amplifier, and the fast Fourier transform (FFT) of the output signal is shown in Figure 2b. In this case, the amplifier voltage gain was Av = 27.2472 and the total harmonic distortion was THD = 0.2795% when the circuit was working with the nominal values of the components shown in Table 1.
However, the tolerances of the circuit components, as specified in Table 1, mean that the circuit may undergo variations in its output response, depending on the tolerance values, which, in turn, vary the circuit response. This behavior is represented in Figure 3, which shows the different voltage gain and harmonic distortion values from a Monte Carlo analysis of the designed circuit, with 128 runs, in which the passive elements of the circuit are varied within specified tolerances. The electronic simulation software employed in this study was Cadence ® OrCAD ® . Tables A1 and A2 in Appendix A show the values obtained from variations in the circuit components following the Monte Carlo analysis. In this study, uniform distributions were considered for the passive components of the circuit (resistors and capacitors). Then, the output values obtained in the amplifier circuit, shown in Tables A1 and A2, were used to build and train the fuzzy inference systems in order to model both the gain voltage (Av) and the total harmonic distortion (THD) as a function of the electrical resistances and capacitors of the amplifier circuit. values obtained from variations in the circuit components following the Monte Carlo analysis. In this study, uniform distributions were considered for the passive components of the circuit (resistors and capacitors). Then, the output values obtained in the amplifier circuit, shown in Tables A1 and A2, were used to build and train the fuzzy inference systems in order to model both the gain voltage (Av) and the total harmonic distortion (THD) as a function of the electrical resistances and capacitors of the amplifier circuit.   Table 3 shows the average values and the standard deviations that were calculated from the results of the Monte Carlo analysis. These average values are close to those obtained with the nominal values of the initial configuration, which were Av = 27.2472 and THD = 0.2795%. As shown in Table 1, the normalized components selected for the passive components of the amplifier circuit had tolerances of 10% in the case of the resistors and 20% in the case of the capacitors. The results from the Monte Carlo analysis were divided into two groups in order to train and then validate the fuzzy inference systems, as shown in Tables A1 and A2, respectively. The output of the initial design is shown in Figure 4 when the passive components of the circuit were varied in the Monte Carlo analysis.   Table 3 shows the average values and the standard deviations that were calculated from the results of the Monte Carlo analysis. These average values are close to those obtained with the nominal values of the initial configuration, which were Av = 27.2472 and THD = 0.2795%. As shown in Table 1, the normalized components selected for the passive components of the amplifier circuit had tolerances of 10% in the case of the resistors and 20% in the case of the capacitors. The results from the Monte Carlo analysis were divided into two groups in order to train and then validate the fuzzy inference systems, as shown in Tables A1 and A2, respectively. The output of the initial design is shown in Figure 4 when the passive components of the circuit were varied in the Monte Carlo analysis. values obtained from variations in the circuit components following the Monte Carlo analysis. In this study, uniform distributions were considered for the passive components of the circuit (resistors and capacitors). Then, the output values obtained in the amplifier circuit, shown in Tables A1 and A2, were used to build and train the fuzzy inference systems in order to model both the gain voltage (Av) and the total harmonic distortion (THD) as a function of the electrical resistances and capacitors of the amplifier circuit.  Table 3 shows the average values and the standard deviations that were calculated from the results of the Monte Carlo analysis. These average values are close to those obtained with the nominal values of the initial configuration, which were Av = 27.2472 and THD = 0.2795%. As shown in Table 1, the normalized components selected for the passive components of the amplifier circuit had tolerances of 10% in the case of the resistors and 20% in the case of the capacitors. The results from the Monte Carlo analysis were divided into two groups in order to train and then validate the fuzzy inference systems, as shown in Tables A1 and A2, respectively. The output of the initial design is shown in Figure 4 when the passive components of the circuit were varied in the Monte Carlo analysis.

Development of Fuzzy Inference Systems
Once the values of the Monte Carlo analysis were obtained, the Fuzzy Logic Toolbox of MATLAB TM 2020a [27] and the Global Optimization Toolbox of MATLAB TM 2020a [28] were employed to develop and tune the fuzzy inference systems so that the outputs of the circuit under study could be modeled, with the aim of analyzing the influence of the electrical components on both the voltage gain and the total harmonic distortion. The particle swarm optimization (PSO) algorithm of the Global Optimization Toolbox of MATLAB TM 2020a [28] was employed in the fuzzy inference systems developed in this study. The MATLAB TM defaults for the particle swarm optimization algorithm were used in this study. These values can be modified if necessary by setting the appropriate values in "options.MethodOptions". As shown in [28], this PSO algorithm is based on one proposed by Kennedy [29] and using modifications later suggested by Mezura-Montes et al. [30] and Pedersen [31]. In this algorithm, the objective function is evaluated at each particle location and the best values of both the function and the location are determined. Then, the algorithm is iteratively updated with these values until it reaches a stopping criterion [28]. Different descriptions of the PSO algorithm can be found in several papers, such as [32][33][34].
As shown in Figure 5, a zero-order Sugeno FIS was employed because the defuzzification process of a Sugeno FIS is computationally more efficient compared with that of a Mamdani FIS because, rather than evaluating the centroid, a Sugeno FIS evaluates a weighted average [27]. Two Gaussian membership functions were selected for the inputs (resistors and capacitors). In the fuzzy inference systems developed in this study, the fuzzy rules shown in Equation (3) were employed for both the Av and the THD, where the outputs (Av j and THD j ) were constant values, as a zero-order Sugeno FIS was employed.
where j = 1 . . . n and n is the number of i f − then rules; and Av j and THD j are the outputs of the jth i f − then rule. Therefore, given a specific input, the outputs of the fuzzy model (Av and THD) may be obtained from Equations (4) and (5), respectively.
where ω j , the weight of the jth i f − then rule for a specific input vector, is evaluated, as shown in Equation (6), for both Av and THD. It can be observed that m = 8 because eight inputs (five resistors and three capacitors) exist and As previously mentioned, a Monte Carlo analysis was first performed to obtain the amplifier circuit response. Figure 6 shows the variation in the passive components of the circuit depicted in Figure 1 after considering a uniform distribution for these components.
the Monte Carlo analysis and divided by two. A different number of membership functions could have been selected for the output, but it was decided to use this number of outputs, which, in this case, amounted to 32 membership functions. Likewise, to obtain the initial FIS, the range of variation in the variables was determined from the Monte Carlo analysis, multiplying these ranges of variation, of inputs and outputs by a k factor to expand the range of variation. In the case in this study, a factor of k = 0.5 was considered. That is, the range of variation was [nominal*(1 − k), nominal*(1 + k)].   Figure 7 shows the membership functions that were generated in the untuned fuzzy inference systems. Once these zero-order Sugeno fuzzy inference systems were developed, they were tuned in two steps, following the methodology shown in the Fuzzy Logic response (the Av and the THD) equal to the length of the response vector obtained from the Monte Carlo analysis and divided by two. A different number of membership functions could have been selected for the output, but it was decided to use this number of outputs, which, in this case, amounted to 32 membership functions. Likewise, to obtain the initial FIS, the range of variation in the variables was determined from the Monte Carlo analysis, multiplying these ranges of variation, of inputs and outputs by a k factor to expand the range of variation. In the case in this study, a factor of k = 0.5 was considered. That is, the range of variation was [nominal*(1 − k), nominal*(1 + k)].   Figure 7 shows the membership functions that were generated in the untuned fuzzy inference systems. Once these zero-order Sugeno fuzzy inference systems were developed, they were tuned in two steps, following the methodology shown in the Fuzzy Logic The data obtained from the Monte Carlo analysis were divided into two subsets of the same size: one to train the fuzzy inference systems and another to validate them, as shown in Tables A1 and A2, respectively. Therefore, a FIS was first developed from the input and output variables of the circuit. With this objective in mind, the "addInput/addOutput" options of MATLAB TM were used. Two untuned fuzzy inference systems (one for the Av and one for the THD) were developed using Gaussian-type membership functions for both the Av and the THD, respectively. The software was set to automatically select the values of the constants of the membership functions. Any other criterion could have been used to develop the initial FIS, but the former was chosen to simplify the process. Furthermore, to develop these two initial untuned zero-order Sugeno fuzzy inference systems, it was decided to use a maximum number of membership functions for the response (the Av and the THD) equal to the length of the response vector obtained from the Monte Carlo analysis and divided by two. A different number of membership functions could have been selected for the output, but it was decided to use this number of outputs, which, in this case, amounted to 32 membership functions. Likewise, to obtain the initial FIS, the range of variation in the variables was determined from the Monte Carlo analysis, multiplying these ranges of variation, of inputs and outputs by a k factor to expand the range of variation. In the case in this study, a factor of k = 0.5 was considered. That is, the range of variation was [nominal*(1 − k), nominal*(1 + k)]. Figure 7 shows the membership functions that were generated in the untuned fuzzy inference systems. Once these zero-order Sugeno fuzzy inference systems were developed, they were tuned in two steps, following the methodology shown in the Fuzzy Logic Toolbox of MATLAB TM 2020a [27]. Therefore, the PSO optimization algorithm "particleswarm" was used first, along with the optimization type set to "learning" to generate the rules of the FISs because the initial FISs were untuned. In this first step, 25 iterations were selected.
Mathematics 2021, 9, x FOR PEER REVIEW 8 of 23 Toolbox of MATLAB TM 2020a [27]. Therefore, the PSO optimization algorithm "particleswarm" was used first, along with the optimization type set to "learning" to generate the rules of the FISs because the initial FISs were untuned. In this first step, 25 iterations were selected.

Tuning of the Fuzzy Inference Systems
Once these fuzzy inference systems were generated for both the Av and the THD, in a second step, the membership function and the learning rules of each FIS were tuned. In this second case, 100 iterations were performed by using the "tuning" option in MATLAB TM , once again with a PSO optimization algorithm, although any other method could have been employed [27]. Figures 8 and 9 show the tuned membership functions of each FIS. The FIS models obtained in this way were employed for modeling the behavior of the amplifier circuit.

Tuning of the Fuzzy Inference Systems
Once these fuzzy inference systems were generated for both the Av and the THD, in a second step, the membership function and the learning rules of each FIS were tuned. In this second case, 100 iterations were performed by using the "tuning" option in MATLAB TM , once again with a PSO optimization algorithm, although any other method could have been employed [27]. Figures 8 and 9 show the tuned membership functions of each FIS. The FIS models obtained in this way were employed for modeling the behavior of the amplifier circuit. Toolbox of MATLAB TM 2020a [27]. Therefore, the PSO optimization algorithm "particleswarm" was used first, along with the optimization type set to "learning" to generate the rules of the FISs because the initial FISs were untuned. In this first step, 25 iterations were selected.

Tuning of the Fuzzy Inference Systems
Once these fuzzy inference systems were generated for both the Av and the THD, in a second step, the membership function and the learning rules of each FIS were tuned. In this second case, 100 iterations were performed by using the "tuning" option in MATLAB TM , once again with a PSO optimization algorithm, although any other method could have been employed [27]. Figures 8 and 9 show the tuned membership functions of each FIS. The FIS models obtained in this way were employed for modeling the behavior of the amplifier circuit.

Optimization Process
Once the fuzzy inference systems were obtained, they were employed to predict the outputs and to analyze the main effects plot as well as the interaction effects plot, if necessary, so that the levels of the input variables that improve the targets (output responses) could then be selected. To verify that the new design remains stable against variations due to the tolerances of the passive elements of the circuit, a new Monte Carlo analysis was performed with the new inputs. From this analysis, the stability of the circuit could then be verified. The process can be repeated until a satisfactory result is obtained, as shown in Figure 10, which depicts a scheme of the proposed method. This optimization process is further developed in the following sections in order to improve the behavior of the electronic circuit shown in Figure 1.

Optimization Process
Once the fuzzy inference systems were obtained, they were employed to predict the outputs and to analyze the main effects plot as well as the interaction effects plot, if necessary, so that the levels of the input variables that improve the targets (output responses) could then be selected. To verify that the new design remains stable against variations due to the tolerances of the passive elements of the circuit, a new Monte Carlo analysis was performed with the new inputs. From this analysis, the stability of the circuit could then be verified. The process can be repeated until a satisfactory result is obtained, as shown in Figure 10, which depicts a scheme of the proposed method. This optimization process is further developed in the following sections in order to improve the behavior of the electronic circuit shown in Figure 1.

Results
The results of following the methodology described above are now presented. First, the results obtained for the voltage gain (Av) are provided, then those for the total harmonic distortion (THD).

Results
The results of following the methodology described above are now presented. First, the results obtained for the voltage gain (Av) are provided, then those for the total harmonic distortion (THD). Figure 11 shows the results after the first step in the development of the FIS. As can be observed, this FIS is capable of accurately modeling the voltage gain's behavior. The data shown in Tables A1 and A2 were used to obtain both the MSE and the relative error values of these results. The values in Table A1 were employed to obtain the FIS and the values in Table A2 for its validation. The accuracy of the fuzzy inference systems can be determined using either the mean squared error (MSE) or using the root mean squared error (RMSE), where y i is the actual value andŷ i is the estimated one, as shown in Equation (7).

Voltage Gain Modeling Results
Mathematics 2021, 9, x FOR PEER REVIEW 11 of 23 (a) (b) Figure 11. Results with the tuned FIS in the first step for Av: (a) training data; (b) validation data.
As can be observed in Figure 12, after the second step, the results were more accurate than those obtained with the previous FIS; hence, the adjusted FIS was used to model the behavior of the circuit. Increasing the number of iterations may reduce the MSE. However, increasing the number of iterations also increases the calculation time. It was, therefore, decided to use 100 iterations for both response variables.
As can be observed in Figure 12, the FIS was capable of adequately predicting the voltage gain behavior. This model could be used to obtain both the interaction and the main effects as well as the response surfaces. Figure 13 shows the response surfaces for the voltage gain versus R3 and {R1, R2, R4, R5, C1, C2, C3}. The same could be performed for all the other input variables. As can be observed in Figure 12, after the second step, the results were more accurate than those obtained with the previous FIS; hence, the adjusted FIS was used to model the behavior of the circuit. Increasing the number of iterations may reduce the MSE. However, increasing the number of iterations also increases the calculation time. It was, therefore, decided to use 100 iterations for both response variables.
As can be observed in Figure 12, the FIS was capable of adequately predicting the voltage gain behavior. This model could be used to obtain both the interaction and the main effects as well as the response surfaces. Figure 13 shows the response surfaces for the voltage gain versus R 3 and {R 1 , R 2 , R 4 , R 5 , C 1 , C 2 , C 3 }. The same could be performed for all the other input variables.
behavior of the circuit. Increasing the number of iterations may reduce the MSE. However, increasing the number of iterations also increases the calculation time. It was, therefore, decided to use 100 iterations for both response variables.
As can be observed in Figure 12, the FIS was capable of adequately predicting the voltage gain behavior. This model could be used to obtain both the interaction and the main effects as well as the response surfaces. Figure 13 shows the response surfaces for the voltage gain versus R3 and {R1, R2, R4, R5, C1, C2, C3}. The same could be performed for all the other input variables.   Figure 14 shows the results from the first step in the development of the FIS for the THD. As in the previous case, this FIS was capable of accurately modeling the THD and, therefore, its behavior. Similarly, the data shown in Tables A1 and A2 were used to obtain both the MSE and the relative error values of these results.

Results of Modeling Total Harmonic Distortion
The results improved after tuning the FIS, as shown in Figure 15; hence, this tuned FIS was the one employed for modeling the THD.
From this FIS obtained after the second step, both the response surfaces and the main effects as well as the interaction effects were obtained. Figure 16 shows the response surfaces for the THD versus R 1 and all the other components analyzed in this study.  Figure 14 shows the results from the first step in the development of the FIS for the THD. As in the previous case, this FIS was capable of accurately modeling the THD and,   Figure 14 shows the results from the first step in the development of the FIS for the THD. As in the previous case, this FIS was capable of accurately modeling the THD and, The results improved after tuning the FIS, as shown in Figure 15; hence, this tuned FIS was the one employed for modeling the THD.

Results of Modeling Total Harmonic Distortion
From this FIS obtained after the second step, both the response surfaces and the main effects as well as the interaction effects were obtained. Figure 16 shows the response surfaces for the THD versus R1 and all the other components analyzed in this study.  The results improved after tuning the FIS, as shown in Figure 15; hence, this tuned FIS was the one employed for modeling the THD.
From this FIS obtained after the second step, both the response surfaces and the main effects as well as the interaction effects were obtained. Figure 16 shows the response sur-faces for the THD versus R1 and all the other components analyzed in this study.

Discussion
In this section, the results are analyzed to show how this methodology can be used to improve an initial circuit design. Figure 17 shows the main effects plot for the Av. As

Discussion
In this section, the results are analyzed to show how this methodology can be used to improve an initial circuit design. Figure 17 shows the main effects plot for the Av. As

Discussion
In this section, the results are analyzed to show how this methodology can be used to improve an initial circuit design. Figure 17 shows the main effects plot for the Av. As can be seen from Figure 17, the variables that have the strongest influence on the voltage gain are R 3 , which has a positive correlation, and R 4 , which has a negative correlation with the voltage gain. Therefore, an increase in R 3 and a decrease in R 4 would increase the voltage gain of the amplifier. The rest of the parameters have less influence on the voltage gain. Figure 17 shows that the preferred variations to increase the gain voltage are that R 2 increases and R 1 and R 5 decrease. The capacitors have less influence. can be seen from Figure 17, the variables that have the strongest influence on the voltage gain are R3, which has a positive correlation, and R4, which has a negative correlation with the voltage gain. Therefore, an increase in R3 and a decrease in R4 would increase the voltage gain of the amplifier. The rest of the parameters have less influence on the voltage gain. Figure 17 shows that the preferred variations to increase the gain voltage are that R2 increases and R1 and R5 decrease. The capacitors have less influence. Regarding harmonic distortion, the behavior of R4 is unlike that of the voltage gain, i.e., whereas the preferred variation for R4 is to decrease, in order to increase the voltage gain, in the case of the THD, a decrease in R4 provokes greater harmonic distortion. Therefore, a compromise between both variables should be considered.
New values for the circuit components may be selected from the results shown in the main effects plots depicted in Figures 17 and 18. However, in general, these values should Regarding harmonic distortion, the behavior of R 4 is unlike that of the voltage gain, i.e., whereas the preferred variation for R 4 is to decrease, in order to increase the voltage gain, in the case of the THD, a decrease in R 4 provokes greater harmonic distortion. Therefore, a compromise between both variables should be considered.
New values for the circuit components may be selected from the results shown in the main effects plots depicted in Figures 17 and 18. However, in general, these values should be normalized values, and within the same series of tolerances. Moreover, it is possible to employ the fuzzy inference systems developed for both the Av and the THD to predict the response of the circuit. These predicted values are shown in Table 4. Therefore, in the first iteration, it was decided to increase R 3 , selecting a normalized value greater than the one shown in Table 1, and to simultaneously decrease R 4 to a value lower than that shown in Table 1, adopting a normalized value as in the previous case. Therefore, the selected values in this first iteration were R 3 = 7.5 kΩ and R 4 = 0.075 kΩ, leaving the rest of the circuit components unchanged. Using the two fuzzy inference systems developed in the second step for the Av and the THD, their predicted values were Av = 35.2113 and THD = 0.3441%.  Notably, the main effect plots shown in Figures 17 and 18 suggest an increase in the value of R3 of over 7.5 kΩ and a decrease in the value of R4. However, before selecting these values, the circuit stability should be confirmed with the new selected values of the components, which is discussed below. When analyzing the response of the circuit with these new values through simulation, Av = 40.4191 and THD = 0.4140% were obtained. Both fuzzy inference systems offered an approximation of the behavior obtained through simulation, as shown in Figure 19. If the fuzzy inference systems were trained with more values than those employed in Table A1, then their precision would increase. In any case, the FIS was capable of predicting the behavior of both the Av and the THD. Figure 19 shows the initial and the optimized design after the first iteration.  Notably, the main effect plots shown in Figures 17 and 18 suggest an increase in the value of R 3 of over 7.5 kΩ and a decrease in the value of R 4 . However, before selecting these values, the circuit stability should be confirmed with the new selected values of the components, which is discussed below. When analyzing the response of the circuit with these new values through simulation, Av = 40.4191 and THD = 0.4140% were obtained. Both fuzzy inference systems offered an approximation of the behavior obtained through simulation, as shown in Figure 19. If the fuzzy inference systems were trained with more values than those employed in Table A1, then their precision would increase. In any case, the FIS was capable of predicting the behavior of both the Av and the THD. Figure 19 shows the initial and the optimized design after the first iteration. The initial design produced the following values: Av = 27.2472 and THD = 0.2795%. If the harmonic distortion in the new design is considered acceptable, then the voltage gain improvement when R3 = 7.5 kΩ and R4 = 0.075 kΩ is 48%. In any case, to verify that the new design remains stable against variations in resistors and capacitors due to the tolerances of the passive elements of the circuit, a Monte Carlo analysis was conducted with the new design. The components of the circuit were varied using a uniform distribution, and the results of the voltage gain and the harmonic distortion are shown in Figure  20, respectively.  Table 5 shows the average values and the standard deviation of the values shown in Figure 20. As can be observed, the circuit remains stable against variations in the circuit components due to their tolerances. Figure 21 shows the outputs of the Monte Carlo analysis.  The initial design produced the following values: Av = 27.2472 and THD = 0.2795%. If the harmonic distortion in the new design is considered acceptable, then the voltage gain improvement when R 3 = 7.5 kΩ and R 4 = 0.075 kΩ is 48%. In any case, to verify that the new design remains stable against variations in resistors and capacitors due to the tolerances of the passive elements of the circuit, a Monte Carlo analysis was conducted with the new design. The components of the circuit were varied using a uniform distribution, and the results of the voltage gain and the harmonic distortion are shown in Figure 20, respectively. The initial design produced the following values: Av = 27.2472 and THD = 0.2795%. If the harmonic distortion in the new design is considered acceptable, then the voltage gain improvement when R3 = 7.5 kΩ and R4 = 0.075 kΩ is 48%. In any case, to verify that the new design remains stable against variations in resistors and capacitors due to the tolerances of the passive elements of the circuit, a Monte Carlo analysis was conducted with the new design. The components of the circuit were varied using a uniform distribution, and the results of the voltage gain and the harmonic distortion are shown in Figure  20, respectively.  Table 5 shows the average values and the standard deviation of the values shown in Figure 20. As can be observed, the circuit remains stable against variations in the circuit components due to their tolerances. Figure 21 shows the outputs of the Monte Carlo analysis.   Table 5 shows the average values and the standard deviation of the values shown in Figure 20. As can be observed, the circuit remains stable against variations in the circuit components due to their tolerances. Figure 21 shows the outputs of the Monte Carlo analysis.   Table 5 shows that the average value of the voltage gain increases, but the total harmonic distortion worsens. If these THD values are considered acceptable, then new values of R3 and R4 could be selected. In this case, from Figure 18 and Table 4, a higher value than 7.5 kΩ could have been selected.
New values were, therefore, chosen within the 10% series of tolerance (R3 = 9.1 kΩ; R4 = 0.056 kΩ) and the values of all the other components showed no variation with respect to the previous stage. When the new circuit was simulated, the results shown in Figure 22 were obtained, where Av = 55.46574 and THD = 0.6314%. Notably, since the new input values were outside the range of values used to train the FIS, a greater discrepancy was observed in these results with regard to the data obtained through simulation. If the fuzzy inference systems were trained with more values than those employed in Table A1, then their precision would increase. Likewise, if the values of the Monte Carlo analysis obtained with the new modified inputs were used to train the fuzzy inference systems, their precision could also be increased. However, in this study, the fuzzy inference systems developed from data shown in Table A1 were capable of predicting the output variable trends and, hence, they were not modified.  Table 6 shows the average values and the standard deviation values following a Monte Carlo analysis of this new design. These results are shown in Figure 23.  Table 5 shows that the average value of the voltage gain increases, but the total harmonic distortion worsens. If these THD values are considered acceptable, then new values of R 3 and R 4 could be selected. In this case, from Figure 17 and Table 4, a higher value than 7.5 kΩ could have been selected.
New values were, therefore, chosen within the 10% series of tolerance (R 3 = 9.1 kΩ; R 4 = 0.056 kΩ) and the values of all the other components showed no variation with respect to the previous stage. When the new circuit was simulated, the results shown in Figure 22 were obtained, where Av = 55.46574 and THD = 0.6314%. Notably, since the new input values were outside the range of values used to train the FIS, a greater discrepancy was observed in these results with regard to the data obtained through simulation. If the fuzzy inference systems were trained with more values than those employed in Table A1, then their precision would increase. Likewise, if the values of the Monte Carlo analysis obtained with the new modified inputs were used to train the fuzzy inference systems, their precision could also be increased. However, in this study, the fuzzy inference systems developed from data shown in Table A1 were capable of predicting the output variable trends and, hence, they were not modified.  Table 5 shows that the average value of the voltage gain increases, but the total harmonic distortion worsens. If these THD values are considered acceptable, then new values of R3 and R4 could be selected. In this case, from Figure 18 and Table 4, a higher value than 7.5 kΩ could have been selected.
New values were, therefore, chosen within the 10% series of tolerance (R3 = 9.1 kΩ; R4 = 0.056 kΩ) and the values of all the other components showed no variation with respect to the previous stage. When the new circuit was simulated, the results shown in Figure 22 were obtained, where Av = 55.46574 and THD = 0.6314%. Notably, since the new input values were outside the range of values used to train the FIS, a greater discrepancy was observed in these results with regard to the data obtained through simulation. If the fuzzy inference systems were trained with more values than those employed in Table A1, then their precision would increase. Likewise, if the values of the Monte Carlo analysis obtained with the new modified inputs were used to train the fuzzy inference systems, their precision could also be increased. However, in this study, the fuzzy inference systems developed from data shown in Table A1 were capable of predicting the output variable trends and, hence, they were not modified.  Table 6 shows the average values and the standard deviation values following a Monte Carlo analysis of this new design. These results are shown in Figure 23.

̅̅̅̅
̅̅̅̅̅̅̅ (%) (%) Figure 22. Comparison between the initial design and the optimized design with the second iteration. Table 6 shows the average values and the standard deviation values following a Monte Carlo analysis of this new design. These results are shown in Figure 23.  Figure 24 shows the outputs obtained in the Monte Carlo Analysis. As can be observed in Figure 23, the circuit remains stable against variations in the components as a consequence of their tolerances. Moreover, with the new values obtained within the second iteration, the voltage gain increases to 104% compared to the initial circuit design.

Conclusions
In the present study, zero-order Sugeno fuzzy inference systems were optimized with a PSO algorithm and used to model the behavior of an electronic circuit used as a small signal amplifier.
It was shown that a Monte Carlo analysis can be combined with FIS modeling in an iterative process to optimize the design of an electronic circuit. Likewise, the stability of the optimized design and its stability against component variations due to their tolerances should be analyzed in order to select the optimized design, because independent optimizations can lead to results that are not feasible due, in general, to the selection of normalized components for building an electronic circuit.
The methodology analyzed in this study can serve as a basis for improving the design of analog electronic circuits with a similar configuration to the one that was considered in this study. Future research studies will include the application of the proposed methodology to improve the design of other types of analog electronic circuits as well as the use of different fuzzy inference systems and membership functions.  Figure 24 shows the outputs obtained in the Monte Carlo Analysis. As can be observed in Figure 23, the circuit remains stable against variations in the components as a consequence of their tolerances. Moreover, with the new values obtained within the second iteration, the voltage gain increases to 104% compared to the initial circuit design.  Figure 24 shows the outputs obtained in the Monte Carlo Analysis. As can be observed in Figure 23, the circuit remains stable against variations in the components as a consequence of their tolerances. Moreover, with the new values obtained within the second iteration, the voltage gain increases to 104% compared to the initial circuit design.

Conclusions
In the present study, zero-order Sugeno fuzzy inference systems were optimized with a PSO algorithm and used to model the behavior of an electronic circuit used as a small signal amplifier.
It was shown that a Monte Carlo analysis can be combined with FIS modeling in an iterative process to optimize the design of an electronic circuit. Likewise, the stability of the optimized design and its stability against component variations due to their tolerances should be analyzed in order to select the optimized design, because independent optimizations can lead to results that are not feasible due, in general, to the selection of normalized components for building an electronic circuit.
The methodology analyzed in this study can serve as a basis for improving the design of analog electronic circuits with a similar configuration to the one that was considered in this study. Future research studies will include the application of the proposed methodology to improve the design of other types of analog electronic circuits as well as the use of different fuzzy inference systems and membership functions.

Conclusions
In the present study, zero-order Sugeno fuzzy inference systems were optimized with a PSO algorithm and used to model the behavior of an electronic circuit used as a small signal amplifier.
It was shown that a Monte Carlo analysis can be combined with FIS modeling in an iterative process to optimize the design of an electronic circuit. Likewise, the stability of the optimized design and its stability against component variations due to their tolerances should be analyzed in order to select the optimized design, because independent optimizations can lead to results that are not feasible due, in general, to the selection of normalized components for building an electronic circuit.
The methodology analyzed in this study can serve as a basis for improving the design of analog electronic circuits with a similar configuration to the one that was considered in this study. Future research studies will include the application of the proposed methodology to improve the design of other types of analog electronic circuits as well as the use of different fuzzy inference systems and membership functions.
Funding: This research received no external funding.

Conflicts of Interest:
The author declares no conflict of interest.