**3. Description of the RTNN topology and learning**

The more general BP rule for single neuron learning is the delta rule of Widrow and Hoff, given in Haykin, 1999. If we define the cost function of learning as:

$$\xi(k) = (1 \;/\ \mathcal{D})e^2(k), e(k) = t(k) - y(k)$$

where ( ) *k* is the cost function, e(k) is the neuron output error, y(k) is the neuron output signal, t(k) is the neuron output target signal, w(k) is the neuron weight, x(k) is the neuron input, we could write the following delta rule of neuron learning as:

$$w(k+1) = w(k) + \Delta w(k), \Delta w(k) = \eta e(k)x(k)$$

We could generalise this delta rule and applied it for learning of multilayer feedforward, recurrent or mixed neural networks if we design and draw its topology in block form. Then using the diagrammatic method (see Wan & Beaufays, 1996) we could design the adjoint NN topology. The NN topology is used to execute the forward pass of the BP learning so to compute predictions of the input signals of NN weight blocks. The adjoint NN topology is used to execute the backward pass of the BP learning so to compute predictions of the error signals of the outputs of that NN weight blocks. So having both predictions we could execute the delta learning rule layer by layer and weight by weight. In the following part we will apply this simple methodology for the two layered RTNN topology and learning given in vector matrix form where the delta rule is generalized as vector product of the local error and local input RTNN vectors.

#### **3.1 RTNN topology and recursive BP learning**

The block-diagrams of the RTNN topology and its adjoint, obtained by means of the diagrammatic method of (Wan & Beaufays, 1996), are given on Fig. 2, and Fig. 3. Following Fig. 2, and Fig. 3, we could derive the dynamic BP algorithm of its learning based on the RTNN topology and its adjoined using the generalized delta rule, given above. The RTNN topology is described in vector-matrix form as:

$$AX(k+1) = AX(k) + BLU(k), \\ B^T = \begin{vmatrix} B\_1 & B\_2 \end{vmatrix}, \\ L^T = \begin{vmatrix} LI\_1 & LI\_2 \end{vmatrix} \tag{17}$$

Centralized Distributed Parameter Bioprocess

Gaspar, 2009; Baruch & Mariaca-Gaspar, 2010).

Where: L (k) 1 and L (k) 2 are given by:

identification error is bounded, i.e.:

where the condition for L (k+1)<0 1 is that:

Identification and I-Term Control Using Recurrent Neural Network Model 181

RTNN model, to be updated; W (C, A, B), is the weight correction of W; , are learning rate parameters; C is a weight correction of the learned matrix C; B is a weight correction of the learned matrix B; A is a weight correction of the learned matrix A; the diagonal of the matrix A is denoted by Vec() and equation (22) represents its learning as an element-by-element vector products; E, E1, E2, E3, are error vectors with appropriate dimensions, predicted by the adjoint RTNN model, given on Fig.3. The stability of the RTNN model is assured by the activation functions (-1, 1) bounds and by the local stability weight bound condition, given by (19). Below it is given a theorem of RTNN stability which represented an extended version of Nava's theorem, (Baruch et al., 2008; Baruch & Mariaca-

**Theorem of stability of the BP RTNN.** Let the RTNN with Jordan Canonical Structure is

( 1) [ ( ), ( )], ( ) [ ( )] *X k GX k Uk Y k FX k p p pp* (25)

where: {Yp (), Xp (), U()} are output, state and input variables with dimensions L, Np, M, respectively; F(), G() are vector valued nonlinear functions with respective dimensions. Under the assumption of RTNN identifiability made, the application of the BP learning algorithm for A(), B(), C(), in general matricial form, described by equation (20)-(24), and the learning rates η (k), (k) (here they are considered as time-dependent and normalized

<sup>2</sup>

 <sup>2</sup> ; *TTT L k tr W k W k tr W k W k tr W k W k AA BB CC*

Here: \*\* \* *W k Ak A W k Bk B W k Ck C A BC* ,, , are vectors of the

weight estimation error; \*\* \* (A ,B ,C ) , ˆ ˆ ˆ (A(k),B(k),C(k)) denote the ideal neural weight and the estimate of the neural weight at the k-th step, respectively, for each case. Then the

> 

*Lk L k L k Lk Lk Lk*

1 2 1 1 1 0, 1 1;

max max max

;

 

1 1 1 1 2 2 

 

*Lk ek*

<sup>1</sup> , <sup>2</sup>

1 2 *Lk L k L k* ( ) ( ) ( ), (26)

given by equations (17)-(19) (see Fig.2) and the nonlinear plant model, is as follows:

with respect to the error) are derived using the following Lyapunov function:

