1 Introduction

The nonlinear Schrödinger (NLS) equation is one of the important mathematical models in many fields of physics, which has been widely applied in Bose-Einstein condensates [13], nonlinear optical fiber communication [4, 5], plasma physics [6, 7], hydrodynamics [8], and so on. Recently more and more people have been devoted to solving the exact solutions of the generalized NLS models [911]. Today, the temporal optical solitons of the NLS equation have been the objects of theoretical and experimental studies in optical fiber communication, and optical solitons are regarded as an important alternative to the next generation of ultrafast optical telecommunication systems. The study of optical solitons has reached the stage of a real-life application. The propagation of optical pulse in monomode optical fiber is governed by the NLS equation.

As is known to all, there are many kinds of powerful methods to obtain the exact solutions of various nonlinear wave equations such as the NLS-type equations. For example, inverse scattering method [12], Bäcklund transformation [13, 14], Darboux transformation [15], Hirota bilinear method [16, 17], Lie symmetry method [18, 19], Riemann-Hilbert formulation [20], generalized sine-cosine method [21], similarity transformation [2224], multiple exp-function method [25], and other efficient techniques [2630]. Among all these methods, the similarity transformation is a powerful approach to solve high-dimensional and variable-coefficient NLS-type equations. In the framework of similarity transformation, the high-dimensional and variable-coefficient NLS-type equations can be transformed into ordinary differential equations with constant coefficient, which are easy to be solved. Thus in this paper, with the aid of the symbolic computation, we use the similarity transformation and construct the analytical spatiotemporal soliton solutions to the generalized \((3+1)\)-dimensional nonlinear Schrödinger equation with varying coefficients in nonlinear optics

$$ i\frac{\partial u}{\partial z}+\beta(z)\nabla^{2}u +\alpha(z,\mathbf{r})u + \chi(z)|u|^{2}u =i\gamma(z) u, $$
(1)

where \(u\equiv u(z,\mathbf{r})\) with \(\mathbf{r}=(x,y,t)\in\mathbf {R}^{3}\), denotes the normalized slowly varying complex wave packet envelope in a diffractive nonlinear Kerr medium with anomalous dispersion, and \(|u|^{2}\) is the optical power. Notation \(\nabla\equiv (\partial_{x}, \partial_{y}, \partial_{t})\) is a gradient operator, and \(\nabla^{2}=\partial_{x}^{2}+\partial_{y}^{2}+\partial_{t}^{2}\) represents the 3D Laplacian. Here z is the normalized propagation distance, and t is the normalized retarded time, i.e., time in the frame of reference moving with the wave packet. All coordinates are made dimensionless by the choice of coefficients. The real function \(\alpha(z,\mathbf{r})=\mathbf{r}\mathbf {A}(z)\mathbf{r}\) stands for the linear potential, where \(\mathbf {A}(z)=\operatorname{diag}(a_{1}(z), a_{2}(z), a_{3}(z))\) is a diagonal z-dependent \(3\times3\) matrix. The real functions \(\beta(z)\), \(\chi(z)\) and \(\gamma (z)\) stand for the group velocity dispersion (GVD), self-phase modulation (SPM) and linear gain (\(\gamma>0\)) or loss (\(\gamma<0\)), respectively. Strong interference of the effects of nonlinearity and varying dispersion can lead to a rich variety of possible configurations for dispersion management.

The generalized \((3+1)\)-dimensional nonlinear Schrödinger equation Eq. (1) is of considerable importance in optical fiber communication as it describes the amplification or absorption of pulses propagating in a monomode optical fiber with distributed dispersion and nonlinearity. In practical applications, the model is of primary interest not only for the amplification and compression of optical solitons in inhomogeneous systems, but also for the stable transmission of soliton control.

The paper is organized as follows. In Section 2, the similarity transformation is described, which converts a partial differential equation with variable coefficients into a family of first-order ordinary differential equations. In Section 3, several periodic traveling wave solutions are derived and some examples, which demonstrate the propagation characteristics of the spatiotemporal solitons, are given. Finally, a short conclusion is presented.

