1 Introduction

Quadratic program (QP) problems are widely applied in science and engineering fields, such as, \(k\)-winner-take-all problem [14], optimal controller design [5, 6], digital signal processing [7], robot-arm motion planning [812] and so on. In some cases of their application areas, it is needed to solve time-varying QP problems. There are many algorithms or methods to solve the time-varying QP problems. Numerical methods can be applied to linear-equality constraint, while sequential quadratic programming (SQP) is widely used to solve nonlinear programming (NLP) problems [1315]. In addition, neural networks also play an important role in solving the time-varying QP problems. They possess the characteristics of parallel-distributed nature and hardware-realization convenience and receive considerable studies in many scientific and engineering fields. For instance, Zhang neural network (ZNN) has been proposed to solve the time-varying QP problems [8, 1620]. It is shown that the exact solutions can be achieved when time goes to infinity. In [8], Zhang and Yang presented a special type of ZNN model with a power-sum activation function. It has better robustness against large implementation errors than the one with linear function. However, the proposed ZNN converges to the actual solution after infinitely long time. In order to accelerate ZNN to finite-time convergence, activation functions, \(\text{sign}{(x)|x|}^{r}\,\text{with}\,0<r<1\) and \(\text{sign}{(x)(|x|}^{r}+|x|^{1/r})\,\text{with}\,0<r<1\), are used to solve QP problem in [21] and to solve complex time-varying Sylvester equation in [22], respectively. More recently, ZNN with a tunable activation function is proposed to solve QP problems [23]. It is shown ZNN with the tunable activation function has a faster convergent speed and less sensitivity to additive noise [23].

Based on the ideas in [8, 2126], we design ZNNs with two tunable activation functions to solve the time-varying QP problems. The exact solutions of these problems can be derived in finite time. Moreover, ZNNs with these tunable activation functions have superior robustness performance against perturbation with large implementation errors than the one proposed in [8]. At the same time, we can estimate the upper bounds of the convergence time with less conservation.

Our paper is organized as follows. In Sect. 2, we give some preliminaries about finite-time stability and estimation of the upper bounds of the convergence time. In Sect. 3, time-varying QP problems are formulated and solved by ZNNs with two tunable activation functions. Sect. 4 gives robust analysis of the proposed neural networks and shows that the proposed neural networks have the superior robust performance against perturbation with large implementation errors than the model in [8]. In Sect. 5, feasibility and superiority of our method are validated by numerical simulations. In Sect. 6, our neural networks are applied to robot tracking. The superiority is also shown by computer simulation. At last, Sect. 7 concludes this paper.

2 Preliminaries

Consider the following system:

$$\begin{aligned} \dot{x}(t)=f(x(t)),f(0)=0,x\in {{\mathcal {R}}}^{n},x(0)=x_0, \end{aligned}$$
(1)

where \(f:{\mathcal {D}}\rightarrow {{\mathcal {R}}}^n\) is continuous on an open neighborhood \({\mathcal {D}}\) of the origin \(x=0\).

Definition 1

[27] The equilibrium \(x = 0 \) of (1) is finite-time convergent if there is an open neighborhood \({{{\mathcal {U}}}}\) of the origin and a function \(T_{x} : {{\mathcal {U}}}\setminus \{0\}\rightarrow (0,\infty )\), such that every solution trajectory \(x(t,x_{0})\) of (1) starting from the initial point \( x_{0}\in {\mathcal {U}}\setminus \{0\} \) is well defined and unique in forward time for \(t \in [0,T_{x}(x_{0}))\) and \(\lim\nolimits _{t\rightarrow T_{x}(x_{0})}x(t,x_{0}) = 0\). Then, \(T_{x} (x_{0})\) is called the convergence time (of the initial state \(x_{0})\). The equilibrium of (1) is finite-time stable if it is Lyapunov stable and finite-time convergent. If \(U=\mathcal {D} ={\mathcal {R}}^n\), the origin is a globally finite-time stable equilibrium.

We give the following sufficient conditions such that the system (1) is finite-time stable.

Lemma 1

[24, 25] If there is a \(C^{1}\) positive definite function \(V(x)\) defined on a neighborhood \({\mathcal {U}}\subset {\mathcal {R}}^n\) of the origin and real numbers \(k_{1},k_{2}>0 \) and \( 0<r<1\), such that

$$\begin{aligned} \dot{V}(x)|_{(1)}\le -k_{1}V(x)^{r}-k_{2}V(x),\forall x\in {\mathcal {U}}. \end{aligned}$$
(2)

Then, the origin of system (1) is finite-time stable. The convergence time \(T_1\) satisfies

$$\begin{aligned} T_1(x_{0})\le \frac{\ln \left[ 1+\frac{k_{2}}{k_{1}}V(x_{0})^{1-r}\right] }{k_{2}(1-r)}, \end{aligned}$$
(3)

for all \(x_{0}\in {\mathcal {U}}\). If \({\mathcal {U}}={\mathcal {R}}^n\) and \(V(x)\) is radially unbounded, the origin of system (1) is globally finite-time stable.

Lemma 2

Suppose there is a positive definite function \(V(x)\in C^{1}\) defined on a neighborhood \({\mathcal {U}}\subset {\mathcal {R}}^n\) of the origin, such that

$$\begin{aligned} \dot{V}(x)|_{(1)}\le -k_{1}V(x)^{r}-k_{2}V(x)-k_{3}V(x)^{\frac{1}{r}}, \forall x\in {\mathcal {U}}, \end{aligned}$$
(4)

where \(k_{1}\), \(k_{2}\), \(k_{3}>0 \) and \( 0<\,r\,<1\). Then, the origin of system (1) is locally finite-time stable. The convergence time \(T_{2}\) satisfies