1

$$V(k) = \mathbb{C}Z(k), \mathbb{C} = \begin{vmatrix} \mathbb{C}\_1 & \mathbb{C}\_0 \end{vmatrix}, Z^T = \begin{vmatrix} Z\_1 & Z\_2 \end{vmatrix}, Z\_1(k) = \mathbb{G}[X(k)], \\ Y(k) = F[V(k)] \tag{18}$$

$$A = b \log k - \text{diag}(A\_i)\_t \left| A\_i \right| < 1 \tag{19}$$

The BP learning is described in the following general form:

$$\mathcal{W}(k+1) = \mathcal{W}(k) + \eta \Delta \mathcal{W}(k) + a \Delta \mathcal{W}(k-1) \tag{20}$$

Using the adjoint RTNN we could derive the BP learning for the RTNN weights applying the generalized delta rule as vectorial products of input and error predictions, as:

$$
\Delta \mathbf{C}(k) = \mathbf{E}\_1(k) \mathbf{Z}^T(k), \Delta \mathbf{B}(k) = \mathbf{E}\_3(k) \mathbf{L}^T(k), \Delta \mathbf{A}(k) = \mathbf{E}\_3(k) \mathbf{X}^T(k) \tag{21}
$$

$$\operatorname{Vec}(\Delta A(k)) = E\_3(k) \otimes X(k) \tag{22}$$

Where the error predictions are obtained from the adjoint RTNN as follows:

$$E(k) = T(k) - Y(k), \\ E\_1(k) = F^\cdot[Y(k)]E(k), \\ F^\cdot[Y(k)] = [1 - Y^2(k)]\tag{23}$$

Fig. 2. Block diagram of the RTNN model

Fig. 3. Block diagram of the adjoint RTNN model

$$E\_2(k) = \mathbf{C}^T(k)E\_1(k),\\ E\_3(k) = \mathbf{G}^\cdot[\mathbf{Z}(k)]E\_2(k),\\ \mathbf{G}^\cdot[\mathbf{Z}(k)] = [1 - \mathbf{Z}^2(k)]\tag{24}$$

Here: X, Y, U are state, augmented output, and input vectors with dimensions N, (L+1), (M+1), respectively, where Z1 and U1 are the (Nx1) output and (Mx1) input of the hidden layer; the constant scalar threshold entries are Z2 = -1, U2 = -1, respectively; V is a (Lx1) presynaptic activity of the output layer; T is the (Lx1) plant output vector, considered as a RTNN reference; A is (NxN) block-diagonal weight matrix; B and C are [Nx(M+1)] and [Lx(N+1)]- augmented weight matrices; B0 and C0 are (Nx1) and (Lx1) threshold weights of the hidden and output layers; F[], G[] are vector-valued tanh()-activation functions with corresponding dimensions; F'[], G'[] are the derivatives of these tanh() functions, computed by (23), (24); W is a general weight, denoting each weight matrix (C, A, B) in the

*Wk Wk Wk Wk* ( 1) ( ) ( ) ( 1) 

Using the adjoint RTNN we could derive the BP learning for the RTNN weights applying

the generalized delta rule as vectorial products of input and error predictions, as:

Where the error predictions are obtained from the adjoint RTNN as follows:

The BP learning is described in the following general form:

Fig. 2. Block diagram of the RTNN model

Fig. 3. Block diagram of the adjoint RTNN model