2 Similarity transformation

Our goal is to search for a transformation connecting solutions of Eq. (1) with those of the stationary NLS equation with constant coefficients

$$ F_{\xi\xi}-q_{2}F-2q_{4}F^{3}=0. $$
(2)

Here, \(F\equiv F(\xi)\) is a function of the only variable \(\xi\equiv\xi (z,\mathbf{r})\) whose relation to the original variables \((z,\mathbf {r})\) is to be determined. Table 1 shows a part of the Jacobi elliptic functions (JEFs) solutions of Eq. (2). The constants \(q_{2}\) and \(q_{4}\) appearing in Eq. (2) are related to the square of the elliptic modulus M of JEFs (see Table 1) [27, 28]. The parameter M of JEFs varies between 0 and 1. When \(M\rightarrow0\), JEFs degenerate into trigonometric functions, i.e., \(\mathrm{sn}(x)\rightarrow\sin(x)\), \(\mathrm{cn}(x)\rightarrow\cos(x)\), \(\mathrm{dn}(x)\rightarrow1\), etc., and the periodic traveling wave solutions become the periodic trigonometric solutions. When \(M\rightarrow1\), JEFs degenerate into hyperbolic functions, i.e., \(\mathrm{sn}(x)\rightarrow \tanh(x), \mathrm{cn}(x)\rightarrow \operatorname{sech}(x)\), \(\mathrm{dn}(x)\rightarrow \operatorname{sech}(x)\), etc., and the periodic traveling wave solutions become the soliton solutions.

Table 1 Jacobi elliptic functions

We consider the general similarity transformation

$$ u(z,\mathbf{r})=f(z,\mathbf{r})F\bigl(\xi(z,\mathbf{r})\bigr)e^{iB(z,\mathbf {r})}, $$
(3)

where \(f(z,\mathbf{r})\), \(B(z,\mathbf{r})\) and \(\xi(z,\mathbf{r})\) are all real-valued functions to be determined.

Requiring \(F(\xi)\) to satisfy Eq. (2) and \(u(z,\mathbf{r})\) to be a solution of Eq. (1), we substitute the ansatz (3) into Eq. (1) and after simple algebra obtain the set of equations

$$\begin{aligned}& \chi f^{2}+2q_{4}\beta|\nabla\xi|^{2} =0, \end{aligned}$$
(4)
$$\begin{aligned}& f\alpha+f\beta\bigl(q_{2}|\nabla\xi|^{2}-|\nabla B|^{2}\bigr)+\beta\nabla^{2} f-fB_{z} =0, \end{aligned}$$
(5)
$$\begin{aligned}& \bigl(f^{2}\bigr)_{z}+2\beta\nabla\cdot\bigl(f^{2} \nabla B\bigr)-2f^{2}\gamma =0, \end{aligned}$$
(6)
$$\begin{aligned}& \nabla\cdot\bigl(f^{2}\nabla\xi\bigr) =0, \end{aligned}$$
(7)
$$\begin{aligned}& \xi_{z}+2\beta\nabla B\cdot\nabla\xi =0. \end{aligned}$$
(8)

To solve Eqs. (4)-(8) explicitly, we first consider the special case of \(f(z,\mathbf{r})\) depending only on the propagation coordinate z, i.e., \(f(z,\mathbf{r})\equiv f(z)\). Then Eqs. (4)-(8) are simplified

$$\begin{aligned}& \chi f^{2}+2q_{4}\beta|\nabla\xi|^{2} =0, \end{aligned}$$
(9)
$$\begin{aligned}& \alpha+\beta\bigl(q_{2}|\nabla\xi|^{2}-|\nabla B|^{2}\bigr)-B_{z} =0, \end{aligned}$$
(10)
$$\begin{aligned}& f_{z}+\bigl(\beta\nabla^{2}B-\gamma\bigr)f =0, \end{aligned}$$
(11)
$$\begin{aligned}& \nabla^{2}\xi =0, \end{aligned}$$
(12)
$$\begin{aligned}& \xi_{z}+2\beta\nabla B\cdot\nabla\xi =0. \end{aligned}$$
(13)

