1 Introduction

In order to avoid the complex calculations caused by the derivation of multilayer composite functions, neural network model has always been used to obtain numerical approximate solutions by gradient descent algorithm since its introduction. Therefore, it has not been paid attention to derive exact analytical solutions of nonlinear partial differential equations (PDEs). In recent years, with the development of various technologies and the improvement of computing power, researchers are increasingly interested in numerical and symbolic computation [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]. The study of nonlinear PDEs has begun since the end of the nineteenth century, and various methods have been proposed. Among them, based on bilinear transformation, the method of trying to construct a function to seeking an exact analytical solution through symbolic calculation is very hot in the nonlinear field: for example, the method to obtain the lump solution and the arbitrary function interaction solution proposed by Ma et al. [34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]; the method to obtain the breather-type kink soliton solutions used by Sun et al. [29]; the method to obtain the periodic lump-type solutions used by Dong et al. [30]; the method to obtain the rational solutions used by Jia et al. [32]; the method to obtain the exact solutions used by Lü et al. [51,52,53,54,55,56,57,58]; the method to obtain general lump-type solutions introduced by Yong et al. [31]; the method to obtain the periodic solitary wave solutions and the three-wave solutions introduced by Liu et al. [15,16,17]; and the method to obtain the interaction solution used by Zhang et al. [22] and so on. But due to the complexity of the nonlinear equations themselves, there is no universal method to obtain the exact analytical solution for nonlinear PDEs. Because the neural network model has very complex nonlinear properties, the bilinear neural network method introduced in this paper covers all the methods listed above and will most likely be a universal method for seeking the exact analytical solution of nonlinear PDEs that may be proved based on the universal approximation theorem [59].

In this paper, bilinear neural network method would be introduced with the example of the following dimensionally reduced p-gBKP equation [34]:

$$\begin{aligned} \begin{aligned} {\mathrm{B}}_{{\mathrm{p}}{\text {-}} {\mathrm{gBKP}}_{\mathrm{y}}} (u):=&-\frac{9}{8}u_{{x}}{u}^{2}v-\frac{3}{8}{u}^{3} u_{{y}}-\frac{3}{4}u_{{{ xx}}}uv \\&-\frac{3}{4}{u_{{x}}}^{2}v-\frac{9}{4}u_{{x}}uu_{{y}}\\&-\frac{3}{4}{u}^{2}u_{{{ yx} }}-\frac{3}{2}u_{{{ xx}}}u_{{y}}-\frac{3}{2}u_{{x}}u_{{{ yx}}} \\&+u_{{{ yt}} }+3\,u_{{{ yx}}} =0, \end{aligned} \end{aligned}$$
(1)

where \(u_{y} = v_{x}.\) The lump solutions of Eq. (1) are obtained by Ma et al. [34], and the interaction phenomenon is discussed by Zhang et al. [8].

The rest of this paper is as follows. In Sect. 2, bilinear neural network method is introduced and the corresponding tensor formula is proposed to obtain the exact analytical solutions of nonlinear PDEs. In Sect. 3, the exact analytic solutions of Eq. (1) is obtained by using this method with the “3-2-2-1” model. The fractal soliton waves are found, and the dynamical characteristics of these waves are exhibited via various three-dimensional and density plots. That will be widely used to describe many interesting nonlinear phenomena in the fields of gas, plasma, optics, acoustics, heat transfer, fluid dynamics, classical mechanics and so on. A few of conclusions and outlook will be given in Sect. 4.

2 Bilinear neural network method and its corresponding tensor formula

2.1 Bilinear form

Under the dependent variable transformation:

$$\begin{aligned} \begin{aligned}&u(x,y,t)=2[\ln f(x,y,t)]_{x}, \\&v(x,y,t)=2[\ln f(x,y,t)]_{y}, \end{aligned} \end{aligned}$$
(2)

Eq. (1) is transformed into the following generalized bilinear form with \(p=3\),

$$\begin{aligned} \begin{aligned}&{\mathrm{B}}_{{\mathrm{p}{\text {-}}\mathrm{gBKP}}_{\mathrm{y}}}(f) \\&\quad :=(D_{p,t} D_{p,y}-D^{3}_{p,t} D_{p,y}+3D_{p,x} D_{p,y})f\cdot f \\&\quad =2(f_{ty} f-f_{t} f_{y}-3f_{xx} f_{xy}-3f_{x} f_{y}+3f_{xy} f) \\&\quad =0, \end{aligned} \nonumber \\ \end{aligned}$$
(3)

where p is an arbitrarily given natural number, often a prime number, and the generalized bilinear operators are defined by [39]