1 0 1 21 ( ) ( ), , , ( ) [ ( )], ( ) [ ( )] *<sup>T</sup> V k CZ k C C C Z Z Z Z k G X k Y k F V k* (18)

13 3 ( ) ( ) ( ), ( ) ( ) ( ), ( ) ( ) ( ) *TT T Ck E kZ k Bk E kU k Ak E kX k* (21)

,, 2 <sup>1</sup> *Ek Tk Yk E k F Yk Ek F Yk Y k* ( ) ( ) ( ), ( ) [ ( )] ( ), [ ( )] [1 ( )] (23)

,,2 2 13 <sup>2</sup> ( ) ( ) ( ), ( ) [ ( )] ( ), [ ( )] [1 ( )] *<sup>T</sup> E k C kE k E k G Zk E k G Zk Z k* (24)

Here: X, Y, U are state, augmented output, and input vectors with dimensions N, (L+1), (M+1), respectively, where Z1 and U1 are the (Nx1) output and (Mx1) input of the hidden layer; the constant scalar threshold entries are Z2 = -1, U2 = -1, respectively; V is a (Lx1) presynaptic activity of the output layer; T is the (Lx1) plant output vector, considered as a RTNN reference; A is (NxN) block-diagonal weight matrix; B and C are [Nx(M+1)] and [Lx(N+1)]- augmented weight matrices; B0 and C0 are (Nx1) and (Lx1) threshold weights of the hidden and output layers; F[], G[] are vector-valued tanh()-activation functions with corresponding dimensions; F'[], G'[] are the derivatives of these tanh() functions, computed by (23), (24); W is a general weight, denoting each weight matrix (C, A, B) in the

( ), 1 *A block diag A A i i* (19)

<sup>3</sup> *Vec A k E k X k* ( ( )) ( ) ( ) (22)

(20)

RTNN model, to be updated; W (C, A, B), is the weight correction of W; , are learning rate parameters; C is a weight correction of the learned matrix C; B is a weight correction of the learned matrix B; A is a weight correction of the learned matrix A; the diagonal of the matrix A is denoted by Vec() and equation (22) represents its learning as an element-by-element vector products; E, E1, E2, E3, are error vectors with appropriate dimensions, predicted by the adjoint RTNN model, given on Fig.3. The stability of the RTNN model is assured by the activation functions (-1, 1) bounds and by the local stability weight bound condition, given by (19). Below it is given a theorem of RTNN stability which represented an extended version of Nava's theorem, (Baruch et al., 2008; Baruch & Mariaca-Gaspar, 2009; Baruch & Mariaca-Gaspar, 2010).

**Theorem of stability of the BP RTNN.** Let the RTNN with Jordan Canonical Structure is given by equations (17)-(19) (see Fig.2) and the nonlinear plant model, is as follows:

$$X\_p(k+1) = G[X\_p(k), \mathcal{U}(k)] \lrcorner Y\_p(k) = F[X\_p(k)] \tag{25}$$

where: {Yp (), Xp (), U()} are output, state and input variables with dimensions L, Np, M, respectively; F(), G() are vector valued nonlinear functions with respective dimensions. Under the assumption of RTNN identifiability made, the application of the BP learning algorithm for A(), B(), C(), in general matricial form, described by equation (20)-(24), and the learning rates η (k), (k) (here they are considered as time-dependent and normalized with respect to the error) are derived using the following Lyapunov function:

$$L(k) = L\_1(k) + L\_2(k),\tag{26}$$

Where: L (k) 1 and L (k) 2 are given by:

$$L\_1(k) = \frac{1}{2}e^2 \begin{pmatrix} k \end{pmatrix},$$

$$L\_2\begin{pmatrix} k \end{pmatrix} = tr\left(\widetilde{\mathcal{W}}\_A\left(k\right)\widehat{\mathcal{W}}\_A^T\left(k\right)\right) + tr\left(\widetilde{\mathcal{W}}\_B\left(k\right)\widehat{\mathcal{W}}\_B^T\left(k\right)\right) + tr\left(\widetilde{\mathcal{W}}\_C\left(k\right)\widehat{\mathcal{W}}\_C^T\left(k\right)\right);$$