We consider ξ parameterizing moving plains

$$ \xi(z, \mathbf{r})=\mathbf{k}(z)\cdot\mathbf{r}+\omega(z), $$
(14)

where \(\mathbf{k}(z)=[k_{1}(z),k_{2}(z),k_{3}(z)]\). The nontrivial phase now reads

$$ B(z, \mathbf{r})=\mathbf{r}\mathbf{H}(z)\mathbf{r}+\mathbf{b}(z)\cdot \mathbf{r}+c(z), $$
(15)

where

$$\begin{aligned}& \mathbf{H}(z)=\operatorname{diag}\bigl(h_{1}(z), h_{2}(z), h_{3}(z)\bigr), \\& \mathbf{b}(z)=\bigl[b_{1}(z), b_{2}(z), b_{3}(z) \bigr]. \end{aligned}$$

Substituting Eq. (14), Eq. (15) into Eqs. (9)-(13) and requiring that \(x^{n}\), \(y^{n}\), \(t^{n}\) (\(n=0,1,2\)) of each term be separately equal to zero, we obtain a system of algebraic and first-order ordinary differential equations that the parameters must satisfy:

$$\begin{aligned}& h_{j;z}+4\beta h_{j}^{2}-a_{j}=0, \end{aligned}$$
(16)
$$\begin{aligned}& b_{j;z}+4\beta h_{j}b_{j}=0, \end{aligned}$$
(17)
$$\begin{aligned}& k_{j;z}+4\beta h_{j}k_{j}=0, \end{aligned}$$
(18)
$$\begin{aligned}& \omega_{z}+2\beta(k_{1}b_{1}+k_{2}b_{2}+k_{3}b_{3})=0, \end{aligned}$$
(19)
$$\begin{aligned}& c_{z}-\beta q_{2}\bigl(k_{1}^{2}+k_{2}^{2}+k_{3}^{2} \bigr)+\beta\bigl(b_{1}^{2}+b_{2}^{2}+b_{3}^{2} \bigr)=0, \end{aligned}$$
(20)
$$\begin{aligned}& f_{z}+\bigl[2\beta(h_{1}+h_{2}+h_{3})- \gamma\bigr]f=0, \end{aligned}$$
(21)
$$\begin{aligned}& \chi f^{2}+2q_{4}\beta\bigl(k_{1}^{2}+k_{2}^{2}+k_{3}^{2} \bigr)=0, \end{aligned}$$
(22)

where \(j=1,2,3\).

By solving Eqs. (16)-(22) self-consistently, one obtains a set of conditions on the coefficients and parameters, necessary for Eq. (1) to have exact periodic wave solutions.

3 Analytical solutions and the propagation characteristics of the spatiotemporal solitons

As it is clear, Eq. (16) which is critical of Eqs. (16)-(22) is a standard Riccati equation with varying coefficients. The case of \(\beta \equiv \mathrm{const}\) has been studied in many papers (see, for example, [28, 29] and the references therein). In this paper, we concentrate on the case of \(\beta=e^{mz}\), \(a_{j}=s_{j}e^{-mz}\), \(j=1,2,3\), where m, \(s_{j}\) (\(j=1,2,3\)) are arbitrary nonzero constants, and the following set of exact solutions is found:

$$\begin{aligned}& b_{j}=b_{j}^{0}\theta_{j}, \qquad k_{j}=k_{j}^{0}\theta_{j}, \end{aligned}$$
(23)
$$\begin{aligned}& \omega=\omega_{0}-2\sum_{i=1}^{3}k_{i}^{0}b_{i}^{0} \rho_{i}, \end{aligned}$$
(24)
$$\begin{aligned}& c=c_{0}+\sum_{i=1}^{3} \bigl(q_{2}{k_{i}^{0}}^{2}-{b_{i}^{0}}^{2} \bigr)\rho_{i}, \end{aligned}$$
(25)
$$\begin{aligned}& f=f_{0}\sqrt{\theta_{1}\theta_{2} \theta_{3}}e^{\int_{0}^{z}\gamma \,dz}, \end{aligned}$$
(26)
$$\begin{aligned}& \chi=-\frac{2q_{4}e^{mz}({k_{1}^{0}}^{2}\theta_{1}^{2}+{k_{2}^{0}}^{2}\theta _{2}^{2}+{k_{3}^{0}}^{2}\theta_{3}^{2})}{f_{0}^{2}\theta_{1}\theta_{2}\theta_{3}e^{2\int _{0}^{z}\gamma \,dz}}. \end{aligned}$$
(27)

Here, \(b_{j}^{0}\), \(k_{j}^{0}\) (\(j=1,2,3\)), \(\omega_{0}\), \(c_{0}\), \(f_{0}\) are all arbitrary constants, and \(h_{j}\), \(\theta_{j}\), \(\rho_{j}\) are as follows.

I. When \(16s_{j}+m^{2}>0\), we have

$$\begin{aligned}& h_{j}=\frac{m+\sqrt{16s_{j}+m^{2}}\tanh(\frac{\sqrt {16s_{j}+m^{2}}(h_{j}^{0}mz+1)}{2h_{j}^{0}m})}{8 e^{mz}}, \end{aligned}$$
(28)
$$\begin{aligned}& \theta_{j}=e^{-\frac{m}{2}z}\operatorname{sech}\biggl(\frac{\sqrt {16s_{j}+m^{2}}(h_{j}^{0}mz+1)}{2h_{j}^{0}m}\biggr), \end{aligned}$$
(29)
$$\begin{aligned}& \rho_{j}=\int_{0}^{z} \operatorname{sech}^{2}\biggl(\frac{\sqrt{16s_{j}+m^{2}}(h_{j}^{0}mz+1)}{2h_{j}^{0}m}\biggr)\, dz. \end{aligned}$$
(30)

II. When \(16s_{j}+m^{2}=0\), we have

$$\begin{aligned}& h_{j}=\frac{m}{8e^{mz}}\frac{(2+mz)h_{j}^{0}+1}{h_{j}^{0}mz+1}, \end{aligned}$$
(31)
$$\begin{aligned}& \theta_{j}=\frac{e^{-\frac{m}{2}z}}{h_{j}^{0}mz+1}, \end{aligned}$$
(32)
$$\begin{aligned}& \rho_{j}=\int_{0}^{z}\frac{1}{(h_{j}^{0}mz+1)^{2}} \, dz, \end{aligned}$$
(33)

where \(h_{j}^{0}\) is an arbitrary nonzero constant. However, if we take \(h_{j}^{0}\rightarrow0\), then \(h_{j}\), \(\theta_{j}\), \(\rho_{j}\) are as follows:

$$\begin{aligned}& h_{j}=\frac{m\pm\sqrt{16s_{j}+m^{2}}}{8e^{mz}}, \end{aligned}$$
(34)
$$\begin{aligned}& \theta_{j}=e^{-\frac{m\pm\sqrt{16s_{j}+m^{2}}}{2}z}, \end{aligned}$$
(35)
$$\begin{aligned}& \rho_{j}=\int_{0}^{z}e^{\mp\sqrt{16s_{j}+m^{2}}z} \,dz. \end{aligned}$$
(36)

Incorporating these solutions back into Eq. (3), we can obtain the general periodic traveling wave solutions to the generalized NLSE