$$\begin{aligned} \begin{aligned}&D^{n_1}_{p,x_1}\cdots D^{n_M}_{p,x_M}a\cdot b(x_1,\ldots ,x_M)\\&\quad =\prod _{i=1}^{M}\left( \frac{\partial }{\partial x_{i}}+\alpha \frac{\partial }{\partial x^{\prime }_{i}}\right) ^{n_i} \\&\qquad a(x_1,\ldots ,x_M)b(x^{\prime }_{1},\ldots ,x^{\prime }_{M}) \mid _{x^{\prime }=x_{1},\ldots ,x^{\prime }=x_{M}}, \end{aligned} \end{aligned}$$
(4)

where \( n_{1},\ldots ,n_{M}\) are arbitrary nonnegative integers, and for an integer m, the m th power of \(\alpha \) is computed as follows:

$$\begin{aligned} \begin{aligned}&(\alpha _{p})^{m}=(-1)^{r(m)}, \\&m\equiv r(m)mod\; p, 0\le r(m)<p, \end{aligned} \end{aligned}$$
(5)

taking \(p=3\), we have

$$\begin{aligned} \begin{aligned}&\alpha ^{1}_{3}=-1, \alpha ^{2}_{3}=1, \alpha ^{3}_{3}=1, \alpha ^{4}_{3}=-1, \alpha ^{5}_{3}=1, \\&\alpha ^{6}_{3}=1, \alpha ^{7}_{3}=-1, \alpha ^{8}_{3}=1, \alpha ^{9}_{3}=1, \end{aligned} \end{aligned}$$
(6)

which leads to

$$\begin{aligned} \begin{aligned} D_{3,x}D_{3,t}f\cdot f&=2f_{x,t}f-2f_{x}f_{t}, \\ D^{2}_{3,y}f\cdot f&=2f_{y,y}f-2f^{2}_{y}, \\ D^{4}_{3,x}f\cdot f&=6f^{2}_{x,x},\\ D^{3}_{p,x}D_{p,y}f\cdot f&=6f_{x,x}f_{x,y}, \end{aligned} \end{aligned}$$
(7)

but if \(p=2\), then we can get,

$$\begin{aligned} \begin{aligned} D_{2,t}D_{2,x}f\cdot f&=2f_{xt}f-2f_{x}f_{t},\\ D^{2}_{2,y}f\cdot f&=2f_{yy}f-2f^{2}_{y},\\ D^{4}_{2,x}f\cdot f&=2f_{xxxx}\cdot f-8f_{xxx}f_{x}+6f^{2}_{xx},\\ D^{3}_{p,x}D_{p,y}f\cdot f&=2f_{xxxy}f-6f_{xxy}f_{x}+6f_{xy}f_{xx} \\&\quad -2f_{y}f_{xxx}. \end{aligned} \nonumber \\ \end{aligned}$$
(8)

We have noticed that when \(p = 2\), it is the Hirota bilinear operator. Transform (2) is also a characteristic transformation for establishing Bell polynomial theory of soliton equation [41]. The relation between the generalized bilinear p-gBKP Eq. (3) and the reduced p-gBKP Eq. (1) is given as follows:

$$\begin{aligned} \mathrm{B}_{\mathrm{p}{\text {-}}\mathrm{gBKP_y}}(u)=\left[ \frac{{\mathrm{B}_{\mathrm{p}{\text {-}}\mathrm{gBKP}_\mathrm{y}}}(f)}{f^2}\right] _x. \end{aligned}$$
(9)

Hence, if f solves the generalized bilinear p-gBKP Eq. (3), the reduced p-gBKP Eq. (1) will be solved. Similar solution procedures have been used in generating lump solutions [60,61,62] and their interactions solutions [63, 64] and even for linear PDEs in (3+1)-dimensions [65, 66].

Fig. 1
figure 1

Nonlinear neural network of Eq. (10): \({\mathbf {l_0}} = \{x,y,\ldots ,t\}\), \({\mathbf {l_1} }=\{1,2,\ldots ,m_1\}\), \({\mathbf {l_i}} = \{m_{i-1}+1,m_{i-1}+2,\ldots ,m_i\}\), (\(i = 2,3,\ldots ,n-1\))

2.2 Neural network model and corresponding tensor formula

To search for the exact analytical solutions of the bilinear p-gBKP Eq. (3), the tensor formula of nonlinear neural network is constructed as follows:

$$\begin{aligned} \begin{aligned} f=W_{{\mathbf {l_n} },f}F_{{\mathbf {l_n} }}(\xi _{{\mathbf {l_n} }}), \end{aligned} \end{aligned}$$
(10)