Here: \*\* \* *W k Ak A W k Bk B W k Ck C A BC* ,, , are vectors of the weight estimation error; \*\* \* (A ,B ,C ) , ˆ ˆ ˆ (A(k),B(k),C(k)) denote the ideal neural weight and the estimate of the neural weight at the k-th step, respectively, for each case. Then the identification error is bounded, i.e.:

$$\begin{aligned} L\left(k+1\right) &= L\_1\left(k+1\right) + L\_2\left(k+1\right) < 0, \\ \Delta L\left(k+1\right) &= L\left(k+1\right) - L\left(k\right); \end{aligned}$$

where the condition for L (k+1)<0 1 is that:

$$\frac{\left(1 - \frac{1}{\sqrt{2}}\right)}{\left|\nu\_{\text{max}}\right|} < \eta\_{\text{max}} < \frac{\left(1 + \frac{1}{\sqrt{2}}\right)}{\left|\nu\_{\text{max}}\right|};$$

Centralized Distributed Parameter Bioprocess

Identification and I-Term Control Using Recurrent Neural Network Model 183

Where: W is a general weight matrix (A, B, C) under modification; P is a symmetric matrix updated by (37); DY[] is an Nw-dimensional gradient vector; Y is the RTNN output vector which depends of the updated weights and the input; E is an error vector; Yp is the plant output vector, which is in fact the target vector. Using the same RTNN adjoint block diagram (see Fig.3), it was possible to obtain the values of the gradients DY[] for each updated weight, propagating the value D(k) = I through it. Applying equation (30) and using the RTNN adjoint (see Fig. 3) we could compute each weight matrix (A, B, C) in order

'

1 1 1 1 1 ; *<sup>T</sup> Pk k Pk Pk Wk S Wk Wk Pk*

1 , *<sup>T</sup> SWk k k Wk Pk Wk*

( ) ( ) ; 010

*T*

0.97 1; 10 0 10 .

*k P*

*<sup>T</sup> Y Wk W k*

1 0

 

1 4 6

; 10 10 ; <sup>0</sup>

3 6

*gWk Uk DY W k*

to be updated. The corresponding gradient components are found as follows:

Therefore the Jacobean matrix could be formed as:

The P(k) matrix was computed recursively by the equation:

where the S(), and Ω() matrices were given as follows:

*k*

,

*<sup>W</sup>*

<sup>2</sup> <sup>2</sup> , *E Wk Y k gWk Uk <sup>p</sup>* , (29)

*DY C k D k Z k ij* 1,*i j* , (31)

2, , *DY A k D k X k ij i j* (33)

2, , *DY B k D k U k ij i j* (34)

2, 1, . *D k G Z k CD k i ij ii* (35)

*DY W k DY C k DY A k DY B k ij* ,, . *ij ij* (36)

(38)

(39)

(37)

' *D k FYk* 1,*i ji* , (32)

*W Wk*

; (30)

and for L (k+1)<0 2 we have:

$$
\Delta L\_2 \left( k + 1 \right) < -\eta\_{\text{max}} \left| e \left( k + 1 \right) \right|^2 \alpha\_{\text{max}} \left| e \left( k \right) \right|^2 + d \left( k + 1 \right).
$$

Note that ηmax changes adaptively during the RTNN learning and:

$$\eta\_{\text{max}} = \max\_{i=1}^{3} \{ \eta\_i \};$$

where all: the unmodelled dynamics, the approximation errors and the perturbations, are represented by the d-term. The rate of convergence lemma used, is given below. The complete proof of that Theorem of stability is given in (Baruch et al., 2008).

**Rate of convergence lemma** (Baruch & Mariaca-Gaspar, 2009)**.** Let *Lk* is defined. Then, applying the limit's definition, the identification error bound condition is obtained as:

$$\overline{\lim\_{k \to \infty}} \frac{1}{k} \sum\_{t=1}^{k} \left( \left| E(t) \right|^2 + \left| E(t-1) \right|^2 \right) \le d.$$

