## 3 Implementation of AOG Network Mechanism within OENNs
### Training Process  
The learning algorithm of OENN is based on the algorithm proposed in [17], and implementing modified recursive least square (RLS) algorithm for updating network weights and calculating the errors:  
\[e_{p}(t)=\sum_{i=1}^{n}\omega_{i}(t-\Delta t)\phi_{i}(t)-\hat{y}(t+n) \tag{19}\]  
where \(e_{p}(t)\) is an error calculated before the weight update process, and \(n\) represents a sample rate defined by system dynamics. Further:  
\[e_{a}(t)=\sum_{i=1}^{n}\omega_{i}(t)C_{g}(t)\phi_{i}(t)-\hat{y}(t+\delta) \tag{20}\]where \(e_{a}(t)\) is calculated error after the procedure of updating weights. In accordance with [17], the idea is that during the time, two errors converge with each other, and in the ideal case their ratio will be:  
\[|e_{a}(t)|/\big{|}e_{p}(t)\big{|}\to 1 \tag{21}\]  
Finally, the learning rate adaptation algorithm [17] is also exploited. Its primary purpose is to monitor the error difference sign in two consequent iterations. If the sign changes, the learning rate value decreases. On the contrary, the learning rate will increase if the sign is the same in two iterations.  
Integration of OENN Structure Powered by AOG Network Mechanism within a Control Logic of a Laboratory Dynamical System  
In order to exploit the proposed framework within a real-time laboratory environment, a presentation of the approach of integrating OENN with AOG Network (OENN + AOG) within an existing control logic of a laboratory dynamical system, is required. The implementation approach is presented in Figure 3.  
To implement the structure appropriately, all identified environmental stimuli should be categorized as SES or PES. The number of SES (I) defines the number of leaf glands, where one leaf gland is required for every unique SES. A similar procedure is required for PES, where each identified PES should be represented by one mediator gland. Another implementation option is to use one gland for multiple identified stimuli, but for accuracy and simplicity reasons, one gland per stimulus will be used for further implementation.  
After identifying the number of mediator glands (\(m\)), it is necessary to create a fully connected network of glands with three layers and with number of nodes, 1-\(m\)-\(l\). One is the number of nodes in the last layer, and by default, this layer always includes just a single root gland. The output root gland signal should be introduced to the output layer weights of OENN, in accordance with Equation (18). In order to form PES and SES, the relevant sensing equipment is required to collect environmental data, process it, and introduce it to the gland network.  
OENN structure should be defined following the number of input signals that should be processed and the number of output control signals that must be introduced to a plant. By default, OENN possesses two inputs introduced from the system of interest: output signal \(Y(t)\) and delayed signal \(Y(t-n)\). If desired performances of the system are not achieved, the number of inputs can be increased, and additional delayed signals can be introduced to the network. Once the number of network inputs and outputs is specified, the number of hidden layer nodes and required setup can be established following the  
Figure 3: Implementation of OENN + AOG within a plant environment.  
procedure from Section 2.3.1 and introducing a proper number of Gegenbauer orthogonal functions.  
Finally, the generated output(s) of the OENN _X(t)_ is introduced to the plant input and the input of the developed plant model. The plant model should be a mathematical representation of a real-time system that will accurately describe system dynamics. The model process is in parallel signal _X(t)_, and represents simulation verification of work of a real plant. In the end, the real-time output of the plant with the model's output is compared. The error is found and introduced in front of mediator glands as a trigger component for their activation (Section 3.2).