where \(W_{a,b}\) is the weight coefficient of neuron a to b. F is a generalized activation function, which can be defined arbitrarily, but in the last layer, function F must be satisfied that \(F_{{\mathbf {l_n} }} (\xi ) \ge 0\). \({\mathbf {l_n}} = \{m_{n-1}+1,m_{n-1}+2,\ldots ,n\}\) represents the nth layer space of the neural network model. \(\xi _{{\mathbf {l_i} }}\) is given as follows:

$$\begin{aligned} \begin{aligned} \xi _{{\mathbf {l_i} }}=W_{{\mathbf {l_{i-1}} },{\mathbf {l_i} }}F_{{\mathbf {l_{i-1}} }}(\xi _{{\mathbf {l_{i-1}} }})+b_{{\mathbf {l_i} }}, \quad i=1,2,\ldots ,n, \end{aligned} \nonumber \\ \end{aligned}$$
(11)

where \({\mathbf {l_0} }=\{x,y,\ldots ,t\}\), \({\mathbf {l_1} }=\{1,2,\ldots ,m_1\}\), \({\mathbf {l_i} }=\{m_{i-1}+1,m_{i-1}+2,\ldots ,m_i\}\), (\(i=2,3,\ldots ,n-1\)), b means a threshold, which can be simply understood here as an constant. This neural network tensor model can be intuitively understood through Fig. 1.

Substituting Eq. (10) into the bilinear nonlinear PDEs, a complicated equation can be obtained. Then, making the coefficient of each term in this equation equal to zero, we can obtain the algebraic equations. Solving these sets of algebraic equations by symbolic computation with the help of Maple, the coefficient solutions can be obtained. Finally, substituting these solutions and nonlinear neural network tensor formula Eq. (10) into bilinear transformation Eq. (2), the exact analytical solutions of nonlinear PDEs can be derived.

3 Abundant exact analytical solutions and the fractal soliton waves of the p-gBKP equation

To search for the exact analytical solutions of the bilinear p-gBKP Equation (3), we can choose a “3-2-2-1” neural network model, which means that there are three neurons in the input layer \({\mathbf {l_0} }\), two neurons in hidden layer \({\mathbf {l_1} }\), two neurons in hidden layer \({\mathbf {l_2} }\) and one neuron in the print layer f. This “3-2-2-1” model can be intuitively understood through Fig. 4a. By considering \({\mathbf {l_0}} = \{x,y,t\}\), \({\mathbf {l_1}} = \{1,2\}\) and \({\mathbf {l_2}} = \{3,4\}\), we procure:

$$\begin{aligned} \begin{aligned}&f= W_{{3,f}}F_{{3}} \left( \xi _{{3}} \right) +W_{{4,f}}F_{{4}} \left( \xi _{{4}} \right) ,\\&\xi _3=W_{{1,3}}F_{{1}} \left( \xi _{{1}} \right) +W_{{2,3}}F_{{2}} \left( \xi _{{2}} \right) +b_{{3}},\\&\xi _4=W_{{1,4}}F_{{1}} \left( \xi _{{1}} \right) +W_{{2,4}}F_{{2}} \left( \xi _{{2}} \right) +b_{{4}},\\&\xi _1=tW_{{t,1}}+xW_{{x,1}}+yW_{{y,1}}+b_{{1}},\\&\xi _2=tW_{{t,2}}+xW_{{x,2}}+yW_{{y,2}}+b_{{2}},\\ \end{aligned} \end{aligned}$$
(12)

where \(W_{i,j}\) (\(i=x,y,t,1,2,3,4\), \(j=1,2,3,4,f\) and \(i\ne j\)) and \(b_{k}\) (\(k=1,2,3,4\)) are real parameters to be determined later.

Fig. 2
figure 2

Evolution plots (top) and contour plots (bottom) of Eq. (17)

Substituting (12) into Eq. (3), we obtained a complicated equation. Making the coefficient of each term in this equation equal to zero, we have obtained an overdetermined nonlinear algebraic equation system with a total of 77 equations. Solving these algebraic equations by the symbolic computation with the help of Maple, we get the following four classes of solutions:

$$\begin{aligned}&\begin{aligned} \mathbf{Case\;1:\;}\{&\!\!\! W_{{1,3}}=0,W_{{1,4}}=W_{{1,4}},W_{{2,3}}=W_{{2,3}}, W_{{2,4}}=0,\\&W_{{3,{ f}}}=W_{{3,{ f}}},W_{{4,{ f}}}=W _{{4,{ f}}},W_{{t,1}}=0,W_{{t,2}}=-3\,W_{{x,2}},\\&W_{{x,1}}=0,W_{{ x,2}}=W_{{x,2}},W_{{y,1}}=W_{{y,1}},W_{{y,2}}=0 \}. \end{aligned}\nonumber \\ \end{aligned}$$
(13)
$$\begin{aligned}&\begin{aligned} \mathbf{Case\;2:\;}\{&\!\!\!W_{ {1,3}}=0,W_{{1,4}}=W_{{1,4}},W_{{2,3}}=W_{{2,3}},W_{{2,4}}=0,\\&W_{{3,{ f}}}=W_{{3,{ f}}},W_{{4,{ f}}}=W_{{4,{ f}}},W _{{t,1}}=-3\,W_{{x,1}},W_{{t,2}}=0,\\&W_{{x,1}}=W_{{x,1}},W_{{x,2}}=0,W_{ {y,1}}=0,W_{{y,2}}=W_{{y,2}} \}. \end{aligned}\nonumber \\ \end{aligned}$$
(14)
$$\begin{aligned}&\begin{aligned} \mathbf{Case\;3:\;}\{&\!\!\! W_{{1,3}}=W_{{1,3}},W_ {{1,4}}=0,W_{{2,3}}=0,W_{{2,4}}=W_{{2,4}},\\&W_{{3,{ f}}}=W_{{3,{ f}}},W_{{4,{ f}}}=W_{{4,{ f}}},W_{{t,1}}=0,W_{{t,2} }=-3\,W_{{x,2}},\\&W_{{x,1}}=0,W_{{x,2}}=W_{{x,2}},W_{{y,1}}=W_{{y,1}},W_ {{y,2}}=0 \}. \end{aligned}\nonumber \\ \end{aligned}$$
(15)
$$\begin{aligned}&\begin{aligned} \mathbf{Case\;4:\;}\{&\!\!\!W_{{1,3}}=W_{{1,3}},W_{{1,4}}=0,W_{{2,3}} =0,W_{{2,4}}=W_{{2,4}},\\&W_{{3,{ f}}}=W_{{3,{ f}}},W_{{4,{ f}}}=W_{{4,{ f}}},W_{{t,1}}=-3\,W_{{x,1}},W_{{t,2}}=0,\\&W_{ {x,1}}=W_{{x,1}},W_{{x,2}}=0,W_{{y,1}}=0,W_{{y,2}}=W_{{y,2}} \}. \end{aligned}\nonumber \\ \end{aligned}$$
(16)
Fig. 3
figure 3

Three-dimensional plots, contour plots and density plot of Eq. (17)

Fig. 4
figure 4

“3-2-2-1” neural network model of Eq. (12) and the single hidden layer neural network model corresponding to many current methods

Substituting the solution of Case 1 into (12), we can get the exact analytical solution for p-gBKP equation through the bilinear transformation Eq. (2),

$$\begin{aligned} \begin{aligned} u=2\,{\frac{W_{{3,{ f}}}\text{ D } \left( F_{{3}} \right) \left( \xi _{{3}} \right) W_{{2,3}}\text{ D } \left( F_{{2}} \right) \left( \xi _{{2}} \right) W_{{x,2}}}{W_{{3,{ f}}}F_{{3}} \left( \xi _{{3}} \right) +W_{{4,{ f}}}F_{{4}} \left( \xi _{{4}} \right) }}, \end{aligned} \end{aligned}$$
(17)

where the functions \(\xi _2\), \(\xi _3\) and \(\xi _4\) are given as follows:

$$\begin{aligned} \begin{aligned}&\xi _{{2}}=-3\,tW_{{x,2}}+W_{{x,2}}x+b_{{2}},\\&\xi _{{3}}=W_{{2,3}}F_{{2}} \left( -3\,tW_{{x,2}}+W_{{x,2}}x+b_{{2}} \right) +b_{{3}},\\&\xi _{{4}}=W_{{1,4}}F_{{1}} \left( W_{{y,1}}y+b_{{1}} \right) +b_{{4}}. \end{aligned} \end{aligned}$$
(18)

In order to analyze the dynamics properties and discuss the evolution characteristic briefly, we could choose appropriate values and function of these parameters in Eq. (17) as

$$\begin{aligned} \begin{aligned}&W_{3, f}=-8, W_{2, 3}=2, W_{x, 2}=2, W_{2, 3}=2, W_{4,f}=2,\\&W_{1,4}=2, W_{y,1}=23, b_{1}=1, b_{2}=1, b_{3}=1, b_{4}=1,\\&F_{1}(\xi _1)=\xi _1, F_{2}(\xi _2)={\xi _2}^3, F_{3}(\xi _3)=\cosh (\xi _3), \\&F_{4}(\xi _4)=exp(\xi _4); \end{aligned} \nonumber \\ \end{aligned}$$
(19)

