29.03.2016 Views

Nonlinear Fiber Optics - 4 ed. Agrawal

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix B<br />

Numerical Code for the NLS<br />

Equation<br />

The split-step Fourier method of Section 2.4.1 can be implement<strong>ed</strong> using a number<br />

of programming languages such as C++ or Fortran. The use of software package<br />

MATLAB (sold by MathWorks, Inc.) is also quite common for this purpose. This<br />

Appendix lists a sample MATLAB m-file that may help some readers of this book.<br />

It should be stress<strong>ed</strong> that this code should be us<strong>ed</strong> as a guideline only because several<br />

parameters that are fix<strong>ed</strong> in the code may ne<strong>ed</strong> to be chang<strong>ed</strong>, depending on the problem<br />

under consideration.<br />

It is a good idea in general to normalize the NLS equation before solving it. With<br />

the normalization scheme given in Eq. (5.2.1), the NLS equation (5.1.1) takes the form<br />

∂U<br />

∂ξ = −is ∂ 2 U<br />

2 ∂τ 2 + iN2 |U| 2 U,<br />

(B.1)<br />

where s = sgn(β 2 )=±1, depending on whether fiber dispersion is normal (s = 1) or<br />

anomalous (s = −1) and N is relat<strong>ed</strong> to the fiber and pulse parameters as<br />

√<br />

N = γP 0 T0 2/|β<br />

2|. (B.2)<br />

Any numerical solution of Eq. (B.1) requires that N and s be specifi<strong>ed</strong> together with<br />

the input amplitude U(0,τ), relat<strong>ed</strong> to shape and chirp of the pulse as<br />

U(0,τ)= f (τ)exp(−iCτ 2 /2),<br />

(B.3)<br />

where f (τ) represents the pulse shape and C is the chirp parameter. In the following<br />

code, an integer m is us<strong>ed</strong> (cod<strong>ed</strong> as mshape) such that f (τ)=sech(τ) when m = 0but<br />

U(0,τ)=exp[− 1 2 (1 + iC)τ2m ], for m > 0. (B.4)<br />

This form represents a super-Guassian shape for the input pulse, and it r<strong>ed</strong>uces to a<br />

Gaussian profile for m = 1. The following code requires that s, N, and m be specifi<strong>ed</strong><br />

together with the total fiber length (in units of the dispersion length L D ).<br />

516

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!