## 2 Materials and Methods
### Adaptive Scheme Based on B-Spline Neural Networks  
The control law given by Equation (10) requires the design parameters \(\beta_{i}\), which in the present contribution are calculated in an adaptive way. Thus, the regulation strategy becomes Equation (15). However, to guarantee a correct performance of the algorithm, dynamic control gains \(\beta_{i}(t)\) are considered. An important alternative to attain this adaptive performance is the use of a class of Neural Networks with an instantaneous learning rule, named B-spline Neural Networks (BSNN) [31]. The BSNN has a structure of a layer of inputs, an internal layer where basis functions must be defined in a correct way considering the main features of the input signals and an output layer. In this paper, the output of the BSNN is defined to dynamically calculate the value of \(p(t)\) in Equation (14); thus,  
\[p(t)=\textbf{B}^{T}\textbf{W} \tag{16}\]  
where **B** is a column vector of basis function output and **W** is a column vector with an updating rule which ponders the contribution of each neuron depending on the input signal information (weighting vector), \(p\) is a scalar. These vectors are with the same size and it depends on the number of neurons in the internal layer which is defined in the offline training. Two main stages are required to use this adaptive configuration: (i) offline, where a correct BSNN structure is defined, and (ii) online, where the BSNN is included in the control law responding to important changes in the input error; the reader can review more details of these steps in [32] and references therein. Two main characteristics are searching by the use of this topology: (i) a friendly NN structure with high accuracy when it is implemented and (ii) the possibility of an instantaneous learning rule as a perspective of online and continuous learning. The recurrence of updating depends on the presented changes of the selected input signals, in this paper, this input is defined by the error between the desired trajectory and the actual one, \(\epsilon_{\delta}(t)=y-y^{*}\). Three neurons are used in the hidden layer and the basis functions are defined of third order and the knot vectors between the limits of \(\pm 5\) as the procedure shows in [32]. The initial values of the weighting vector are obtained in the offline training where a map of input/output data is used, representing the typical dynamic operation of the power system. The increment in the instantaneous learning rule is determined by [31],  
\[\Delta\textbf{W}(e_{\delta})=-\frac{\eta\textbf{B}(e_{\delta})}{\|\textbf{B}( e_{\delta})\|^{2}}e_{\delta} \tag{17}\]  
where \(\|\cdot\|\) denotes the Euclidean norm and \((e_{\delta})\) defines the dependency on the input signal, this feature helps the algorithm attain high accuracy dynamic performance. Additionally, \(\eta\) is called the learning rate, which results in acceptable performance if it is defined as \(\leq 1.0\)after, in the offline step a fine tuning is carried out to reach the best learning performance. Thus, the weighting vector updates as \(\mathbf{W}_{new}=\mathbf{W}_{old}+\Delta\mathbf{W}\). To improve the learning rule convergence, it is proposed to add a dead band considering the main characteristics of the input signal \(e_{\delta}\); in this case, it is defined as \(1\times 10^{-4}\). If the error is less than this value, the increment \(\Delta\mathbf{W}\) is zero; thus, the previous value is preserved. In this way, it is feasible to define online a dynamic value of \(\beta_{i}\) in Equation (15). In this case, \(p(t)\) is determined via Equation (16); then, it is possible to calculate Equation (14). Accordingly, any perturbation to the synchronous generator is observed by the proposed algorithm updating the design parameters \(\beta_{i}\) in the control law and, in consequence, an adaptive performance is achieved.