# Power Load Demand Forecasting Model and Method Based on Multi-Energy Coupling
## 3 Model Construction
### Adaptive Fireworks Algorithm (AFWA)
#### 3.2.1 Fwa  
The main calculation components of fireworks algorithm include explosion operator, mutation operation, mapping rule, and selection operation. For optimization problem, we could usually translate the problem into the following form:  
\[min\ f(X) \tag{7}\] \[s.t.\ g_{t}(X)\leq 0(t=1,2,\cdots,m)\,\]where, \(f(X)\) is the objective function, \(g_{t}(X)\) is the constraint function, and \(X\) is the n-dimension optimization variable. Here, the objective function was set as the minimum error between the predicted value and the actual value of load. Based on this, we interpreted the flow of AFWA algorithm. * Initialize data The initialization data content is Formula (8). \[x_{ij}(0)=x_{ij}^{L}+rand(0,1)\left(x_{ij}^{L}-x_{ij}^{L}\right)\] (8) where, \(x_{ij}(0)\) is the spatial position of the \(i\)-th primary fireworks in the \(j\)-th dimension, \(x_{ij}^{L}\) and \(x_{ij}^{L}\) are the upper and lower bounds of dimension respectively, and \(rand(0,1)\) represents the random number generated in the direction greater than 0 and less than 1, \(i=1,2,\cdots,N\), \(j=1,2,\cdots,n\). In this paper, \(x_{i}(0)\) represents the width parameters and penalty parameters of LSSVM,
* Explosion operator. The explosion operator mainly includes the explosion intensity, explosion amplitude, and displacement variation, among which the explosion intensity is reflected as the number of sparks. The calculation method is as follows. \[N_{i}=\hat{N}\bullet\frac{Y_{max}-f(X_{i})+\varepsilon}{\sum\limits_{i=1}^{N} \left(Y_{max}-f(X_{i})\right)+\varepsilon},\] (9) where, \(N_{i}\) is the number of sparks in the \(i\)-th fireworks, \(\hat{N}\) is the constant controlling the total number of sparks, \(Y_{max}=max(f(X_{i}))\) is the adaptive value of the individual with the worst fitness, \(f(X_{i})\) is the fitness value of the individual \(X_{i}\), and \(\varepsilon\) is the minimum constant preventing the denominator from being 0. Meanwhile, to prevent too many or too few sparks, we set the following rules: \[N_{i}=\left\{ \begin{array}{c}round(N_{min}),\ N_{i}<N_{min}\\ round(N_{max}),\ N_{i}>N_{max}\\ round(N_{i}),\ others\end{array} \right.,\] (10) where, \(round()\) is the integer function. \[A_{i}=\hat{A}\bullet\frac{f(X_{i})-Y_{min}+\varepsilon}{\sum\limits_{i=1}^{N} \left(f(X_{i})-Y_{min}\right)+\varepsilon},\] (11) where, \(A_{i}\) is the range of explosion amplitude of the \(i\)-th fireworks, \(\hat{A}\) is the constant limiting the maximum explosion amplitude, and \(Y_{min}=min(f(X_{i}))\) is the adaptive value of the individuals with the best fitness. Then, the fireworks are moved from all dimensions: \[\Delta x_{ij}=x_{ij}+rand(0,A_{i}).\] (12)
* Mutation operator Here we mainly used Gaussian variation. \[x_{ij}=x_{ij}g,\] (13) where \(g\sim N(1,1)\) is the Gaussian distribution with mean and variance of \(1\). * Mapping rules  
The mapping rule is an algorithm that maps sparks beyond the boundary to the limited range by some method. It mainly includes the modular operation rule, specular reflection rule, random mapping rule, and so on. The modular operation rule was adopted here. \[x_{ij}=x_{ij}^{L}+\left|x_{ij}^{L}\right|^{\omega_{0}}\!\!\left(x_{ij}^{UI}-x_{ ij}^{L}\right)\!, \tag{14}\]  
where, % represents modular operation, \(x_{ij}\) represents the position of the \(i\)-th individual in the \(j\)-th dimension, and \(x_{ij}^{UI},x_{ij}^{L}\) represents the upper and lower boundary of the \(j\)-th dimension respectively. * Select operation  
The selection operation in this paper adopted distance-based selection and random selection, and Euclidean distance was adopted to calculate and select the distance between two individuals. \[R(X_{i})=\sum_{q=1}^{K}d\!\left(X_{i},X_{q}\right)=\sum_{q=1}^{K}\left\|X_{i}- X_{q}\right\|\!, \tag{15}\]  
where, \(R(X_{i})\) represents the sum of the distance between \(X_{i}\) and all other individuals, \(d\!\left(X_{i},X_{q}\right)\) represents the Euclidean distance between any two individuals \(X_{i},X_{q}\), and \(K\) is the location set of all sparks after Gaussian compilation.