文件名称:
nls the split-step method
开发工具:
文件大小: 1kb
下载次数: 0
上传时间: 2009-12-31
详细说明: % This code solves the NLS equation with the split-step method % idu/dz - sgn(beta2)/2 d^2u/d(tau)^2 + N^2*|u|^2*u = 0 % Written by Govind P. Agrawal in March 2005 for the NLFO book %---Specify input parameters clear all; % distance = input(’Enter fiber length (in units of L_D) =’); % beta2 = input(’dispersion: 1 for normal, -1 for anomalous’);% N = input(’Nonlinear parameter N = ’); % soliton order mshape = input(’m = 0 for sech, m > 0 for super-Gaussian = ’); chirp0 = 0; % input pulse chirp (default value) %---set simulatio n parameters nt = 1024; Tmax = 32; % FFT points and window size step_num = round(20*distance*N^2); % No. of z steps to deltaz = distance/step_num; % step size in z dtau = (2*Tmax)/nt; % step size in tau %---tau and omega arrays tau = (-nt/2:nt/2-1)*dtau; % temporal grid omega = (pi/Tmax)*[(0:nt/2-1) (-nt/2:-1)]; % frequency grid %---Input Field profile if mshape==0 uu = sech(tau).*exp(-0.5i*chirp0*tau.^2); % soliton else % super-Gaussian uu = exp(-0.5*(1+1i*chirp0).*tau.^(2*mshape)); end %---Plot input pulse shape and spectrum temp = fftshift(ifft(uu)).*(nt*dtau)/sqrt(2*pi); % spectrum figure; subplot(2,1,1); plot(tau, abs(uu).^2, ’--k’); hold on; axis([-5 5 0 inf]); xlabel(’Normalized Time’); ylabel(’Normalized Power’); title(’Input and Output Pulse Shape and Spectrum’); subplot(2,1,2); plot(fftshift(omega)/(2*pi), abs(temp).^2, ’--k’); hold on; axis([-.5 .5 0 inf]); xlabel(’Normalized Frequency’); ylabel(’Spectral Power’); %---store dispersive phase shifts to speedup code dispersion = exp(i*0.5*beta2*omega.^2*deltaz); % phase factor hhz = 1i*N^2*deltaz; % nonlinear phase factor %*********[ Beginning of MAIN Loop]*********** % scheme: 1/2N -> D -> 1/2N; first half step nonlinear temp = uu.*exp(abs(uu).^2.*hhz/2); % note hhz/2 for n=1:step_num f_temp = ifft(temp).*dispersion; uu = fft(f_temp); temp = uu.*exp(abs(uu).^2.*hhz); end uu = temp.*exp(-abs(uu).^2.*hhz/2); % Final field temp = fftshift(ifft(uu)).*(nt*dtau)/sqrt(2*pi); %Final spectrum %***************[ End of MAIN Loop ]************** %----Plot output pulse shape and spectrum subplot(2,1,1) plot(tau, abs(uu).^2, ’-k’) subplot(2,1,2) plot(fftshift(omega)/(2*pi), abs(temp).^2, ’-k’) ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.