**Proof.** Starting from the final result of the theorem of RTNN stability:

$$
\Delta L\left(k\right) \le -\eta\left(k\right)\left|E\left(k\right)\right|^2 - \alpha\left(k\right)\left|E\left(k-1\right)\right|^2 + d
$$

and iterating from k=0, we get:

$$\begin{aligned} L\left(k+1\right) - L\left(0\right) &\leq -\sum\_{t=1}^{k} \left| E\left(t\right) \right|^2 - \sum\_{t=1}^{k} \left| E\left(t-1\right) \right|^2 + dk, \\\\ \sum\_{t=1}^{k} \left( \left| E\left(t\right) \right|^2 + \left| E\left(t-1\right) \right|^2 \right) &\leq dk - L\left(k+1\right) + L\left(0\right) \leq dk + L\left(0\right). \end{aligned}$$

From here, we could see that *d* must be bounded by weight matrices and learning parameters, in order to obtain: *L k* .

As a consequence: *Ak Bk Ck* , ,

#### **3.2 Recursive Levenberg-Marquardt RTNN learning**

The general recursive L-M algorithm of learning, (Baruch & Mariaca-Gaspar, 2009; Baruch & Mariaca-Gaspar, 2010) is given by the following equations:

$$\mathbf{W}(k+1) = \mathbf{W}(k) + P(k)\nabla Y\left[\mathbf{W}(k)\right]\mathbf{E}\left[\mathbf{W}(k)\right],\tag{27}$$

$$Y\left[\mathcal{W}(k)\right] = \mathcal{g}\left[\mathcal{W}(k), \mathcal{U}(k)\right],\tag{28}$$

2 2

 

 3 max <sup>1</sup>

 

max ; *<sup>i</sup> <sup>i</sup>*

where all: the unmodelled dynamics, the approximation errors and the perturbations, are represented by the d-term. The rate of convergence lemma used, is given below. The

**Rate of convergence lemma** (Baruch & Mariaca-Gaspar, 2009)**.** Let *Lk* is defined. Then, applying the limit's definition, the identification error bound condition is obtained as:

<sup>1</sup> lim 1 .

*Et Et d <sup>k</sup>* 

 2 2 *Lk k Ek k Ek d*

2 2

 

1 1 1 0 1 , *k k*

2 2

*t t L k L E t E t dk* 

*E t E t dk L k L dk L*

From here, we could see that *d* must be bounded by weight matrices and learning

The general recursive L-M algorithm of learning, (Baruch & Mariaca-Gaspar, 2009; Baruch &

1

1 1 0 0.

W 1 =W *k k Pk YWk EWk* , (27)

*YWk gWk Uk* , , (28)

2 2

*ek ek dk* 1 1 .

<sup>2</sup> max max *L k* 1 

complete proof of that Theorem of stability is given in (Baruch et al., 2008).

1

*k*

*<sup>k</sup> <sup>t</sup>*

As a consequence: *Ak Bk Ck* , ,

**3.2 Recursive Levenberg-Marquardt RTNN learning** 

Mariaca-Gaspar, 2010) is given by the following equations:

**Proof.** Starting from the final result of the theorem of RTNN stability:

Note that ηmax changes adaptively during the RTNN learning and:

and for L (k+1)<0 2 we have:

and iterating from k=0, we get:

1

parameters, in order to obtain: *L k* .

*t*

*k*

$$E^2\left[\mathcal{W}(k)\right] = \left\{Y\_p(k) - \mathcal{g}\left[\mathcal{W}(k), \mathcal{U}(k)\right]\right\}^2,\tag{29}$$

$$\frac{1}{2}DY\left[\mathcal{W}(k)\right] = \frac{\partial \mathcal{g}\left[\mathcal{W}(k), \mathcal{U}(k)\right]}{\partial \mathcal{W}}\bigg|\_{\mathcal{W} = \mathcal{W}(k)};\tag{30}$$

