1 Introduction

The dynamics of light–matter interactions in a nonlinear medium with group velocity dispersion (GVD) is governed by the nonlinear Schrödinger equation (NLSE), which is derived from Maxwell’s equations under standard approximations. In the absence of higher order GVD, the analytical solutions of NLSE have previously been reported [1, 2], such as a basic soliton, which maintains its shape while propagating and N-solitons, which split and sharpen periodically while propagating. Analysis of NLSE is necessary for not only studies of solitons but also for design for ultrashort pulse lasers such as femtosecond lasers, for which solitons are utilized.

However, for light propagation in actual mediums or in optical fibers, it is often desirable to consider higher order GVD, frequency-dependent gain, or frequency-dependent absorption in addition to first-order GVD and third-order nonlinear interactions. Higher order GVD causes deformation of pulse shape; moreover, ultra-short-pulse lasers require broad gain in frequency domain. Therefore, for design of short pulse lasers, it is important to consider frequency-dependency of gain to confirm that gain mediums have sufficient gain width. Moreover, saturable absorption plays an important role in mode-locked laser oscillators. In such cases, the analytical solutions of NLSE do not exist; therefore, a numerical calculation is used. It is convenient to use the Fourier components of field to analyze the effects of higher order GVD, frequency-dependent gain, and frequency-dependent absorption. On the contrary, the time-domain finite-difference method is suitable for analyzing the effects of third-order nonlinear interactions, saturable gain, and absorption. Therefore, combining these two methods a technique, which is known as the split-step Fourier method (SSFM), is generally used to solve NLSE numerically [3,4,5,6]. Field evolution is computed by repeated Fourier transform and its inverse in SSFM.

Although Fourier transform is assumed to be a slow process, it has been reported that using the fast Fourier transform algorithm in SSFM makes the process quicker compared to using the differential method for solving NLSE [3, 4]. Contrary reports have suggested that the differential method, in particular, the implicit–explicit method is robust, and its computation speed is at par with SSFM for ordinary NLSE [7]. With the recent surge in fast numerical computation libraries for linear algebra, obtaining sufficient computation speeds using the time-domain differential method solely is possible. Moreover, because differential equations are written explicitly, the time-domain computation is useful for analyzing them.

The consideration of higher order GVD, frequency-dependent gain, or frequency-dependent absorption in NLSE requires the inclusion of higher order derivative terms, as discussed in the following section. In particular for narrow gain or absorption, the requisite derivative order may become larger than 10. The analytical solutions of extended NLSE incorporating third-order derivative terms corresponding to second-order GVD have been reported previously [8, 9]. However, to the best of my knowledge, no reported solutions of NLSE incorporating derivative terms of order > 3 for frequency-dependent gain or absorption are present. For partial differential equations, a general Runge–Kutta method to compute higher order derivatives [10] and a numerical computation method including higher order derivatives for the boundary value problem using a computational mesh [11] have been reported. However, for algorithms described in these studies, the order of derivatives is fixed and \(\le \) 5; therefore, the analysis of partial differential equations with condition-dependent derivative order is not feasible.

Herein, I propose an algorithm to solve partial differential equations with any higher order derivative terms, such as extended NLSE to account for higher order GVD, frequency-dependent gain, and frequency-dependent absorption. Moreover, I attempt to perform numerical computations for systems related to ultra-short-pulse laser oscillators that exhibit frequency-dependent gain, saturable absorption, GVD, and third-order nonlinear interactions. In such systems, the frequency dependency of gain mediums such as Ti:sapphire crystals or Yb:YAG crystals affects the pulse shape, particularly the pulse duration, because the amplification of ultra-short pulses requires a broad gain spectrum. Conversely, saturable absorptions using semiconductor saturable-absorber mirrors or organic dyes suppress the amplification of noise. Furthermore, GVD and nonlinear interactions shape the pulse into a basic soliton. In the present work, some computational results with known analytical solutions, i.e., basic solitons, N-solitons, and similaritons are also shown to confirm the accuracy and stability of the proposed algorithm.

2 Formalization of the extended nonlinear Schrödinger equation

Although the derivation of NLSE is described in some textbooks [3, 12], to incorporate the effect of higher order GVD, frequency-dependent gain, and frequency-dependent absorption in NLSE, we must start from Maxwell’s equations. Let \({\varvec{E}}(z,t)\), \({\varvec{D}}^{(1)}(z,t)\) and \({\varvec{P}}^{\mathrm{NL}}(z,t)\) be the electric field, linear electric displacement produced by the linear polarization field, and nonlinear polarization caused by nonlinear interaction, respectively, at the position z along the direction of propagation and at time t. Using Maxwell’s equations, the light beam propagation is given by

$$\begin{aligned}&\frac{\partial ^2}{\partial z^2}{\varvec{E}}(z,t) -\frac{1}{c^2\varepsilon _0}\frac{\partial ^2}{\partial t^2} {\varvec{D}}^{(1)}(z,t)\nonumber \\&\quad = \frac{1}{c^2\varepsilon _0}\frac{\partial ^2}{\partial t^2} {\varvec{P}}^{\mathrm{NL}}(z,t), \end{aligned}$$
(1)