$$ u=f\cdot F\bigl(\mathbf{k}(z)\cdot\mathbf{r}+\omega(z)\bigr)\cdot e^{i(\mathbf {r}\mathbf{H}(z)\mathbf{r}+\mathbf{b}(z)\cdot \mathbf{r}+c(z))}. $$
(37)

As long as one chooses the constants according to the relations listed in Table 1 and substitutes the appropriate \(F(\xi)\) into Eq. (37), one obtains the exact periodic traveling wave solutions to the generalized \((3+1)\)-dimensional NLSE.

As an example, we select the solutions 1, 2, 13, 14 in Table 1 and the parameters \(b_{j}^{0}=k_{j}^{0}=f_{0}=1\) (\(j=1,2,3\)), \(\omega_{0}=c_{0}=0\), \(\gamma=\cos (z)\). According to the value of parameter \(h_{j}^{0}\), we list two classes.

3.1 The parameter \(h_{j}^{0}=1\) (\(j=1,2,3\))

Family 1

Taking parameters \(m=0.03\), \(s_{j}=0.0001\), we can obtain the periodic wave solution

$$ u_{1}=f(z)F\bigl(\xi(z,x,y,t)\bigr)e^{iB(z,x,y,t)}, $$
(38)

and the nonlinearity coefficient

$$ \chi=-6q_{4}e^{0.045z-2\sin(z)}\cosh(\tau_{1}), $$
(39)

where

$$\begin{aligned}& f=e^{-0.0225z+\sin(z)}\operatorname{sech}^{\frac{3}{2}}(\tau_{1}), \\& \xi=e^{-0.015z}\operatorname{sech}(\tau_{1})L-240\biggl(\tanh( \tau_{1})-\tanh\biggl(\frac{5}{6}\biggr)\biggr), \\& B = \frac{0.03+0.05\tanh(\tau_{1})}{8e^{0.03z}}r^{2}+e^{-0.015z}\operatorname{sech}(\tau _{1})L \\& \hphantom{ B ={}}{}+120(q_{2}-1) \biggl(\tanh(\tau_{1})-\tanh \biggl(\frac{5}{6}\biggr)\biggr), \\& L=x+y+t, \qquad r^{2}=x^{2}+y^{2}+z^{2}, \qquad \tau_{1}=0.025z+\frac{5}{6}. \end{aligned}$$
(40)

Family 2

Taking parameters \(m=-0.03\), \(s_{j}=0.0001\), we can obtain the periodic wave solution

$$ u_{2}=f(z)F\bigl(\xi(z,x,y,t)\bigr)e^{iB(z,x,y,t)}, $$
(41)

and the nonlinearity coefficient

$$ \chi=-6q_{4}e^{-0.045z-2\sin(z)}\cosh(\tau_{2}), $$
(42)

where

$$\begin{aligned}& f=e^{0.0225z+\sin(z)}\operatorname{sech}^{\frac{3}{2}}(\tau_{2}), \\& \xi=e^{0.015z}\operatorname{sech}(\tau_{2})L-240\biggl(\tanh( \tau_{2})+\tanh\biggl(\frac{5}{6}\biggr)\biggr), \\& B = \frac{-0.03+0.05\tanh(\tau_{2})}{8e^{-0.03z}}r^{2}+e^{0.015z}\operatorname{sech}(\tau _{2})L \\& \hphantom{ B ={}}{}+120(q_{2}-1) \biggl(\tanh(\tau_{2})+\tanh \biggl(\frac{5}{6}\biggr)\biggr), \\& L=x+y+t, \qquad r^{2}=x^{2}+y^{2}+z^{2}, \qquad \tau_{2}=0.025z-\frac{5}{6}. \end{aligned}$$
(43)

Family 3

Taking parameters \(m=0.04\), \(s_{j}=-0.0001\), we can obtain the periodic wave solution

$$ u_{3}=\frac{e^{-0.03z+\sin(z)}}{(0.04z+1)^{\frac{3}{2}}}F\biggl(\frac {e^{-0.02z}L}{0.04z+1}-\frac{6z}{0.04z+1} \biggr)e^{iB}, $$
(44)