Where: W is a general weight matrix (A, B, C) under modification; P is a symmetric matrix updated by (37); DY[] is an Nw-dimensional gradient vector; Y is the RTNN output vector which depends of the updated weights and the input; E is an error vector; Yp is the plant output vector, which is in fact the target vector. Using the same RTNN adjoint block diagram (see Fig.3), it was possible to obtain the values of the gradients DY[] for each updated weight, propagating the value D(k) = I through it. Applying equation (30) and using the RTNN adjoint (see Fig. 3) we could compute each weight matrix (A, B, C) in order to be updated. The corresponding gradient components are found as follows:

$$DY\left[C\_{i\dagger}(k)\right] = D\_{1,i}\left(k\right)Z\_{\dagger}\left(k\right),\tag{31}$$

$$D\_{1,i}(k) = F\_j^\prime \left[ Y\_i(k) \right]\_\prime \tag{32}$$

$$DY\left[A\_{ij}\left(k\right)\right] = D\_{2,i}\left(k\right)X\_j\left(k\right),\tag{33}$$

$$DY\left[B\_{\vec{\eta}}\left(k\right)\right] = D\_{2,i}\left(k\right)\mathcal{U}\_{\vec{\eta}}\left(k\right),\tag{34}$$

$$D\_{2,i}\left(k\right) = \mathbf{G}\_i^\cdot \left[Z\_j\left(k\right)\right] \mathbf{C}\_i D\_{1,i}\left(k\right). \tag{35}$$

Therefore the Jacobean matrix could be formed as:

$$DY\left[\boldsymbol{W}(k)\right] = \left[DY\left(\mathbf{C}\_{\vec{\eta}}(k)\right), DY\left(A\_{\vec{\eta}}\left(k\right)\right), DY\left(B\_{\vec{\eta}}\left(k\right)\right)\right].\tag{36}$$

The P(k) matrix was computed recursively by the equation:

$$P(k) = \alpha^{-1}(k)\left(P(k-1) - P(k-1)\Omega\left[\mathcal{W}(k)\right]\right)S^{-1}\left[\mathcal{W}(k)\right]\Omega^T\left[\mathcal{W}(k)\right]P(k-1)\right);\tag{37}$$

where the S(), and Ω() matrices were given as follows:

$$S\left[\mathcal{W}(k)\right] = \alpha(k)\Lambda(k) + \Omega^T \left[\mathcal{W}(k)\right] P(k-1)\Omega\left[\mathcal{W}(k)\right],\tag{38}$$

$$\Omega^T \left[ \mathcal{W}(k) \right] = \left| \begin{array}{cccc} & \nabla Y^T \left[ \mathcal{W}(k) \right] \\ 0 & \cdots & 1 \\ 0 & \rho \end{array} \right|; \qquad \text{1} \tag{39}$$
 
$$\Lambda(k)^{-1} = \begin{bmatrix} 1 & 0 \\ 0 & \rho \end{bmatrix}; \quad 10^{-4} \le \rho \le 10^{-6}; \tag{39}$$
 
$$0.97 \le \alpha(k) \le 1; \quad 10^3 \le P(0) \le 10^6.$$

Centralized Distributed Parameter Bioprocess

equation, derived following the block-diagram of the Fig. 4:

Substituting (47) in (48), finally we obtained:

zero when z tended to 1.

**control with I-term** 

computed using (41).

Identification and I-Term Control Using Recurrent Neural Network Model 185

1() ( ) *Q z C zI A B c c cv*

<sup>2</sup> () ( ) *Q z C zI A B c c cx*

3() ( ) *Q z C zI A B c c cr*

The RTNN topology is controllable and observable, and the BP/L-M algorithms of learning are convergent, (see Baruch & Mariaca-Gaspar, 2009; Baruch & Mariaca-Gaspar, 2010). Then the identification and control errors tend to zero (Ei(k) = Yp(k) – Y(k) → 0 and Ec(k) = R(k) - Yp(k) → 0; k → ∞). This means that each transfer function given by equations (42)-(46) is stable with minimum phase. The z-transfer functions (42)-(47) are connected by the next