where c and \(\varepsilon _0\) are the speed of light and vacuum electric permittivity, respectively. Here, it is assumed that the fields vary slowly along the x and y directions; therefore, derivative terms along these directions are neglected. Although this approximation is not valid for optical fibers, we can obtain an equation that has the same form as that of Eq. (1) by the separation of variables. To analyze pulse behavior, we define envelope E(zt) of \({\varvec{E}}(z,t)\) as

$$\begin{aligned} {\varvec{E}}(z,t)={\varvec{e}}E(z,t) e^{ikz-i\omega t}, \end{aligned}$$
(2)

where \({\varvec{e}}\) and k are the unit vector along the electric field and wavenumber corresponding to \(\omega \), respectively. In the linear interaction term in Eq. (1), after the Fourier transformation of the envelope, we separate electric permittivity, which is a function of \(\omega \), into its real part \(\varepsilon ^{(1)}(\omega )\) and imaginary part \(\varepsilon ^{'(1)}(\omega )\). The imaginary part contributes to the amplification or absorption of the electromagnetic field, whereas the real part relates to the refractive index and its dispersion. Furthermore, by expanding \(\varepsilon ^{(1)}(\omega )\) and \(\varepsilon ^{'(1)}(\omega )\) around \(\omega \), we transform the terms using inverse Fourier transformation again. Moreover, for the nonlinear term in Eq. (1), we assume self-phase modulation with third order nonlinear permittivity \(\chi ^{(3)}\). Thus, Eq. (1) is written as