where

$$\begin{aligned} \begin{aligned} &B=\frac{0.04(0.04z+3)r^{2}}{8e^{0.04z}(0.04z+1)}+\frac {e^{-0.02z}L}{0.04z+1}+\frac{3(q_{2}-1)z}{0.04z+1}, \\ &L=x+y+t, \qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned} \end{aligned}$$

The nonlinearity coefficient is of the form

$$ \chi=-6q_{4}e^{0.06z-2\sin(z)}(0.04z+1). $$
(45)

The function f is of the form

$$ f=\frac{e^{-0.03z+\sin(z)}}{(0.04z+1)^{\frac{3}{2}}}. $$
(46)

Family 4

Taking parameters \(m=-0.04\), \(s_{j}=-0.0001\), we can obtain the periodic wave solution

$$ u_{4}=\frac{e^{0.03z+\sin(z)}}{(-0.04z+1)^{\frac{3}{2}}}F\biggl(\frac {e^{0.02z}L}{-0.04z+1}-\frac{6z}{-0.04z+1} \biggr)e^{iB}, $$
(47)

where

$$\begin{aligned}& B=\frac{-0.04(-0.04z+3)r^{2}}{8e^{-0.04z}(-0.04z+1)}+\frac {e^{0.02z}L}{-0.04z+1}+\frac{3(q_{2}-1)z}{-0.04z+1}, \\ & L=x+y+t, \qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned}$$

The nonlinearity coefficient is of the form

$$ \chi=-6q_{4}e^{-0.06z-2\sin(z)}(-0.04z+1). $$
(48)

The function f is of the form

$$ f=\frac{e^{0.03z+\sin(z)}}{(-0.04z+1)^{\frac{3}{2}}}. $$
(49)

Figures 1 and 2 show the profiles of the nonlinear parameter χ and the function f as a function of z given by Eqs. (39)-(40), (42)-(43), (45)-(46), (48)-(49). The function f has an important effect on modulating the amplitude of the solution u. It is seen in this situation that χ and f are periodically oscillating along the z-axis. It can also be seen that the amplitude of χ increases along the z-axis in Figure 1(a) and Figure 2(a), and the amplitude of f decreases along the z-axis in Figure 1(b) and Figure 2(b). However, the amplitude of χ decreases along the z-axis in Figure 1(c) and Figure 2(c), and the amplitude of f increases along the z-axis in Figure 1(d) and Figure 2(d). Figure 3(a) and (b) presents the evolution plots of the dark and bright exact one-soliton solutions \(u_{1}\) given by Eq. (38) respectively under the strict integrable condition Eq. (39). Figure 3(c) and (d) presents the periodic evolution plot described by the Jacobian elliptic sine and cosine functions, respectively. It can also be seen from Figure 3 that the soliton maintains its shape when traveling down the fiber, in spite of the velocity and the background being fluctuant due to the fluctuation of the fiber parameters. Figure 4 shows the evolution plots of optical power \(|u_{2}|^{2}\) given by Eq. (41) under the strict integrable condition Eq. (42). Figure 5 shows the evolution plots of optical power \(|u_{3}|^{2}\) given by Eq. (44) under the strict integrable condition Eq. (45). Figures 6 and 7 show the evolution plots of optical power \(|u_{4}|^{2}\) given by Eq. (47) under the strict integrable condition Eq. (48). Note that \(F(\xi )\) in Figure 7 is the solutions 13, 14 in Table 1.

Figure 1
figure 1

The functions χ and f of (a) and (b) given by Eqs. ( 39 ) and ( 40 ), and (c) and (d) given by Eqs. ( 42 ) and ( 43 ).

Figure 2
figure 2

The functions χ and f of (a) and (b) given by Eqs. ( 45 ) and ( 46 ), and (c) and (d) given by Eqs. ( 48 ) and ( 49 ).

