## 3 Methods  
### Energy Price Optimization  
The ISO determines the energy price based on the optimization of the GENCO offers and the amount of power from the DISCO demand in a system based on the mechanism in Figure 1. Generally, the energy offer characteristics of GENCOs can vary, yet in this paper, the offer function in the form of a step function is considered, as shown in Figure 2. This function is a form of function that is not differentiable.  
Figure 1: LCP Mechanism.  
The step function in Figure 2 can be expressed by (2).  
\[f(P)=\left\{\begin{array}{ll}\rho_{1},&P_{min}\leq P<P_{1}\\ \rho_{2},&P_{1}\leq P<P_{2}\\ \rho_{3},&P_{2}\leq P<P_{3}\\ \rho_{4},&P_{3}\leq P<P_{4}\\ \rho_{5},&P_{4}\leq P\leq P_{max}\end{array}\right. \tag{2}\]  
where \(f(P)\) is a function of fuel price in the form of a step function and \(\rho_{1}\) is the price of fuel in the power range between \(P_{min}\) and \(P_{1}\). \(P_{min}\) is the minimum power limit, and \(P_{max}\) is the maximum power limit.  
Therefore, the optimization problem can be formulated with the objective function (\(F\)) and its constraints as follows:  
* Objective Function \[F=\sum_{i=1}^{n}f_{i}(P_{i})\] (3)
* Equation Constraints \[P_{D}=\sum_{i=1}^{n}P_{i}\] (4) where \(P_{D}\) is the demand load.
* Inequality Constraints \[P_{min-i}\leq P_{i}\leq P_{max-i}\] (5)  
As previously mentioned, the paper engaged the direct method suggested by [37]. This method is practical and superior in both speed and accuracy. However, the optimization problem must be in the form of a quadratic function. For this reason, a quadratic approach is used. The characteristics of the offer in Figure 2 can be approximated by a quadratic form, as presented in Figure 3. With this approach, the characteristics of the offers, in general, are shown in (6).  
\[f(P)=a+bP+cP^{2} \tag{6}\]  
where \(a\), \(b\), and \(c\) are parameters of the fuel cost function in the quadratic form.  
Figure 2: Characteristics of the offer function.  
The optimization problem is solved by the LaGrange function, which is:  
\[\varnothing=\sum_{i=1}^{n}f_{i}(P_{i})+\lambda\left(\sum_{i=1}^{n}P_{i}-P_{D}\right) \tag{7}\]  
where \(\lambda\) is the LaGrange multiplier. The partial derivative of (7) is  
\[\lambda_{i}=b+2c_{i}P_{i} \tag{8}\]  
The optimal conditions must meet the following:  
\[\lambda=\lambda_{1}=\lambda_{2}=\ldots=\lambda_{i} \tag{9}\]  
From (8) and (9), the generator power is obtained, namely  
\[P_{i}=\frac{\lambda-b}{2c_{i}} \tag{10}\]  
For \(n\) generators, the power obtained is  
\[P_{d}=\sum_{i=1}^{n}P_{i}=\sum_{i=1}^{n}\frac{\lambda-b}{2c_{i}} \tag{11}\]  
From (11), the Lagrange multiplier factor can be calculated directly, namely:  
\[\lambda=\frac{P_{D}+\sum_{i=1}^{n}\frac{b_{i}}{2c_{i}}}{\sum_{i=1}^{n}\frac{1} {2c_{i}}} \tag{12}\]  
Furthermore, the value of Pi is directly obtained based on the derivative of Equation (6), namely:  
\[P_{i}=\frac{\lambda-b_{i}}{2a_{i}} \tag{13}\]  
This settlement is still not final and needs to be checked with each GENCO limit with the following conditions:  
\[P_{i}=\frac{\lambda-b_{i}}{2a_{i}} \tag{14}\]  
1. if \(P_{i}>P_{max-i}\), then \(P_{opt-i}=P_{max-i}\)
2. if \(P_{min-i}\leq P_{i}\leq P_{max-i}\), then \(P_{opt-i}=P_{i}\).
3. If \(P_{i}<P_{min-i}\), then \(P_{opt-i}=0\).  
Figure 3: Quadratic Approach.  
Note that \(P_{opt-i}\) is the optimal power. If conditions a and b occur, then GENCO wins the competition. In contrast, condition c indicates that the competition is lost.  
This direct method (DM) has been validated by several methods, namely, the genetic algorithm (GA), lambda iteration (LI), dynamic programming (DP), and large to small area technique (LSAT), for 15 generators. The direct method gives the best results, namely, the lowest cost (32,502.92), as shown in Table 1.  
The computational time of the DM is much more competitive than that of the iteration method, as the computation time of the DM is 0.22 s and the computation time of the iteration method (e.g., LSAT) is greater than 20 s [40].