$$\begin{aligned}&2ik\left[ \frac{\partial }{\partial z} +v^{-1}_{\mathrm{g}}\frac{\partial }{\partial t}\right] E(z,t) +\frac{k}{v^{2}_{\mathrm{g}}}\frac{\partial v_{\mathrm{g}}}{\partial \omega } \frac{\partial ^2 E(z,t)}{\partial t^2}\nonumber \\&\qquad +\sum _{n=3}\frac{1}{(-1)^n}\frac{1}{n!}\frac{\partial ^n k^2}{\partial \omega ^n} \frac{\partial ^n E(z,t)}{\partial t^n} \nonumber \\&\qquad +i\sum _{n=0} \frac{1}{c^2\varepsilon _0} \frac{1}{(-1)^n}\frac{1}{n!} \frac{\partial ^n \omega ^2\varepsilon ^{'(1)}(\omega )}{\partial \omega ^n} \frac{\partial ^n E(z,t)}{\partial t^n}\nonumber \\&\quad =-\frac{\omega ^2}{c^2\varepsilon _0}\chi ^{(3)}\left| E(z,t)\right| ^2 E(z,t). \end{aligned}$$
(3)

See “Appendix” for details regarding the derivation. In the above Eq. (3), the first two terms on the left and the term on the right correspond to the increments of the electric field proceeding with group velocity \(v_{\mathrm{g}}\), the effect of group velocity dispersion, and that of the third-order nonlinear interactions, respectively. All these terms appear in the ordinary NLSE. The additional third term on the left represents the effect of higher order GVD. Furthermore, the fourth term on the left is the frequency-dependent gain or absorption.

The effect of the fourth term in Eq. (3) can be understood by considering the case without GVD and nonlinear interactions. In this case, using Eq. (26) again, we have

$$\begin{aligned}&2ik\left[ \frac{\partial }{\partial z} +v^{-1}_{\mathrm{g}}\frac{\partial }{\partial t}\right] E(z,t) \nonumber \\&\quad +\int d\eta 2ikg(\omega +\eta ) E(z,\omega +\eta )e^{-i\eta t} = 0, \end{aligned}$$
(4)

where \(g(\omega +\eta )\) is defined as

$$\begin{aligned} g(\omega +\eta ) = -\frac{\omega ^2\varepsilon ^{'(1)}(\omega +\eta )}{2c^2\varepsilon _0 k}. \end{aligned}$$
(5)

We convert E(zt) in Eq. (4) to frequency component \(E(z,\omega )\) using Eqs. (22) and (2), and transform the coordinate system to another one with relative velocity \(v_{\mathrm{g}}\) such that \(z'=z\) and \(t'=t-v^{-1}_{\mathrm{g}}z\). It is important to note that the frequency component \(E'(z',\omega )\) in the new coordinate system is \(E(z,\omega )\) multiplied by a phase factor \(e^{-iv^{-1}_{\mathrm{g}}z'}\). Therefore, we get \( \partial E'(z',\omega +\eta )/\partial z' = g(\omega +\eta )E'(z',\omega +\eta ) \), whose solution is

$$\begin{aligned} E'(z',\omega +\eta ) = E'_0 e^{g(\omega +\eta )z'} \end{aligned}$$
(6)

where \(E'_0\) is the value of \(E'(z'=0,\omega +\eta )\). Therefore, \(g(\omega +\eta )\) can be interpreted as a measure of gain or absorption for the field component of angular frequency \(\omega +\eta \).

For a bandpass filter that attenuates the field by a factor of \(f_{\mathrm{f}}(\omega +\eta )\) for unit distance, substituting \(E'(z',\omega +\eta )=f_{\mathrm{f}}(\omega +\eta )E'_{0}\) and \(z'=1\), Eq. (6) becomes \(f_{\mathrm{f}}(\omega +\eta ) = e^{g(\omega +\eta )}\), or \(g(\omega +\eta ) = \log f_{\mathrm{f}}(\omega +\eta )\). For a Gaussian filter shape, \(f_{\mathrm{f}}(\omega +\eta ) = e^{-\eta ^2/2\sigma _{\mathrm{f}}^2}\); therefore, we can write \(g(\omega +\eta ) = -\eta ^2/2\sigma _{\mathrm{f}}^2\). Moreover, the frequency dependency of gain by laser transition atoms such as Ne atoms in He–Ne lasers or Nd atoms in Nd:YAG lasers reflects the distribution of these atoms shifted by the Doppler or Stark effects. Since gain for the power is proportional to the difference of population inversion, using distribution function \(f_g(\omega )\) of the difference of population inversion, the power \(P(\omega )\) is written as \(\mathrm{d}P(\omega )/\mathrm{d}z' = g_{\mathrm{p}}f_{\mathrm{g}}(\omega )P(\omega )\), therefore

$$\begin{aligned} P(\omega )=P_0 e^{g_{\mathrm{p}}f_{\mathrm{g}}(\omega )z'} , \end{aligned}$$
(7)

where \(P_0\) and \(g_{\mathrm{p}}\) are the initial value of the power and the proportional constant of gain, respectively. Since \(P(\omega )\) is proportional to \(|E(z',\omega )|^2\), to satisfy Eq. (7), we put

$$\begin{aligned} E'(z',\omega ) = E'_0 e^{g_{\mathrm{p}}f_{\mathrm{g}}(\omega )z'/2}. \end{aligned}$$
(8)

Comparing this equation with Eq. (6), we can obtain

$$\begin{aligned} g(\omega )=g_{\mathrm{c}}f_{\mathrm{g}}(\omega ) , \end{aligned}$$
(9)

where we defined the gain constant \(g_\mathrm{c}=g_\mathrm{p}/2\) for the field. In the case of homogeneous broadening owing to the finite lifetime of atoms, \(g(\omega +\eta )\) is also proportional to the broadening form function. Similarly, for atomic absorption in a medium, we can write \(g(\omega +\eta ) = -a f_{\mathrm{a}}(\omega +\eta )\), where a and \(f_{\mathrm{a}}(\omega +\eta )\) are constant absorption and the absorption form function, respectively. Using the above terms, we have

$$\begin{aligned} g(\omega +\eta ) = \log f_{\mathrm{f}}(\omega +\eta ) +g_{\mathrm{c}} f_{\mathrm{g}}(\omega +\eta ) -a f_{\mathrm{a}}(\omega +\eta ). \end{aligned}$$
(10)

A commonly used form function is a Gaussian function which is expressed as \(f(\omega +\eta ) = \exp (-\eta ^2/2\sigma ^2)\). Using mathematical induction, it can be easily proved that

$$\begin{aligned} \left. \frac{\mathrm{d}^{n} e^{-\frac{\eta ^2}{2\sigma ^2}}}{\mathrm{d}\eta ^n} \right| _{\eta =0} = \left\{ \begin{array}{ll} 0 &{} (n=\mathrm{odd}) \\ \frac{1}{\sigma ^n}(-1)^{\frac{n}{2}}(n-1)!! &{} (n=\mathrm{even}) \\ \end{array} \right. . \end{aligned}$$
(11)

The above Gaussian form function can be used for the term \(\partial ^n \omega ^2\varepsilon ^{'(1)}(\omega )/\partial \omega ^n\) in Eq.(3).

It is well established that in a saturable gain medium, power P is given by \(\partial P/\partial z' = 2g_0 P/(1+P/P_{\mathrm{sat}})\), where \(g_0\) and \(P_{\mathrm{sat}}\) are small signal gain and saturation power, respectively. Under the condition that \(\partial E(z',t')/\partial z'\) is proportional to \(E(z',t')\) for small \(E(z',t')\), we derive \(\partial E(z',t')/\partial z' = g_0 E(z',t')/(1+P/P_{\mathrm{sat}})\). Hence, we can express saturable gain as

$$\begin{aligned} g_{\mathrm{c}} = \frac{g_0}{1+P/P_{\mathrm{sat}}}. \end{aligned}$$
(12)

Because the effective lifetime of an atomic laser transition is much longer than the pulse duration of commonly used high-repetition short-pulse lasers, it is pertinent to consider the time mean value \(P_{\mathrm{av}}\) instead of P, where \(P_{\mathrm{av}} = (1/T_{\mathrm{rep}})\int _{o}^{T_{\mathrm{rep}}} P \mathrm{d}t\) and \(T_{\mathrm{rep}}\) is the repetition interval. Similarly, for saturable absorption, we can write

$$\begin{aligned} a=\frac{a_0}{1+|E(z,t)|^2/|E_{\mathrm{sat}}|^2} \end{aligned}$$
(13)

where \(a_0\) and \(E_{\mathrm{sat}}\) are small signal absorption and saturation field, respectively.

To obtain the response of a field using Eq. (3), it is convenient to transform the variables to non-dimensional ones using \(\tau = (1/T)(t-z/v_{\mathrm{g}})\), \(\xi = \left( \partial v_{\mathrm{g}}^{-1}/\partial \omega \right) \left( z/T^2\right) \) and \(\phi = T \bigg |\left[ \omega \chi ^{(3)}/(2\varepsilon _0 c)\right] \) \(/\left( \partial v_{\mathrm{g}}^{-1} / \partial \omega \right) \bigg |^{\frac{1}{2}} E(z,t)\), where T is the pulse duration. Therefore, Eq. (3) becomes

$$\begin{aligned} \frac{\partial \phi }{\partial \xi } = \sum _{n=1} c_n \frac{\partial ^n \phi }{\partial \tau ^n} +A\phi , \end{aligned}$$
(14)

where

$$\begin{aligned} c_n= & {} \mp \frac{i}{2}\delta _{2,n} +i a_n -b_n\; (a_n=0 \quad \mathrm{for}\quad n\le 2), \nonumber \\ A= & {} i|\phi |^2 -b_0 -\gamma _{\mathrm{c}}. \end{aligned}$$
(15)

Here \(\gamma _{\mathrm{c}}\) is a constant loss factor. In Eq. (15), the positive and negative signs in \(c_n\) represent negative and positive group velocity dispersions, respectively. Furthermore, \(a_n\) and \(b_n\) are defined as

$$\begin{aligned} a_n= & {} \frac{1}{2k}\frac{1}{|\partial v_{\mathrm{g}}^{-1}/\partial \omega |} \frac{1}{(-i)^n n!}\frac{\partial ^n k^2}{\partial \omega ^n} \frac{1}{T^{n-2}} \nonumber \\ b_n= & {} -\frac{1}{(-1)^n}\frac{1}{n!}\frac{1}{T^n} \left[ \lambda \left. \frac{\partial ^n \log f_{\mathrm{f}}(\omega )}{\partial \omega ^n}\right| _{\omega } \right. \nonumber \\&\quad \left. +\gamma \left. \frac{\partial ^n f_{\mathrm{g}}(\omega )}{\partial \omega ^n}\right| _{\omega } -\alpha \left. \frac{\partial ^n f_{\mathrm{a}}(\omega )}{\partial \omega ^n}\right| _{\omega } \right] \end{aligned}$$
(16)

where \(\lambda =T^2|\partial v^{-1}_{\mathrm{g}}/\partial \omega |^{-1}\), \(\gamma =g_{\mathrm{c}}T^2|\partial v^{-1}_{\mathrm{g}}/\partial \omega |^{-1}\) and \(\alpha =aT^2|\partial v^{-1}_{\mathrm{g}}/\partial \omega |^{-1}\). For saturable gain or absorption, \(\gamma _0\) and \(\alpha _0\) are defined in a similar manner such that Eqs. (12) and (13) remain valid. The algorithm proposed in the following section aims to solve Eq. (14).

Although the Gaussian function in Eq. (11) is represented by the Taylor series expansion, it converges slowly, in particular for \(\eta >\sigma \). For example, \(\phi = \mathrm{sech}\tau \cdot e^{i\xi /2}\), which is one of the solutions of Eq. (14) for \(c_2 = i/2\), \(c_n = 0 (n\ne 2)\) and \(A = i|\phi |^2\), is a soliton pulse and has large Fourier components in the range \(\omega <6\). If the Taylor series corresponding to Eq. (11) does not converge sufficiently at these angular frequencies, the numerical solution diverges. This is the primary reason for the inclusion of higher order derivative terms in Eq. (14).

3 Numerical computation algorithm

Our next aim is to solve Eq. (14). To calculate the differential equation including higher order derivatives, we use the differential method, in which solutions at slightly forwarded \(\xi \) are iteratively calculated using the approximation of the derivative by difference. We expand \(\phi (\xi +\varDelta \xi ,\tau )\) and \(\phi (\xi -\varDelta \xi ,\tau )\) around \(\xi \), and the difference of which can be expressed as

$$\begin{aligned} \left. \frac{\partial }{\partial \xi }\phi (\xi ,\tau )\right| _{\xi }= & {} \frac{1}{2\varDelta \xi }\left\{ \phi (\xi +\varDelta \xi ,\tau ) -\phi (\xi -\varDelta \xi ,\tau ) \right\} \nonumber \\&\quad +O\left( \varDelta \xi ^2\right) . \end{aligned}$$
(17)

Substituting this term in Eq. (14), and using the notation, where \(\phi \) at \(\xi =i\varDelta \xi \) and \(\tau =j\varDelta \tau \) can be expressed as \(\phi ^{i}_{j}\), we obtain

$$\begin{aligned} \phi ^{i+1}_j = \phi ^{i-1}_j +2\varDelta \xi \left[ \sum _{n=1}c_n\frac{\partial ^n\phi ^i_j}{\partial \tau ^n} +A(\phi ^i_j)\phi ^i_j \right] +O(\varDelta \xi ^3). \end{aligned}$$
(18)

Furthermore, we represent \(\partial ^{n}\phi ^{i}_{j}/\partial \tau ^{n}\) by \(\phi (\xi ,\tau -(N/2)\varDelta \tau ),\phi (\xi ,\tau -(N/2-1)\varDelta \tau ),\dots ,\phi (\xi ,\tau +(N/2)\varDelta \tau )\) for the purpose of substitution to Eq. (18). Using Taylor expansion around \(\tau \), we can write \(\phi (\xi ,\tau -(N/2)\varDelta \tau ),\phi (\xi ,\tau -(N/2-1)\varDelta \tau ),\dots ,\phi (\xi ,\tau +(N/2)\varDelta \tau )\) as follows:

$$\begin{aligned} \phi (\xi ,\tau -(N/2)\varDelta \tau )= & {} \phi (\xi ,\tau ) +\left. \frac{\partial }{\partial \tau }\phi (\xi ,\tau )\right| _{\tau } \left( -\frac{N}{2}\varDelta \tau \right) +\cdots \nonumber \\&\quad +\frac{1}{N!} \left. \frac{\partial ^N}{\partial \tau ^N}\phi (\xi ,\tau )\right| _{\tau }\ \left( -\frac{N}{2}\varDelta \tau \right) ^N +O(\varDelta \tau ^{N+1}) \nonumber \\&\phi (\xi ,\tau -(N/2-1)\varDelta \tau ) = \phi (\xi ,\tau ) +\left. \frac{\partial }{\partial \tau }\phi (\xi ,\tau )\right| _{\tau } \left[ -\left( \frac{N}{2}-1\right) \varDelta \tau \right] +\dots \nonumber \\&\quad +\frac{1}{N!} \left. \frac{\partial ^N}{\partial \tau ^N}\phi (\xi ,\tau )\right| _{\tau }\ \left[ -\left( \frac{N}{2}-1\right) \varDelta \tau \right] ^N +O(\varDelta \tau ^{N+1}) \nonumber \\&\vdots \nonumber \\&\phi (\xi ,\tau +(N/2)\varDelta \tau ) = \phi (\xi ,\tau ) +\left. \frac{\partial }{\partial \tau }\phi (\xi ,\tau )\right| _{\tau } \frac{N}{2}\varDelta \tau +\dots \nonumber \\&\quad +\frac{1}{N!} \left. \frac{\partial ^N}{\partial \tau ^N}\phi (\xi ,\tau )\right| _{\tau }\ \left( \frac{N}{2}\varDelta \tau \right) ^N +O(\varDelta \tau ^{N+1}), \end{aligned}$$
(19)

where N is an even number. The above equations can be written in a matrix form as

$$\begin{aligned}&\left[ \begin{array}{l} \phi ^i_{j-N/2}-\phi ^i_j \\ \phi ^i_{j-N/2+1}-\phi ^i_j \\ \vdots \\ \phi ^i_{j+N/2}-\phi ^i_j \\ \end{array} \right] \nonumber \\&\quad = \left[ \begin{array}{llll} -\frac{N}{2}\varDelta \tau &{} \frac{1}{2}\left( -\frac{N}{2}\varDelta \tau \right) ^2 &{} \cdots &{} \frac{1}{N!}\left( -\frac{N}{2}\varDelta \tau \right) ^N \\ \left( -\frac{N}{2}+1\right) \varDelta \tau &{} \frac{1}{2}\left[ \left( -\frac{N}{2}+1\right) \varDelta \tau \right] ^2 &{} \cdots &{} \frac{1}{N!}\left[ \left( -\frac{N}{2}+1\right) \varDelta \tau \right] ^N \\ &{}&{}\vdots &{} \\ \frac{N}{2}\varDelta \tau &{} \frac{1}{2}\left( \frac{N}{2}\varDelta \tau \right) ^2 &{} \cdots &{} \frac{1}{N!}\left( \frac{N}{2}\varDelta \tau \right) ^N \\ \end{array} \right] \nonumber \\&\qquad \times \left[ \begin{array}{l} \left. \frac{\partial }{\partial \tau }\phi (\xi ,\tau )\right| _{\tau } \\ \left. \frac{\partial ^2}{\partial \tau ^2}\phi (\xi ,\tau )\right| _{\tau } \\ \vdots \\ \left. \frac{\partial ^N}{\partial \tau ^N}\phi (\xi ,\tau )\right| _{\tau } \\ \end{array} \right] , \end{aligned}$$
(20)

where the terms of the order \(O\left( \varDelta \tau ^{N+1}\right) \) are neglected. The above equation can be written in a more simplified form as \(\mathcal{C} = \mathcal{A}\mathcal{B}\), where

$$\begin{aligned} \mathcal{A}_{k,l}= & {} \left\{ \begin{array}{ll} \frac{1}{l!}\left[ (k-1-N/2)\varDelta \tau \right] ^l &{}\left( \mathrm{for}\quad l\le N/2\right) \\ \frac{1}{l!}\left[ (k-N/2)\varDelta \tau \right] ^l &{} \left( \mathrm{for}\quad l>N/2\right) \\ \end{array} \right. \nonumber \\ \mathcal{B}_{l}= & {} \left. \frac{\partial ^l}{\partial \tau ^l} \phi (\xi ,\tau )\right| _{\tau } \nonumber \\ \mathcal{C}_k= & {} \left\{ \begin{array}{ll} \phi ^i_{j+k-1-N/2} -\phi ^i_j &{} (\mathrm{for}\quad k\le N/2) \\ \phi ^i_{j+k-N/2} -\phi ^i_j &{} (\mathrm{for}\quad k>N/2) \\ \end{array} \right. . \end{aligned}$$
(21)

We now consider that the values of \(\phi ^i_j\) at \(i=0\) and \(i=1\) are known. Using medium properties, \(c_n\) and \(A\left( \phi ^1_j\right) \) are obtained using Eq. (15). As \(\mathcal{A}\) and \(\mathcal{C}\) are given by (21), we can solve (20) for \(\mathcal{B}\). Using a computer program to perform the computation to solve simultaneous linear equation is suitable. Substituting the value of \(\partial ^l\phi (\xi ,\tau )/\partial \tau ^l |_{\tau }\) in Eq. (18) and calculating \(A\left( \phi _j^i\right) \phi _j^i\) from \(\phi _j^i\) for \(i=1\), we can calculate \(\phi ^i_j\) for all j at \(i=2\). Furthermore, using \(\phi ^i_j\) at \(i=1\) and \(i=2\), we can calculate \(\phi ^i_j\) for \(i=3\), and we can repeat this procedure to obtain \(\phi ^i_j\) at any i. The algorithm described here follows the leap frog method, which is one of the explicit methods, because \(\phi ^{i+1}_j\) is calculated by adding the effect of derivative terms with respect to \(\tau \) to \(\phi ^{i-1}_j\) in Eq. (18).

The approximation to replace derivatives by differences can lead to errors in numerical computations. For example, an error of the order of \(\varDelta \xi ^3\) emerges at every \(\xi \) step as can be seen in Eq. (18). Furthermore, an error around \(\varDelta \tau \) of the order of \(\varDelta \tau ^{N+1}\) also appears, because the terms of \(O\left( \varDelta \tau ^{N+1}\right) \) in Eq. (20) are neglected. Even if \(c_n=0\) for \(n>N\), computation errors can be reduced using a larger N. Despite the fact that N is considered to be even, we can calculate odd order partial differential equations by replacing N with \(N+1\).

4 Results and discussion

I wrote a FORTRAN program based on the algorithm discussed in the previous section. FORTRAN is useful owing to the abundance of libraries available for numerical calculations and the usability of complex numbers. To solve (20), I used the open source libraries, OpenBlas and Lapack, which are linear algebra packages. I compiled and executed the program on the FreeBSD operating system. A Gaussian shape was considered for a band pass filter, frequency-dependent gain, and frequency-dependent absorption in the program. The derivative order with respect to \(\tau \) was automatically determined so that the Gaussian function error at the maximal frequency (calculated using the sampling theorem) was less than the threshold value. The boundary conditions assumed were \(\phi = 0\) at maximum and minimum \(\tau \).

Initially, I calculated the pulse behavior by solving ordinary NLSE with negative GVD and third-order nonlinear interaction only, i.e., \(\partial \phi / \partial \xi = (i/2)\partial ^2 \phi / \partial \tau ^2 +i|\phi |^2\phi \). This equation can be obtained using \(a_n=0\), \(b_n =0\), \(\gamma _{\mathrm{c}} =0\) and \(c_n = i/2\cdot \delta _{2,n}\) in Eqs. (14) and (15). A well-known analytical solution of this equation is \(\phi = \mathrm{sech} \tau \cdot e^{i\xi /2}\), which is a soliton that propagates while keeping the form of \(|\phi |^2\). I used this soliton solution as the initial condition at \(\xi =0\). A representative calculation result is shown in Fig. 1, where \(\varDelta \xi = 4\pi /16{,}000\), the range of \(\tau \) is \(\pm 12\), and the number of \(\tau \) points is 512. In this figure, \(|\phi |^2\) for every \(2000\pi \) of \(\xi \) is shown, and is shifted in the \(\tau \) and \(\xi \) direction to make it easy to visualize. As is well known, in explicit methods, calculation results sometimes diverge by calculation mode. This can be avoided using the filter method [13,14,15]. In this method, after calculating \(\phi ^{i+1}_j\) from Eq. (18), \(\phi ^i_j\) is replaced by \( \phi ^i_j = (1-\nu _{\mathrm{f}})\phi ^i_j+\left( \nu _{\mathrm{f}}/2 \right) \left( \phi ^{i+1}_j+\phi ^{i-1}_j\right) \), which is then used to calculate \(\phi ^{i+2}_j\), where a small number \(\nu _{\mathrm{f}}\) represents mixing rate. In computing the result in Fig. 1, I used the method, where \(\nu _{\mathrm{f}} = 10^{-4}\). Consequently, the computation was stable at \(\xi =20{,}000\pi \) and higher. Conversely, in the case, where the filter method was not used, but the same parameters as those for the computation of Fig. 1 were utilized, the calculation diverged at \(\xi =220\pi \). To investigate the effects of \(\nu _{\mathrm{f}}\), I calculated the basic soliton for various \(\nu _{\mathrm{f}}\), where \(\varDelta \xi \), the range of \(\tau \) and \(\varDelta \tau \) were the same as those used in the computation for Fig. 1. Table 1 shows \(\mathrm{Im}\phi ^i_j\) at \(\xi =200\pi \) and \(\tau =0\) that should be zero, and the normalized error of the integral value of \(|\phi ^i_j|^2\) at \(\xi =200\pi \). The latter can be expressed as \(\left[ \sum _{\tau }\left( |\phi |^2-|\phi (\xi =0)|^2\right) \right] /\sum _{\tau }|\phi (\xi =0)|^2\). These errors decrease with a decrease in \(\nu _{\mathrm{f}}\). However, for \(\nu _{\mathrm{f}} = 10^{-5}\), the shape of \(\left| \phi ^i_j\right| ^2\) was found to be distorted at \(\xi =160\pi \), and it diverged at \(\xi =320\pi \). This divergence may be due to a very small mixing amount \(\nu _{\mathrm{f}}\). This suggests that a careful selection of \(\nu _{\mathrm{f}}\) is necessary to obtain sufficient mixing with minimal computation error. In explicit methods, it is also known that the use of a ratio \(\varDelta \xi /\varDelta \tau \) that is too small causes divergence. In the case for \(\varDelta \xi =4\pi /1600\), the computation diverged at \(\xi =0.3\pi \).

Fig. 1
figure 1

Computation results of basic soliton. The computation is stable until \(\xi =20{,}000\pi \)

Table 1 Calculation error at \(\xi =200\pi \) for \(\nu _\mathrm{f}\)

I also obtained the response of the \(N=3\) soliton and a similariton. The \(N=3\) solitons was obtained using the same parameters as those utilized for the basic soliton but with initial condition \(\phi = 3\mathrm{sech}(\tau )\). An \(N=3\) soliton pulse shows the periodic repetition of splitting and sharpening, which is confirmed by our computation results, as shown in Fig. 2. Here, for \(\varDelta \xi =4\pi /160{,}000\), the number of \(\tau \) points is 1024 and \(\nu _{\mathrm{f}}=10^{-4}\). Furthermore, for \(\varDelta \xi =4\pi /16{,}000\), the number of \(\tau \) points is 512 and \(\nu _{\mathrm{f}}=10^{-4}\), thereby the computation diverged. This implies that \(\varDelta \tau \) and \(\varDelta \xi \) must be small for the \(N=3\) soliton owing to the large variation rate of \(\phi \) in \(\tau \) and \(\xi \).

A well-known asymptotic solution at \(\xi \rightarrow \infty \) [16, 17] is a similariton, which grows while maintaining a similar parabolic shape during propagation. The similariton was obtained in a system with positive GVD, third order nonlinear interaction, and constant gain, where \(a_n=0\), \(b_n =0\), \(\gamma _{\mathrm{c}} =0.5\), and \(c_n =-i/2\cdot \delta _{2,n}\) in Eqs. (14) and (15). A representative computation result is shown in Fig. 3, where the range of \(\tau \) is chosen as ± 48 because of the increase in the similariton pulsewidth.

Fig. 2
figure 2

Computation results of \(N=3\) soliton. The pulse repeats, splitting and sharpening periodically

Fig. 3
figure 3

Computation results of similariton. The pulse grew while maintaining a similar parabolic shape

Finally, I analyzed the development of random noise in systems that exhibit third-order nonlinearity and GVD, along with frequency-dependent saturable gain and absorption. Here, consider the case, where \(\varDelta \xi = 4\pi /64{,}000\), \(-48\le \tau \le 48\), and the number of \(\tau \) points is 512. For the frequency dependency of gain, a Gaussian shape of width \(\sigma \) = 2.9 was assumed. Using this value of \(\sigma \) in Eq. (11), \(\gamma \partial ^n f_{\mathrm{g}}(\omega )/\partial \omega ^n|_{\omega }\) was calculated, which was then used in Eq. (16). Using the sampling theorem, the derivatives with respect to \(\tau \) were calculated up to the eighth order to reduce error in the maximum frequency of the Gaussian shape. I chose \(\gamma _0\) to be 2.6 and \(P_{\mathrm{sat}}\) to be 2.7 for the present analysis. Saturable absorption was assumed to be independent of frequency with \(\alpha _0 = 2.0\) and \(\phi _{\mathrm{sat}} = 0.01\). Moreover, I chose \(\gamma _{\mathrm{c}}=-1.5\) to account for constant loss. For an initial condition, Gaussian-distributed random complex numbers of 1024 points with standard deviation of 0.0013 were generated, which were then assigned to \(\phi _j^0\) and \(\phi _j^1\). I performed computations for several initial conditions, and a representative result is shown in Fig. 4. Although the random noise is amplified at small \(\xi \), it grows into a hyperbolic secant shape pulse at larger \(\xi \). This was a general observation for any given initial condition. A practical system, with parameters in a similar range, is a soliton laser oscillator.

Fig. 4
figure 4

Computation results of the development of random noise. Random noise grew into a hyperbolic secant shape pulse

Furthermore, a computation result with the same parameters as those utilized for the computation for Fig. 4 except \(\gamma _0=4.7\) and \(\sigma _{\mathrm{g}}=1.6\) is shown in Fig. 5. Here the frequency-domain gain width \(\sigma _{\mathrm{g}}\) is 1/1.8 times as large as that utilized for Fig. 4, and the peak value of gain is 1.8 times as large as that utilized for Fig. 4; therefore, the total gain is the same as that for Fig. 4. In computation of Fig. 5, three pulses were generated. In general, ultra-short pulses have to possess frequency-domain components over wide frequency range; moreover, bottom frequency-domain components far from the center frequency cancel time-domain components far from the center of the pulse. Although, in the system for Fig. 5, the stable pules shape, which is a basic soliton, was determined by GVD and third order nonlinear interaction, the required components far from the center frequency could not grow because of insufficient gain width. Therefore, extra pulses were not suppressed, as a result, multi pulses were generated. Since single pulse generation is generally desired in design for mode-locked lasers, and gain width of actual gain mediums is finite, computation taking frequency-dependent gain into account is meaningful.

Fig. 5
figure 5

Computation results of the development of random noise with insufficient gain width

I used the differential method to analyze pulse behavior in systems with a frequency-dependent gain. Here, the selection of suitable values for the parameters \(\varDelta \xi \), \(\varDelta \tau \), and the range of \(\tau \) was essential. We ignored the factor \(\left[ 1+(2i/\omega )\partial /\partial t-\partial ^2/\partial t^2 \right] \) in the nonlinear interaction term of Eq. (23). Because the factor includes derivatives with respect to t and operates \(|E(z,t)|^2 {\varvec{e}}E(z,t)\), it is difficult to include the factor in \(c_n\) in Eq. (14). However, the derivative order is at most second; therefore, if it is necessary to take this factor into account, we can include it in A in Eq. (14). Moreover, third-order nonlinear interactions with response delay is obtained by the replacement of \(\left| E(z,t)\right| ^2\) with \(\int _{-\infty }^{t} R(t') |E(z,t-t')|^2 \mathrm{d}t'\) in the nonlinear interaction term, where R(t) is the nonlinear response function [3, 6]. In this case, the term can also be included in A in Eq. (14) using, for instance, a trapezoidal approximation for the integral.

We started from a one dimensional wave equation (Eq. 1); therefore, variation of the electric field in the transverse direction was not considered. To include this effect, we have to add the term \((\partial ^2/\partial x^2 +\partial ^2/\partial y^2)E(x,y,z,t) e^{ikz-i\omega t}\) in Eq. (23), where E(xyzt) is the electric field that depends not only on z and t but also on x and y. In the computation, it is necessary to calculate \(\left( \partial ^2/\partial x^2 +\partial ^2/\partial y\right) E(x,y,z,t)\) for each \(\xi \); therefore, loops for x and y have to be included in the loop for \(\xi \). Given the large array of E(xyzt) and additional loops, the calculation time could be long. Although the explicit method has been used in the present work, the implicit method is generally considered more to be stable. Although the formalization of an implicit numerical computation method for solving differential equations with higher order derivative terms is challenging, its realization may result in a much more stable computation.

5 Conclusion

An algorithm to solve equations that include any higher order derivative such as extended NLSE for systems exhibiting third-order nonlinear interactions, higher order GVD, frequency-dependent gain, and frequency-dependent absorption was proposed. Using the proposed algorithm, it was shown that the development of random noise into a pulse shape can be calculated in a system including third-order nonlinear interactions, group velocity dispersion, frequency-dependent saturable gain, and saturable absorption.