( )[ ( ) ( )] [ ( ) ( ) ( )] ( ) ( ) ( )

( )[ ( ) ( )] [ ( ) ( 1) ( )] ( ) ( )( 1) ( )

*W z I Q z P z Q z T z Q z R z W z z Of z*

The equation (49) showed that the closed-loop system is stable (Yp(k) → R(k); k → ∞) and that the I-term eliminated the constant perturbation Of(z) because the last term tended to

The centralized DPS could be considered as a system with excessive measurements (L>M), where the Direct Adaptive Neural Control (DANC) performed a data fusion so to elaborate the control action. So we need to compute the plant input error for the learning of the RTNN-2 controller. An approximated way to obtain the input error from the output error is

<sup>1</sup> ( ) ( ) ( ),( ) [( ) ( )] ( ) *T T E k CB E k CB CB CB CB u c*

The block-diagram of the control system is given on Fig.5. It contained a recurrent neural identifier RTNN 1, and a Sliding Mode (SM) controller with entries – the reference signal R, the output error Ec, and the states X and parameters A, B, C, estimated by the neural identifier RTNN-1. The total control is a sum of the SM control and the I-term control,

**5. Description of the indirect (sliding mode) centralized recurrent neural** 

(50)

*W z I Q zP z Q zIz Q z Rz W zOf z*

1 2 1 1 2 13

*p i p*

1 2 10

{ ( )[ ( ) ( )] ( ) ( )} ( )

1

{( 1) ( )[ ( ) ( )] ( ) } ( )

 

*z I W z I Q zP z Q zT Y z*

*I W z I Q zP z Q zIz Y z*

*pi p*

 

2 10 3

pre-multiplying it by the (CB)+ using the estimated C,B-matrices as follows:

*p i p*

*pi p*

1

1

1

1

(44)

(45)

(46)

<sup>0</sup> *I z T zI I* () ( ) (47)

(48)

(49)

The matrix Ω() had a dimension (Nwx2), whereas the second row had only one unity element (the others were zero). The position of that element was computed by:

$$i = k \text{mod} \{ Nw \} + 1; \quad k > Nw \tag{40}$$

After this, the given up topology and learning are applied for an anaerobic wastewater distributed parameter centralized system identification and control.

#### **4. Description of the direct centralized recurrent neural control with I-term**

The block-diagram of the closed loop control system is given on Fig.4.

Fig. 4. Block diagram of the direct adaptive I-term control containing RTNN identifier and RTNN controller

It contained a recurrent neural identifier RTNN 1, and a RTNN-2 controller with entries – the reference signal R, the I-term signal V, and the state vector X estimated by the RTNN-1. The input of the plant is perturbed by a constant load perturbation Offset which took into account also the imperfect identification of the plant model. The RTNN-1, 2 topologies are given by (17)-(19), and the nonlinear plant model is given by equations (8)-(16). Let us to linearize the equations of the plant and the RTNN-2 controller and to introduce the equation of the I-term as:

$$V(k+1) = V(k) + T\_0 E\_c(k)\tag{41}$$

where the dimension of the I-term vector V(k) is equal of the dimension of the error vector, equal of the dimension L of the plant output Yp(k). Now we could write the following ztransfer functions with respect to V, X, R, corresponding to Fig.4:

$$\mathcal{W}\_p(z) = \mathbb{C}\_p \left( zI - A\_p \right)^{-1} B\_p \tag{42}$$

$$P\_i(z) = \left(zI - A\_i\right)^{-1} B\_i \tag{43}$$

The matrix Ω() had a dimension (Nwx2), whereas the second row had only one unity

After this, the given up topology and learning are applied for an anaerobic wastewater

**4. Description of the direct centralized recurrent neural control with I-term** 

Fig. 4. Block diagram of the direct adaptive I-term control containing RTNN identifier and