Figure 3
figure 3

Density \(\pmb{|u_{1}|^{2}}\) as a function of propagation distance \(\pmb{L\equiv x+y+t}\) and z given by Eq. ( 38 ), with (a)  \(\pmb{F(\xi)=\tanh(\xi)}\) , (b)  \(\pmb{F(\xi)=\operatorname{sech}(\xi)}\) , (c)  \(\pmb{F(\xi)=\mathrm{sn}(\xi)}\) , \(\pmb{M=0.5}\) and (d)  \(\pmb{F(\xi )=\mathrm{cn}(\xi)}\) , \(\pmb{M=0.5}\) .

Figure 4
figure 4

Density \(\pmb{|u_{2}|^{2}}\) as a function of propagation distance \(\pmb{L\equiv x+y+t}\) and z given by Eq. ( 41 ), with (a)  \(\pmb{F(\xi)=\tanh(\xi)}\) , (b)  \(\pmb{F(\xi)=\operatorname{sech}(\xi)}\) , (c)  \(\pmb{F(\xi)=\mathrm{sn}(\xi)}\) , \(\pmb{M=0.5}\) and (d)  \(\pmb{F(\xi )=\mathrm{cn}(\xi)}\) , \(\pmb{M=0.5}\) .

Figure 5
figure 5

Density \(\pmb{|u_{3}|^{2}}\) as a function of propagation distance \(\pmb{L\equiv x+y+t}\) and z given by Eq. ( 44 ), with (a)  \(\pmb{F(\xi)=\tanh(\xi)}\) , (b)  \(\pmb{F(\xi)=\operatorname{sech}(\xi)}\) , (c)  \(\pmb{F(\xi)=\mathrm{sn}(\xi)}\) , \(\pmb{M=0.5}\) and (d)  \(\pmb{F(\xi )=\mathrm{cn}(\xi)}\) , \(\pmb{M=0.5}\) .

Figure 6
figure 6

Density \(\pmb{|u_{4}|^{2}}\) as a function of propagation distance \(\pmb{L\equiv x+y+t}\) and z given by Eq. ( 47 ), with (a)  \(\pmb{F(\xi)=\tanh(\xi)}\) , (b)  \(\pmb{F(\xi)=\operatorname{sech}(\xi)}\) , (c)  \(\pmb{F(\xi)=\mathrm{sn}(\xi)}\) , \(\pmb{M=0.5}\) and (d)  \(\pmb{F(\xi )=\mathrm{cn}(\xi)}\) , \(\pmb{M=0.5}\) .

Figure 7
figure 7

Density \(\pmb{|u_{4}|^{2}}\) as a function of propagation distance \(\pmb{L\equiv x+y+t}\) and z given by Eq. ( 47 ), with (a)  \(\pmb{F(\xi)=\mathrm{sn}/(1+\mathrm{dn})}\) , \(\pmb{M=0.9999}\) , (b)  \(\pmb{F(\xi)=\mathrm{cn}/(\sqrt{1-M^{2}}+\mathrm{dn})}\) , \(\pmb{M=0.9999}\) , (c)  \(\pmb{F(\xi )=\mathrm{sn}/(1+\mathrm{dn})}\) , \(\pmb{M=0.5}\) and (d)  \(\pmb{F(\xi)=\mathrm{cn}/(\sqrt{1-M^{2}}+\mathrm{dn})}\) , \(\pmb{M=0.5}\) .

3.2 The parameter \(h_{j}^{0}=0\) (\(j=1,2,3\))

Family 5

Taking parameters \(m=0.03\), \(s_{j}=0.0001\), we can obtain the periodic wave solution as follows.

Case 1.

$$u_{51}=e^{-0.06z+\sin(z)}F\bigl(e^{-0.04z}L+120 \bigl(e^{-0.05z}-1\bigr)\bigr)e^{iB}, $$

where