evolution characteristics of the solutions derived via the appropriate values and function list above are exhibited in Fig. 2.

Moreover, we can also choose appropriate values and function of these parameters in (17) as

$$\begin{aligned} \begin{aligned}&{ t= 2 \hbox {s}}, W_{3, f}=-5, W_{2, 3}= 2, W_{x, 2}= 2, W_{2, 3}= 2, \\&W_{4, f}= 2, W_{1, 4}= 2, W_{y, 1}=23, b_{1}= 1, b_{2}= 1, \\&b_{3}= 1, b_{4}= 1,\\&F_{1}(\xi _1)=\xi _1, F_{2}(\xi _2)=\sin (\xi _2), F_{3}(\xi _3)=\xi _3^2, \\&F_{4}(\xi _4)=\xi _4^2; \end{aligned} \end{aligned}$$
(20)

dynamical characteristics of the solutions derived via the appropriate values and function list above are exhibited in Fig. 3.

Via various three-dimensional and contour plots, we find the fractal soliton waves and the self-similar characteristics of these waves are observed by reducing the observation range and magnifying local image; dynamical characteristics of these waves are exhibited in Fig. 3. That will be widely used to describe many interesting nonlinear phenomena in the fields of gas, plasma, optics, acoustics, heat transfer, fluid dynamics, classical mechanics and so on.

4 Conclusion

In this paper, a new method named bilinear neural network is introduced and the corresponding tensor formula is proposed to obtain the exact analytical solutions of nonlinear PDEs. This is the first time, the neural network model is used to solve the exact analytical solution of nonlinear PDEs.

The evolution phenomenon of the waves for p-gBKP equation is observed in Fig. 2 by choosing the appropriate parameters and functions. The fractal soliton waves are found and the self-similar characteristics of these waves are observed by reducing the observation range and magnifying local images in Fig. 3. The dynamical characteristics of these waves are exhibited via various three-dimensional and contour plots. That will be widely used to describe many interesting nonlinear phenomena in the fields of gas, plasma, optics, acoustics, heat transfer, fluid dynamics, classical mechanics and so on.

In addition, this method covers almost all methods of constructing a function after bilinearization to solve nonlinear PDEs that can be seen as models with only one hidden layer (see Fig. 4b): for example, the lump solution (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=F_2(\xi )=\xi ^2, F_3(\xi )=C\)) and the arbitrary function interaction solution (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=F_2(\xi )=\xi ^2\), \(F_3(\xi )\) is the arbitrary function) proposed by Ma et al. [34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]; the breather-type kink soliton solutions method (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=e^{-p_1\xi }, F_2(\xi )=\cos (p\xi ), F_3(\xi )=e^{p_1\xi }\)) used by Sun et al. [29]; the periodic lump-type solutions method (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=\cosh (-p_1\xi ), F_2{\xi }=\cos (p\xi ), F_3(\xi )=\cosh (-p_1\xi )\)) used by Dong et al. [30]; the rational solutions method (which can be seen as a single hidden layer neural network model with \(F_3(\xi )=F_2(\xi )=\xi ^2, F_1(\xi )=1\)) used by Jia et al. [32]; the exact solutions method (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=e^{-\xi }, F_2(\xi )=\sin (\xi )\,\,\mathrm{or}\,\,\cos (\xi ), F_3(\xi )=\sinh (\xi )\,\,\mathrm{or}\,\,\cosh (\xi ), F_4(\xi )=e^\xi \)) used by Lü et al. [57]; general lump-type solutions method (which can be seen as a single hidden layer neural network model with \(F_1=C, F_i(\xi )=\xi ^2,(i=2,3,\ldots ,n)\)) introduced by Yong et al. [31]; the periodic solitary wave solutions method (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=e^{-\xi }, F_2(\xi )=\tan (\xi ), F_3(\xi )=\tanh (\xi ), F_4(\xi )=e^\xi \)) and the three-wave solutions method (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=e^{-\xi }, F_2(\xi )=\cos (\xi ), F_3(\xi )=\sin (\xi ), F_4(\xi )=e^\xi \)) introduced by Liu et al. [15,16,17]; and the interaction solution method (which can be seen as a single hidden layer neural network model with \(F_1(\xi )=F_2(\xi )=\xi ^2, F_3(\xi )=e^\xi \) or \( \cosh (\xi )\)) used by Zhang et al. [22] and so on. Furthermore, the bilinear neural network method will most likely be a universal method for seeking the exact analytical solution of nonlinear PDEs that may be proved based on the universal approximation theorem [59].