It contained a recurrent neural identifier RTNN 1, and a RTNN-2 controller with entries – the reference signal R, the I-term signal V, and the state vector X estimated by the RTNN-1. The input of the plant is perturbed by a constant load perturbation Offset which took into account also the imperfect identification of the plant model. The RTNN-1, 2 topologies are given by (17)-(19), and the nonlinear plant model is given by equations (8)-(16). Let us to linearize the equations of the plant and the RTNN-2 controller and to introduce the equation

where the dimension of the I-term vector V(k) is equal of the dimension of the error vector, equal of the dimension L of the plant output Yp(k). Now we could write the following z-

<sup>1</sup> () ( ) *W z C zI A B p p pp*

<sup>1</sup> () ( ) *P z zI A B i ii*

transfer functions with respect to V, X, R, corresponding to Fig.4:

*i k Nw k Nw* mod 1; (40)

<sup>0</sup> ( 1) ( ) ( ) *V k V k TE k <sup>c</sup>* (41)

(42)

(43)

element (the others were zero). The position of that element was computed by:

distributed parameter centralized system identification and control.

The block-diagram of the closed loop control system is given on Fig.4.

RTNN controller

of the I-term as:

$$Q\_1(\mathbf{z}) = \mathbf{C}\_c \left(\mathbf{z}I - A\_c\right)^{-1} B\_{cv} \tag{44}$$

$$Q\_2(\mathbf{z}) = \mathbb{C}\_c \left(\mathbf{z}I - A\_c\right)^{-1} B\_{c\mathbf{x}} \tag{45}$$

$$Q\_3(\mathbf{z}) = \mathbb{C}\_c \left(\mathbf{z}I - A\_c\right)^{-1} B\_{cr} \tag{46}$$

$$I(z) = T\_0 \left(zI - I\right)^{-1} \tag{47}$$

The RTNN topology is controllable and observable, and the BP/L-M algorithms of learning are convergent, (see Baruch & Mariaca-Gaspar, 2009; Baruch & Mariaca-Gaspar, 2010). Then the identification and control errors tend to zero (Ei(k) = Yp(k) – Y(k) → 0 and Ec(k) = R(k) - Yp(k) → 0; k → ∞). This means that each transfer function given by equations (42)-(46) is stable with minimum phase. The z-transfer functions (42)-(47) are connected by the next equation, derived following the block-diagram of the Fig. 4:

$$\begin{aligned} & \left[ I + \mathcal{W}\_p(z) \right] I - Q\_2(z) P\_i(z) \right]^{-1} Q\_1(z) I(z) |Y\_p(z) = \\ &= \mathcal{W}\_p(z) [I - Q\_2(z) P\_i(z)]^{-1} [Q\_1(z) I(z) + Q\_3(z)] R(z) + \mathcal{W}\_p(z) O f(z) \end{aligned} \tag{48}$$

Substituting (47) in (48), finally we obtained:

$$\begin{aligned} \left[ (z-1)I + \mathcal{W}\_p(z) [I - Q\_2(z)P\_i(z)]^{-1} Q\_1(z)T\_0 \right] Y\_p(z) &= \\ \left[ -\mathcal{W}\_p(z) [I - Q\_2(z)P\_i(z)]^{-1} [Q\_1(z)T\_0 + (z-1)Q\_3(z)] R(z) + \mathcal{W}\_p(z)(z-1) O f(z) \right] \end{aligned} \tag{49}$$

The equation (49) showed that the closed-loop system is stable (Yp(k) → R(k); k → ∞) and that the I-term eliminated the constant perturbation Of(z) because the last term tended to zero when z tended to 1.

The centralized DPS could be considered as a system with excessive measurements (L>M), where the Direct Adaptive Neural Control (DANC) performed a data fusion so to elaborate the control action. So we need to compute the plant input error for the learning of the RTNN-2 controller. An approximated way to obtain the input error from the output error is pre-multiplying it by the (CB)+ using the estimated C,B-matrices as follows:

$$E\_u(k) = \text{(CB)}^+ E\_c(k) / \text{(CB)}^+ = \text{[(CB)}^T \text{(CB)} \text{]}^{-1} \text{(CB)}^T \tag{50}$$