$$\begin{aligned} T_{2}(x_{0})\le \left\{ \begin{array}{lll} \frac{r\ln \left[ \frac{k_{2}+k_{3}}{k_{2}V(x_{0})^{(r-1)/r}+k_{3}}\right] }{k_{2}(1-r)}+\frac{\ln \left( 1+\frac{k_{2}}{k_{1}}\right) }{k_{2}(1-r)}, V(x_{0})\ge 1,\\ \frac{\ln \left[ 1+\frac{k_{2}}{k_{1}}V(x_{0})^{1-r}\right] }{k_{2}(1-r)},V(x_{0})<1, \end{array} \right. \end{aligned}$$
(5)

for all \(x_{0}\in {\mathcal {U}}\). If \({\mathcal {U}}={\mathcal {R}}^n\) and \(V(x)\) is also radially unbounded, the origin of the system (1) is globally finite-time stable.

Proof

Since \(V(x)\ge 0\), it follows from (4) that

$$\begin{aligned} \dot{V}(x)|_{(1)}\le -k_{1}V(x)^{r}-k_{2}V(x). \end{aligned}$$

Then, Lemma 1 implies that the system (1) is finite-time stable.

Now, we prove that the inequality (5) holds.

If \(V(x_{0})\ge 1\), from (4), it follows that

$$\begin{aligned} \dot{V}(x)\le -k_{2}V(x)-k_{3}V(x)^{\frac{1}{r}}. \end{aligned}$$
(6)

Multiplying (6) by \(e^{k_2t}\), we have,

$$\begin{aligned} e^{k_2t}\dot{V}(x)+e^{k_2t}k_{2}V(x)\le -e^{k_2t}k_{3}V(x)^{\frac{1}{r}}. \end{aligned}$$

Then,

$$\begin{aligned} \frac{d(e^{k_2t}V(x))}{(e^{k_2t}V(x))^{1/r}}\le -k_3e^{(1-\frac{1}{r})k_2t}dt. \end{aligned}$$

Integrating the above differential inequality from \(0\) to \(t\), we have

$$\begin{aligned} V(x)\le e^{-k_{2}t}\left[ V(x_{0})^{1-\frac{1}{r}} +\frac{k_{3}}{k_{2}}-\frac{k_{3}}{k_{2}}e^{(1-\frac{1}{r})k_{2}t}\right] ^{\frac{r}{r-1}}. \end{aligned}$$
(7)

Let

$$\begin{aligned} t_{1}=\frac{r\ln \left[ \frac{k_{2}+k_{3}}{k_{2}V(x_{0})^{(r-1)/r} +k_{3}}\right] }{k_{2}(1-r)}. \end{aligned}$$
(8)

It is easy to check that

$$\begin{aligned} V(x)\le 1,\ t\ge t_{1}. \end{aligned}$$
(9)

When \(V(x)\le 1\), from (4), we have

$$\begin{aligned} \dot{V}(x)\le -k_{1}V(x)^{r}-k_{2}V(x). \end{aligned}$$
(10)

By Lemma 1, we obtain \(t_{2}\),

$$\begin{aligned} t_{2}=\frac{\ln \left( 1+\frac{k_{2}}{k_{1}}\right) }{k_{2}(1-r)}, \end{aligned}$$
(11)

such that \(x(t)=0\), \(t\ge t_2\). Therefore, if \(V(x_0)>1\), we have \(x(t)=0\), when, \(t>t_1+t_2\). Thus, the first inequality in (5) holds.

If \(V(x_{0})\le 1\). The inequality (10) also holds. By Lemma 1, we have \(x(t)=0\), \(t\ge T_1(x_0)\).

3 Problem formulation and neural network solvers with two tunable activation functions

A time-varying QP problem with time-varying linear-equality constraint is given as follows,

$$\begin{aligned}&\quad \hbox {minimze}: \quad \frac{1}{2}x^{\text {T}}(t)P(t)x(t)+q^{\text {T}}(t)x(t),\end{aligned}$$
(12a)
$$\begin{aligned}&\hbox {subject to}:\,\quad A(t)x(t)=b(t), \end{aligned}$$
(12b)

where \(P(t)\in R^{n\times n}\) is a smooth time-varying, positive-defined, symmetric Hessian matrix for any \(t\in [0,+\infty )\), \(q(t)\in R^n\) is defined as a smooth time-varying coefficient vector, \(A(t)\in R^{m\times n}\) is a full row rank, smooth time-varying coefficient matrix, and \(b(t)\in R^m\) is defined as smooth time-varying vector.

From [20], the problem (12) can be solved as follows:

$$\begin{aligned} W(t)Y(t)=u(t), \end{aligned}$$
(13)

where \(W(t)=\left[ \begin{array}{cc} P(t) &{} A^{\text {T}}(t) \\ A(t) &{} \mathbf{0} \\ \end{array} \right] \), \(Y(t)=\left[ \begin{array}{c} x(t) \\ \lambda (t) \\ \end{array} \right] \), \(u(t)=\left[ \begin{array}{c} -q(t) \\ \ \ \ b(t) \\ \end{array} \right] \), \(\lambda (t)\in R^m\) is assumed as the Lagrange multiplier vector.

As in [1620], let \(e(t)=W(t)Y(t)-u(t)\) denote the vector-valued error function. The time derivative \(\dot{e}(t)\) is formulated as

$$\begin{aligned} \dot{e}(t)=-\varepsilon {\mathcal {F}}(e(t)), \end{aligned}$$
(14)

where \({\mathcal {F}}(x)\) is defined as the following tunable activation functions:

$$\begin{aligned} {\mathcal {F}}(x)=\hbox {sign}(x)(k_1|x|^r+k_2|x|+k_3|x|^{\frac{1}{r}}), \end{aligned}$$
(15)

or

$$\begin{aligned} {\mathcal {F}}(x)=\sum ^N_{k=1}\hbox {sign}(x)(k_1|x| ^{\frac{1}{k}}+k_2|x|+k_3|x|^{k}), \end{aligned}$$
(16)

where \(N>1\) is an integer parameter, \(0<r<1\), \(k_1>0\), \(k_2>0\), and \(k_3>0\) are tunable parameters.

From (14), we have the following finite-time neural network model for solving the problem (12):

$$\begin{aligned} W(t)\dot{Y}(t)=-\varepsilon {\mathcal {F}}(W(t)Y(t)-u(t)) -\dot{W}(t)Y(t)+\dot{u}(t), \end{aligned}$$
(17)

where the parameter \(\varepsilon >0\). Then, we have

$$\begin{aligned} \dot{Y}_i=-\sum _{k=1}^{n+m}\dot{w}_{ik}Y_k +\sum _{k=1}^{n+m}(\sigma _{ik}-w_{ik})\dot{Y}_k\nonumber \\ -\varepsilon {\mathcal {F}}\left( \sum _{k=1}^{n+m}w_{ik}Y_k-u_i\right) +\dot{u}_i, \end{aligned}$$
(18)

where \(Y_i\), \(\dot{Y}_i\), \(u_i\), and \(\dot{u}_i\) are the \(i\)th elements of \(Y(t)\), \(\dot{Y}(t)\), \(u(t)\), and \(\dot{u}(t)\), respectively, \(i=1,2,\cdots , n+m\), and \(w_{ik}\), \(\dot{w}_{ik}\), and \(\sigma _{ik}\) are the \(i\)th line and \(k\)th column elements of \(W(t)\), \(\dot{W}(t)\), and identity matrix \(I\), respectively.

Now, we give our main results.

Theorem 1

If the time-varying matrices \(P(t)\), \(q(t)\), \(A(t)\) , and \(b(t)\) are given, starting from any initial value \(Y(0)\), the neural network (17) with (15) always converges to its equilibrium state \([x^*(t), \lambda ^*(t)]^{\text {T}}\) in finite time, where \(x^*(t)\) is the time-varying theoretical solution of (12).

Proof

Let \(e^{+}(0)=\max _{1\le i\le n+m}\{|e_{i}(0)|\}\). Note that every \(e_{i}(t)\) in \(e(t)\) has identical dynamic \(\dot{e}_{i}(t)={\mathcal {F}}(e_{i}(t))\). Then, we have \(-|e^+(t)|\le e_{i}(t)\le |e^+(t)|\), for \(t\ge 0\) and \(1\le i\le n+m\). That implies that \(e_{i}(t)\) (\(i=1,\cdots ,n+m\)) converge to zero when \(e^+(t)\) reaches zero. Note that

$$\begin{aligned} \dot{e}^{+}(t)=-\varepsilon {\mathcal {F}}(e^{+}(t)), e^+(0)=\max \{|e_{i}(0)|\}. \end{aligned}$$

Defining a Lyapunov function \(V=|e^+(t)|^2\), then we have the time derivative of \(V\):

$$\begin{aligned} \dot{V}&= 2|\dot{e}^+(t)|e^+(t) \\&= -2\varepsilon {\mathcal {F}}(|e^+(t)|)e^+(t)\\&= -2\varepsilon \left( k_1|e^+(t)|^{r+1}+k_2|e^+(t)|^2+k_3|e^+(t)|^{\frac{1}{r}+1}\right) \\&= -2\varepsilon \left( k_1V^{\frac{r+1}{2}}+k_2V+k_3V^{\frac{1+r}{2r}}\right) . \end{aligned}$$

From the proof of Lemma 2, we can obtain that neural network (17) with (15) converges to its equilibrium state \([x^*(t), \lambda ^*(t)]^{\text {T}}\) in finite-time interval. Then, the time-varying theoretical solution of (12) can be obtained in finite time, and the upper bound of convergence time \(T_{f1}\) satisfies

$$\begin{aligned} T_{f1}=\left\{ \begin{array}{llll} \frac{r\ln \left[ \frac{k_2+k_3}{k_2V_0^{(r-1)/2r}+k_3}\right] }{\varepsilon k_2(1-r)}+\frac{\ln \left( 1+\frac{k_2}{k_1}\right) }{\varepsilon k_2(1-r)},V_0\ge 1,\\ \frac{\ln \left[ 1+\frac{k_2}{k_1}V_0^{(1-r)/2}\right] }{\varepsilon k_2(1-r)},V_0< 1,\\ \end{array} \right. \end{aligned}$$
(19)

where \(V_0=\max \{|e_1(0)|^2,|e_2(0)|^2,\cdots ,|e_{n+m}(0)|^2\}\). \(\square \)

Theorem 2

When the time-varying matrices \(P(t)\), \(q(t)\), \(A(t)\) , and \(b(t)\) are given, the neural network (17) with (16) always converges to its equilibrium state \([x^*(t),\) \( \lambda ^*(t)]^{\text {T}}\) in finite time for any initial value \(Y(0)\), where \(x^*(t)\) is the time-varying theoretical solution of (12).

Proof

Choosing the Lyapunov function \(V=|e^+(t)|^2\), we have

$$\begin{aligned} \dot{V}&= 2|\dot{e}^+(t)|e^+(t) \nonumber \\&= -2\varepsilon {\mathcal {F}}(|e^+(t)|)e^+(t)\nonumber \\&= -2\varepsilon \sum ^N_{k=1}\left( k_1|e^+(t)|^{\frac{1}{k}+1}+k_2|e^+(t) |^2+k_3|e^+(t)|^{k+1}\right) \nonumber \\&= -2\varepsilon \sum ^N_{k=1}\left( k_1V^{\frac{k+1}{2k}}+k_2V+k_3V^{\frac{1+k}{2}}\right) . \end{aligned}$$
(20)

I. If \(V_0>1\) (\(V_0\) is given in the proof of Theorem 1), from (20), we have

$$\begin{aligned} \dot{V}&\le -2\varepsilon \sum ^N_{k=1}\left( k_3V^{\frac{k+1}{2}}+k_2V\right) \\&= -2\varepsilon \left( k_3\sum ^N_{k=1}V^{\frac{k+1}{2}}+ k_2NV\right) \\&\le -2\varepsilon (k_3NV^{2}+ k_2NV). \end{aligned}$$

As in the proof of Lemma 2, we can obtain \(V(t)\le 1\) when \(t\ge t_1=\frac{\ln \left[ \frac{k_{2}+k_{3}}{k_{2}/\sqrt{V_0}+k_{3}}\right] }{\varepsilon k_{2}N}\). When \(V(t)\le 1\), from (20), it follows that

$$\begin{aligned} \dot{V}&\le -2\varepsilon \sum ^N_{k=1}\left( k_1V^{\frac{k+1}{2k}}+k_2V\right) \\&= -2\varepsilon \left( k_1\sum ^N_{k=1}V^{\frac{k+1}{2k}}+ k_2NV\right) \\&\le -2\varepsilon (k_1NV^{\frac{1}{2}}+ k_2NV). \end{aligned}$$

Then, we have \(V(t)=0\), when \(t>t_2=2\ln (1+k_{2}/k_{1})/(\varepsilon k_2N)\).

Therefore, if \(V_0\ge 1\), we have \(V(t)=0\) when \(t\ge T_{f2}=t_1+t_2\).

II. If \(V_0<1\), by Lemma 1, we have \(V=0\) when \(t\ge T_{f2}=\ln (1+k_{2}V_0^{\frac{1}{2}}/k_{1})/(\varepsilon k_2N)\).

In conclusion, we can obtain that neural network (17) with (16) converges to its equilibrium state in finite time. Therefore, the time-varying theoretical solution of (12) can be obtained in finite-time interval and the upper bound of convergence time \(T_{f2}\) satisfies

$$\begin{aligned} T_{f2}=\left\{ \begin{array}{llll} \frac{\ln \left[ \frac{k_{2}+k_{3}}{k_{2}/\sqrt{V_0}+k_{3}}\right] }{\varepsilon k_{2}N}+\frac{2\ln \left( 1+\frac{k_{2}}{k_{1}}\right) }{\varepsilon k_2N},V_0\ge 1,\\ \frac{2\ln \left( 1+\frac{k_{2}}{k_{1}}V_0^{\frac{1}{4}}\right) }{\varepsilon k_2N},V_0< 1.\\ \end{array} \right. \end{aligned}$$
(21)

Remark 1

The neural networks proposed in [1620], especially in [8], converge to the exact solution of (12) asymptotically. In other word, it requires infinitely long time to achieve the exact solution. From Theorem 1 and 2, we know that the neural network (17) with the activation function (15) or (16) can converge to the desired solution of (12) in finite time. Moreover, the upper bounds of convergence time \(T_{f1}\) and \(T_{f2}\) can be determined by \(k_1\), \(k_2\), \(k_3\), \(r\), \(\varepsilon \), and \(N\).

Remark 2

If \(V_0<1\), we can obtain \( \frac{2\ln \left( 1+\frac{k_{2}}{k_{1}}V_0^{\frac{1}{4}}\right) }{\varepsilon k_2N}\) \(< \frac{\ln \left( 1+\frac{k_{2}}{k_{1}}V_0^{\frac{1}{4}}\right) }{\varepsilon k_2}= \frac{(1-r)\ln \left( 1+\frac{k_{2}}{k_{1}}V_0^{\frac{1}{4}}\right) }{\varepsilon k_2(1-r)}.\) Moreover, let \(F(r)=\ln \left[ 1+\frac{k_1}{k_2}V_0^{(1-r)/2}\right] -(1-r)\ln \left( 1+\frac{k_{2}}{k_{1}}V_0^{\frac{1}{4}}\right) \), we have

$$\begin{aligned} F^{'}(r)= \frac{1}{2}\frac{\ln \frac{1}{V_0}k_1/k_2V_0^\frac{1-r}{2}}{1+k_1/k_2V_0^\frac{1-r}{2}}+ \ln \left( 1+k_1/k_2V_0^{\frac{1}{4}}\right) >0. \end{aligned}$$

Note that \(F(0)>0\), then \(F(r)>0\). Therefore, \(T_{f2}<T_{f1}\). If \(V_0\ge 1\), using the same method, we also have \(T_{f2}<T_{f1}\).

4 Robustness analysis

We discuss the robustness of the neural network (17) by adding a large model-implementation error \(\Delta \omega \in \mathbf{R}^{n+m}\) to (14),

$$\begin{aligned}&\dot{e}(t)=-\varepsilon {\mathcal {F}}(e(t))+\Delta \omega ,\end{aligned}$$
(22a)
$$\begin{aligned}&\dot{e}_i(t)=-\varepsilon {\mathcal {F}}(e_i(t))+\Delta \omega _i, \end{aligned}$$
(22b)

where \(e_i(t)\) and \(\Delta \omega _i\) are the \(i\)th elements of \(e(t)\) and \(\Delta \omega \), respectively, \(i=1,2,\cdots ,n+m\).

In the following theorem, we will show the robustness of the proposed neural networks with a large implementation error.

Theorem 3

Consider the perturbed neural network (22) with the activation function (15), the steady-state error satisfies the following inequality:

$$\begin{aligned} \lim \limits _{t\rightarrow \infty }\Vert e(t)\Vert _2\le \sqrt{ \frac{n+m}{\left( 27k_1^2k_2^2k_3^2\right) ^{\frac{1}{r+1+\frac{1}{r}}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{6}{r+1+\frac{1}{r}}}}, \end{aligned}$$

where \(|\Delta \omega _i|\le \delta \le +\infty \) for any \(t\in [0,+\infty )\) with \(\delta \gg \varepsilon \) or at least \(\delta \ge \varepsilon \). For the perturbed neural network (22) with the activation function (16), the steady-state error satisfies the following inequality:

$$\begin{aligned} \lim\limits_{t\rightarrow \infty }\Vert e(t)\Vert_2\le \sqrt{\frac{n+m}{\left(432N^{3}k_{1}^\frac{3}{2}k_{2}^{3}k_{3}^\frac{3}{2}\right) ^{\frac{4}{9+3N}}} \left(\frac{\delta }{\varepsilon }\right)^{\frac{8}{3+N}}}, \end{aligned}$$

for error range \(\lim \limits _{t\rightarrow \infty }|e_i|\ge 1\) and \(N>1\).

Proof

Define a Lyapunov function \(v_i=|e_i(t)|^2/2\) for the perturbed neural network (22). Then, we have

$$\begin{aligned} \dot{v}_i(t)=|e_i(t)|\dot{e}_i(t)=-\varepsilon |e_i(t)|{\mathcal {F}}(e_i(t))+|e_i(t)|\Delta \omega _i. \end{aligned}$$

Note that \(|\Delta \omega _i|\le \delta \). We can obtain \(|e_i||\Delta \omega _i|\le \delta |e_i|\). Then, we have

$$\begin{aligned} \dot{v}_i(t)&\le -\varepsilon |e_i(t)|{\mathcal {F}}(e_i) +\delta |e_i|=-|e_i|(\varepsilon {\mathcal {F}}(e_i)-\delta ). \end{aligned}$$
(23)

The time evolution \(e_i(t)\) (\(1\le i\le n+m\)) has three cases: (i). \(\varepsilon {\mathcal {F}}(e_i)-\delta >0\), (ii). \(\varepsilon {\mathcal {F}}(e_i)-\delta =0\), (iii). \(\varepsilon {\mathcal {F}}(e_i)-\delta <0\). In the following part, we will give a detailed discussion.

(a):

When the perturbed neural network (22) with \(t\in [t_0,t_1]\) is in the case (i), then \(\dot{v}_i<0\) and (23) imply that \(e_i(t)\) converges to zero as \(t\) evolves.

(b):

If the perturbed neural network (22) with any time \(t\) is in the case (ii), then \(\dot{v}_i\le 0\) implies that \(e_i\) converges to zero or \({\mathcal {F}}(e_i)=\delta /\varepsilon \).

(c):

For the case (iii), the worst case, (23) implies that the situation \(\dot{v}_i>0\) will happen. So, \(|e_i|\) may not converge to zero. For the worst case, note that \(0<\dot{v}_i\le -|e_i|(\varepsilon {\mathcal {F}}(e_i)-\delta )\), as \(\varepsilon {\mathcal {F}}(e_i)-\delta \) range in value from a positive value to 0, \(v_i\) and \(|e_i|\) will increase. So, there exists \(t_2\) such that \(\varepsilon {\mathcal {F}}(e_i(t_2))-\delta =0\), which returns to the case (ii), \({\mathcal {F}}(e_i)=\delta /\varepsilon \).

By the above analysis, the steady-state error is \(\lim \limits _{ t\rightarrow \infty }{\mathcal {F}}(|e_i|)\approx \frac{\delta }{\varepsilon }\). For \(\delta \gg \varepsilon \) or at least \(\delta \ge \varepsilon \), we can obtain \(\lim \limits _{t\rightarrow \infty }{\mathcal {F}}(|e_i|) \approx \delta /\varepsilon \gg 1\) or at least \(\ge 1\).

For the perturbed neural network (22) with (15), we have

$$\begin{aligned} \frac{\delta ^2}{\varepsilon ^2}&\approx \lim \limits _{t\rightarrow \infty }{{\mathcal{F}}^2(|e_i(t)|)}\\&= \lim \limits _{t\rightarrow \infty }{\left( k_1|e_i(t)|^r+k_2|e_i(t)|+k_3|e_i(t)|^\frac{1}{r}\right) ^2}\\&\ge \lim \limits _{t\rightarrow \infty }\left( k^2_1|e_i(t)|^{2r}+k^2_2|e_i(t)|^2+k^2_3|e_i(t)|^\frac{2}{r}\right) \\&\ge \lim \limits _{t\rightarrow \infty }3\left[ k_1^2k_2^2k_3^2|e_i(t)|^{2r+2+\frac{2}{r}}\right] ^{\frac{1}{3}}.\\ \end{aligned}$$

Thus,

$$\begin{aligned} \lim \limits _{t\rightarrow \infty }|e_i(t)|^2\le \left( \frac{1}{27k_1^2k_2^2k_3^2}\right) ^{\frac{1}{r+1+\frac{1}{r}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{6}{r+1+\frac{1}{r}}}. \end{aligned}$$

Then,

$$\begin{aligned} \lim \limits _{t\rightarrow \infty }\Vert e(t)\Vert _2\le \sqrt{\frac{n+m}{\left( 27k_1^2k_2^2k_3^2\right) ^{\frac{1}{r+1+\frac{1}{r}}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{6}{r+1+\frac{1}{r}}}}. \end{aligned}$$
(24)

For the perturbed formula (22) with (16), we have

$$\begin{aligned}&\frac{\delta^{2}}{\varepsilon^{2}}\approx \lim\limits_{t\rightarrow \infty }{{\mathcal {F}}^2(|e_i(t)|)}\\ \end{aligned}$$
$$\begin{aligned}&=\lim \limits_{t\rightarrow \infty}\left( \sum^{N}_{k=1}(k_1|e_i(t)|^\frac{1}{k}+k_{2}|e_{i}(t)|+k_{3}|e_i(t)|^{k})\right)^{2}\\&=\lim \limits _{t\rightarrow \infty }\left( Nk_2|e_i(t)|+\sum ^{N}_{k=1}k_1|e_i(t)|^{\frac{1}{k}}+\sum ^{N}_{k=1}k_3|e_i(t)|^{k}\right) ^2\\&\ge \lim \limits _{t\rightarrow \infty }\left( Nk_2|e_i(t)|+2\sqrt{k_1k_3\sum \nolimits ^{N}_{k=1}|e_i(t)|^{\frac{1}{k}}\sum \nolimits ^{N}_{k=1}|e_i(t)|^{k}}\right) ^2\\&=\lim \limits _{t\rightarrow \infty }\Bigg (N^2k_2^2|e_i(t)|^2+4k_1k_3\sum ^{N}_{k=1}|e_i(t)|^{\frac{1}{k}}\sum ^{N}_{k=1}|e_i(t)|^{k}\\&\quad+4Nk_2|e_i(t)|\sqrt{k_1k_3\sum \nolimits ^{N}_{k=1}|e_i(t)|^{\frac{1}{k}}\sum \nolimits ^{N}_{k=1}|e_i(t)|^{k}}\Bigg )\\ \end{aligned}$$
$$\begin{aligned}&\ge \lim \limits _{t\rightarrow \infty }\left( N^2k_2^2|e_i(t)|^{2}+4k_1k_3|e_i(t)|\sum ^{N}_{k=1}|e_i(t)|^{k}\right. \\&\left. \ \ \ \ +4Nk_2|e_i(t)|\sqrt{k_1k_3|e_i(t)|\sum \nolimits ^{N}_{k=1}|e_i(t)|^{k}}\right) \\&\ge \lim \limits _{t\rightarrow \infty }\left( N^2k_2^2|e_i(t)|^{2}+4k_1k_3|e_i(t)|^{N+1}\right. \\&\left. \ \ \ \ +4Nk_2k_1^{\frac{1}{2}}k_1^{\frac{1}{3}}|e_i(t)|^{\frac{N+3}{2}}\right) \\&\ge \lim \limits _{t\rightarrow \infty }3\root 3 \of {16N^3k_1^{\frac{3}{2}}k_2^3k_3^ {\frac{3}{2}}|e_i(t)|^{3+N+\frac{N+3}{2}}}.\\ \end{aligned}$$

Thus,

$$\begin{aligned} \lim \limits _{t\rightarrow \infty }|e_i(t)|^2\le \left( \frac{1}{432N^3k_1^\frac{3}{2}k_2^3k_3^\frac{3}{2}}\right) ^{\frac{4}{9+3N}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{8}{3+N}}. \end{aligned}$$

Then,

$$\begin{aligned} \lim \limits _{t\rightarrow \infty }\Vert e(t)\Vert _2\le \sqrt{\frac{n+m}{\left( 432N^3k_1^\frac{3}{2}k_2^3k_3^\frac{3}{2}\right) ^{\frac{4}{9+3N}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{8}{3+N}}}. \end{aligned}$$
(25)

The proof is completed. \(\square \)

Remark 3

In [8], the steady-state errors are \(\sqrt{n+m}\delta /\varepsilon \) and \(\sqrt{n+m}\delta /(N\varepsilon )\) with the linear activation function and power-sum activation function, respectively. Note that \(6/(1+r+1/r)\) \(\le 2\) and \(8/(3+N)\le 2\), so the steady-state errors with (15) and (16) are smaller than the ones with the linear activation function and with the power-sum activation function by setting appropriate values of \(k_1\), \(k_2\), \(k_3\) and \(N\).

Remark 4

Note that \(6/(1+r+1/r)>8/(3+N)\) for any \(N>1\) and \(0.43\le r<1\), we know that the steady-state error with (16) is smaller than the one with (15) for the same parameters. For \(0<r<0.43\), we also obtain that the steady-state error with (16) is smaller the one with (15) by setting the values of the parameters \(k_1\), \(k_2\), \(k_3\), and \(N\).

5 Numerical simulations

In this part, we give numerical simulations for solving the time-varying QP by the neural network (17) with the activation function (15) and with the activation function (16), and with the power-sum activation function in [8], respectively. We will show superiority of our methods from two aspects: finite-time convergence and robustness.

Example 1

For (12), we set \(P(t)=\left[ \begin{array}{cc} 8+\sin t &{} 0.9\cos t \\ 0.9\cos t &{} 10-0.5\cos t \\ \end{array} \right] \), \(q(t)=\left[ \begin{array}{c} -2\cos 2t\\ -2\sin 2t \\ \end{array} \right] \), \(A(t)=[2\cos 3t,\sin 3t]\), \(b(t)=\sin t\).

From (13), we have \(u(t)=\left[ \begin{array}{c} 2\cos 2t\\ 2\sin 2t \\ \sin t \\ \end{array} \right] \), \(W(t)=\left[ \begin{array}{ccc} 8+\sin t &{} 0.9\cos t &{} 2\cos 3t \\ 0.9\cos t &{} 10-0.5\cos t &{} \sin 3t\\ 2\cos 3t &{} \sin 3t &{} 0\\ \end{array} \right] \).

Fig. 1
figure 1

Online solutions of Example 1 by the neural network (17) with (15) , (16), and the neural network (\(\gamma =1\), N = 3) in [8]

Letting \(Y_0=[2,1,1]^{\text {T}}\), \(\varepsilon =1\), \(r=0.5\), \(k_1=k_2=k_3=1\), \(N=3\), we have \(e(0)=W(0)Y(0)-u(0)=[17.8,10.4,4]^{\text {T}}\), \(V_0=17.8^2>1\). Then, we have \(T_{f1}=2.0248s\) and \(T_{f2}=0.6749s\) by calculating (19) and (21), respectively. The convergence time \(T_{f_c}\) is determined such that \(\Vert x(t)-x^*(t)\Vert \le 10^{-6}\), \(t>T_{f_c}\). It is observed form Fig. 1 and 2 that the neural networks can converge to the theoretical solution in finite time and the convergence time \(T_{f_{c1}}=0.82\) and \(T_{f_{c2}}=0.45\), respectively, while the neural network in [8] can not converge to the theoretical solution in finite time.

Fig. 2
figure 2

The convergence time of online solution of Example 1 by the neural network (17) with (15) and (16)

Let \(\Delta \omega =[10^2,10^2,10^2]^{\text {T}}\) in (22) and \(\varepsilon =1\), \(r=0.5\), \(k_1=k_2=k_3=5\), \(N=2\), \(\delta =100\sqrt{3}\). From (24) and (25), we obtain that the steady-state errors are given as

$$\begin{aligned} \sqrt{\frac{n+m}{(27k_1^2k_2^2k_3^2)^{\frac{1}{r+1+\frac{1}{r}}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{6}{r+1+\frac{1}{r}}}}\approx 22.58, \end{aligned}$$

and

$$\begin{aligned} \sqrt{\frac{n+m}{\left( 432N^3k_1^\frac{3}{2}k_2^3k_3^\frac{3}{2}\right) ^{\frac{4}{9+3N}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{8}{3+N}}}\approx 9.9638. \end{aligned}$$

However, the steady-state error \(\sqrt{n+m}\delta /(\varepsilon N)\approx 100\) [8]. The steady-state errors obtained by our methods are smaller than the one obtained by [8]. Moreover, the neural network with the activation function (16) has the most superior robustness performance. The simulation results are given in Fig. 3. It also shows that our method has a superior robustness performance.

Fig. 3
figure 3

The robustness performance of online solution of Example 1 by the neural network (17) with (15), (16), and the neural network (\(\gamma =1\), N = 3) in [8]

In conclusion, theoretical analysis and numerical simulations demonstrate the effectiveness of our methods.

Example 2

We select a time-varying Toeplitz matrix \(P(t)=\left[ \begin{array}{ccccc} p_1(t)&{}p_2(t)&{}p_3(t)&{}\cdots &{}p_n(t)\\ p_2(t)&{}p_1(t)&{}p_3(t)&{}\cdots &{}p_{n-1}(t)\\ p_3(t)&{}p_2(t)&{}p_1(t)&{}\ddots &{}\vdots \\ \vdots &{}\vdots &{}\ddots &{}\ddots &{}p_2(t)\\ p_n(t)&{}p_{n-1}(t)&{}\cdots &{}p_2(t)&{}p_1(t)\\ \end{array} \right] \in R^{n\times n}\), where \(p_1(t)=8+\cos t\), \(p_{i}(t)=\frac{\sin t}{i-1},i=2,3,\cdots ,n\). Let \(q(t)=\left[ -2\cos 2t, 2\cos \left( 2t+\frac{\pi }{2}\right) ,\cdots , 2\cos \left( 2t+\frac{(n-1)\pi }{2}\right) \right] ^{\text {T}}\in R^{n\times 1}\), \(A(t)=\left[ \sin t, \sin \left( t-\frac{\pi }{3}\right) , \sin \left( t-\frac{2\pi }{3}\right) ,\cdots ,\sin (t-\frac{(n-1)\pi }{3})\right] \in R^{1\times n}\), and \(b(t)=2\cos \left( 2t+\frac{n\pi }{2}\right) \in R\) for (12).

Fig. 4
figure 4

Online solution of Example 2 by the neural network (17) with (15), (16), and the neural network (\(\gamma =1\), N = 3) in [8]

In the simulation, let \(n=4\), \(\varepsilon =2\), \(r=0.5\), \(k_1=k_3=1\), \(k_2=2\), \(N=4\), \(Y_0=\left[ -\frac{1}{4},\frac{1}{16},-\frac{1}{4}, \frac{1}{16},\frac{1}{4}\right] ^{\text {T}}\). Then, \(e(0)=W(0)Y(0)-u(0)=\left[ 0,\frac{1}{2},0,\frac{1}{2},0\right] ^{\text {T}}\) and \(V_0=0.5^2<1\). Therefore, we can obtain \(T_{f1}=0.4407s\) and \(T_{f2}=0.1102s\) by computing (19) and (21), respectively. From Figs. 4 and 5, it is observed that the convergence time \(T_{f_{c1}}=0.38s\) and \(T_{f_{c2}}=0.095s\), respectively.

Fig. 5
figure 5

The convergence time of online solution of Example 2 by the neural network (17) with (15) and (16)

Next, we compare the robustness performance of the neural networks proposed in this paper with the one in [8]. Let \(\Delta \omega =[10^2,10^2,10^2]^{\text {T}}\) in (22), \(\varepsilon =2\), \(r=0.5\), \(k_1=k_3=1\), \(k_2=2\), \(N=4\), \(\delta =100\sqrt{3}\). From (24) and (25), we obtain that the steady-state errors are given as

$$\begin{aligned} \sqrt{\frac{n+m}{(27k_1^2k_2^2k_3^2)^{\frac{1}{r+1+\frac{1}{r}}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{6}{r+1+\frac{1}{r}}}}\approx 43.0257, \end{aligned}$$

and

$$\begin{aligned} \sqrt{\frac{n+m}{\left( 432N^3k_1^\frac{3}{2}k_2^3k_3^\frac{3}{2}\right) ^{\frac{4}{9+3N}}} \left( \frac{\delta }{\varepsilon }\right) ^{\frac{8}{3+N}}}\approx 8.8638. \end{aligned}$$

However, the steady-state errors \(\sqrt{n+m}\delta /(\varepsilon N)\approx 48.4123\) and \(\sqrt{n+m}\delta /\varepsilon \approx 193.6492\) [8]. Obviously, the steady-state errors obtained by our methods are smaller than the ones obtained by [8]. Moreover, the neural network with the activation function (16) has the most superior robustness performance. The simulation results are shown in Fig. 6.

Fig. 6
figure 6

The robustness performance of online solution of Example 2 by using the linear function (\(\gamma =2\)), the power-sum function (\(\gamma =2\), N = 4), and the functions (15) and (16)

6 Application to robot tracking

The neural network (17) can be applied to robot tracking by solving a time-varying QP problem. Compared with the neural networks proposed in [812, 2831], the theoretical solution can be achieved in finite time by our method. If there exists a large implementation error, our neural networks also have a superior robustness performance.

6.1 Model

Consider the following redundant robot manipulator [8],

$$\begin{aligned} r(t)=f(\theta (t)), \end{aligned}$$
(26)

where \(r(t)\in R^m\) denotes the end-effector position vector in Cartesian space, \(\theta (t)\in R^n\) denotes the joint-space vector, and \(f(\cdot )\) denotes a continuous nonlinear function with known structure and parameters. The inverse kinematic problem is to find the joint variable \(\theta (t)\) for any given \(r(t)\). By (26), the relation between \(\dot{r}(t)\) and \(\dot{\theta }(t)\) can be described as

$$\begin{aligned} J(\theta (t))\dot{\theta }(t)=\dot{r}(t), \end{aligned}$$
(27)

where \(J(\theta (t))=\partial f(\theta )/\partial \theta \) is the Jacobian matrix.

By the previous work [8, 10], we have the following time-varying QP problem:

$$\begin{aligned}&\hbox {minimze}:\quad \frac{1}{2}x^{\text {T}}(t)P(t)x(t)+q^{\text {T}}(t)x(t),\end{aligned}$$
(28a)
$$\begin{aligned} \hbox {subject to}:\,\quad A(t)x(t)=b(t), \end{aligned}$$
(28b)

where \(P=I\), \(q(t)=\mu (\theta (t)-\theta (0))\), \(A(t)=J(t)\), and \(b(t)=\dot{r}(t)\). \(\theta (t)\in R^n\) is the joint variable vector, \(\mu \) is a parameter used to scale the magnitude of the manipulator response to joint displacements, and \(x(t)=\dot{\theta }(t)\) will be solved online.

6.2 Simulation results

In this part, a five-link planar redundant robot manipulator is applied to simulation. The five-link robot has three redundant degrees (due to \(n=5\), \(m=2\)); the desired path of its end effector is an ellipse with the major radius being 0.6m and the minor radius being 0.3m. The initial conditions are \(\theta _0=[3\pi /4, -\pi /2, -\pi /4,\pi /6, \pi /3]^{\text {T}}\) rad and \(Y_0=[0,0,0,0,0,0,0]^{\text {T}}\). In addition, let \(N=3\), \(\mu =4\), and \(\varepsilon =10\). We select the activation function (16) with \(k_1=k_2=k_3=1\). Then, \(e(0)=W(0)Y(0)-u(0)=[0,0,0,0,0,0,0.3]^{\text {T}}\) and \(V_0=0.3^2<1\). Therefore, we have \(T_{f2}=0.0291s\) by calculating (21).

Figure 7 gives the motion trajectories of the five-link planar robot manipulator operating in two-dimensional space. Figure 8 shows that the actual trajectory of the robot’s end effector, and the desired elliptical path are sufficiently match. In addition, the trajectories of \(\dot{\theta }(t)\) and \(\theta (t)\) are shown in Figs. 9 and 10, respectively.

Fig. 7
figure 7

Motion trajectories of a five-link planar manipulator synthesized by the neural network (17) with (16) (\(k_1=k_2=k_3=1,N=3\))

Fig. 8
figure 8

The end-effector trajectory of a five-link planar manipulator and the desired end-effector velocity vector

Fig. 9
figure 9

Joint velocity profiles, \(\dot{\theta }(t)\), of a five-link planar robot manipulator synthesized when tracking an elliptical path

Fig. 10
figure 10

Joint variable, \(\theta (t)\), of a five-link planar robot manipulator synthesized when tracking an elliptical path

It is observed from Fig. 11 that our neural network can converge to the theoretical solution in finite time comparing to the one in [8], and the actual convergence time is \(T_{f_{c2}}=0.024s\).

Fig. 11
figure 11

Residual errors, \(\Vert e(t)\Vert _2\), of the neural network (17) with (16) (\(k_1=k_2=k_3=1,N=3,\varepsilon =10\)) and the one in [8] with power-sum function (\(N=3,\gamma =10\))

Let \(\Delta \omega =[30,30,30,30,30,30,30]^{\text {T}}\) in (22), \(\varepsilon =10\), \(k_1=k_2=k_3=1\). Figure 12 shows that our neural network has a superior robustness performance than the one in [8].

Fig. 12
figure 12

The robustness performances of the neural network (17) with (16) (\(k_1=k_2=k_3=1,N=3,\varepsilon =10\)) and the model in [8] with power-sum function (\(N=3,\gamma =10\))

7 Conclusions

In this paper, finite-time recurrent neural network has been designed to solve time-varying QP problems and applied to robot tracking. Firstly, finite-time criteria and upper bounds of the convergent time were reviewed. Then, finite-time neural network with tunable activation function was proposed and applied to solve the time-varying QP problems. Finite-time convergent theorems of the proposed neural network were presented and proved. The upper bounds of the convergent time were estimated less conservatively. The neural network also has a superior robustness performance against perturbation with large implementation errors. Thirdly, feasibility and superiority of our method were shown by numerical simulations. At last, the proposed neural network was applied to robot tracking. Simulation results also showed the effectiveness of the proposed methods.