$$\begin{aligned}& B=0.01e^{-0.03z}r^{2}+e^{-0.04z}L-60(q_{2}-1) \bigl(e^{-0.05z}-1\bigr), \\& L=x+y+t, \qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned}$$

The nonlinearity coefficient is of the form

$$\chi=-6q_{4}e^{0.07z-2\sin(z)}. $$

Case 2.

$$u_{52}=e^{0.015z+\sin(z)}F\bigl(e^{0.01z}L-120 \bigl(e^{0.05z}-1\bigr)\bigr)e^{iB}, $$

where

$$\begin{aligned}& B=-0.0025e^{-0.03z}r^{2}+e^{0.01z}L+60(q_{2}-1) \bigl(e^{0.05z}-1\bigr), \\& L=x+y+t, \qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned}$$

The nonlinearity coefficient is of the form

$$\chi=-6q_{4}e^{0.02z-2\sin(z)}. $$

Family 6

Taking parameters \(m=-0.03\), \(s_{j}=0.0001\), we can obtain the periodic wave solution as follows.

Case 1.

$$u_{61}=e^{-0.015z+\sin(z)}F\bigl(e^{-0.01z}L+120 \bigl(e^{-0.05z}-1\bigr)\bigr)e^{iB}, $$

where

$$\begin{aligned}& B=0.0025e^{0.03z}r^{2}+e^{-0.01z}L-60(q_{2}-1) \bigl(e^{-0.05z}-1\bigr), \\& L=x+y+t,\qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned}$$

The nonlinearity coefficient is of the form

$$\chi=-6q_{4}e^{-0.02z-2\sin(z)}. $$

Case 2.

$$u_{62}=e^{0.06z+\sin(z)}F\bigl(e^{0.04z}L-120 \bigl(e^{0.05z}-1\bigr)\bigr)e^{iB}, $$

where

$$\begin{aligned}& B=-0.01e^{0.03z}r^{2}+e^{0.04z}L+60(q_{2}-1) \bigl(e^{0.05z}-1\bigr), \\& L=x+y+t,\qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned}$$

The nonlinearity coefficient is of the form

$$\chi=-6q_{4}e^{-0.07z-2\sin(z)}. $$

Family 7

Taking parameters \(m=0.04\), \(s_{j}=-0.0001\), we can obtain the periodic wave solution

$$u_{7}=e^{-0.03z+\sin(z)}F\bigl(e^{-0.02z}L-6z \bigr)e^{iB}, $$

where

$$\begin{aligned} \begin{aligned} &B=0.005e^{-0.04z}r^{2}+e^{-0.02z}L+3(q_{2}-1)z, \\ &L=x+y+t,\qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned} \end{aligned}$$

The nonlinearity coefficient is of the form

$$\chi=-6q_{4} e^{0.06z-2\sin(z)}. $$

Family 8

Taking parameters \(m=-0.04\), \(s_{j}=-0.0001\), we can obtain the periodic wave solution

$$u_{8}=e^{0.03z+\sin(z)}F\bigl(e^{0.02z}L-6z \bigr)e^{iB}, $$

where

$$\begin{aligned}& B=-0.005e^{0.04z}r^{2}+e^{0.02z}L+3(q_{2}-1)z, \\& L=x+y+t, \qquad r^{2}=x^{2}+y^{2}+z^{2}. \end{aligned}$$

The nonlinearity coefficient is of the form

$$\chi=-6q_{4} e^{-0.06z-2\sin(z)}. $$

The evolution plots of solutions u in Families 5-8 are very close to the evolution plots in [28], and we omit the corresponding discussion for the limit of the length.

4 Conclusions

In conclusion, we have used similarity transformation to construct analytical spatiotemporal soliton solutions of the generalized \((3+1)\)-dimensional NLS equation with varying coefficients, and also investigated the propagation characteristics of the spatiotemporal solitons which can be dramatically affected by the complicated potential.