24小时热门版块排行榜    

查看: 7142  |  回复: 19
【奖励】 本帖被评价11次,作者514233增加金币 8.3 个
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

514233

银虫 (初入文坛)


[资源] 【资源】光纤中,分布傅里叶算法解非线性薛定谔方程MATLAB源程序

function u1 = ssprop(u0,dt,dz,nz,alpha,betap,gamma,maxiter,tol);
% This function solves the nonlinear Schrodinger equation for
% pulse propagation in an optical fiber using the split-step
% Fourier method.
%
% The following effects are included in the model: group velocity
% dispersion (GVD), higher order dispersion, loss, and self-phase
% modulation (gamma).
%
% USAGE
%
% u1 = ssprop(u0,dt,dz,nz,alpha,betap,gamma);
% u1 = ssprop(u0,dt,dz,nz,alpha,betap,gamma,maxiter);
% u1 = ssprop(u0,dt,dz,nz,alpha,betap,gamma,maxiter,tol);
%
% INPUT
%
% u0 - starting field amplitude (vector)
% dt - time step
% dz - propagation stepsize
% nz - number of steps to take, ie, ztotal = dz*nz
% alpha - power loss coefficient, ie, P=P0*exp(-alpha*z)
% betap - dispersion polynomial coefs, [beta_0 ... beta_m]
% gamma - nonlinearity coefficient
% maxiter - max number of iterations (default = 4)
% tol - convergence tolerance (default = 1e-5)
%
% OUTPUT
%
% u1 - field at the output
%
% NOTES  The dimensions of the input and output quantities can
% be anything, as long as they are self consistent.  E.g., if
% |u|^2 has dimensions of Watts and dz has dimensions of
% meters, then gamma should be specified in W^-1*m^-1.
% Similarly, if dt is given in picoseconds, and dz is given in
% meters, then beta(n) should have dimensions of ps^(n-1)/m.
%
% See also:  sspropc (compiled MEX routine)
%
% AUTHOR:  Thomas E. Murphy (tem@umd.edu)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Copyright 2006, Thomas E. Murphy
%
%   This file is part of SSPROP.
%
%   SSPROP is free software; you can redistribute it and/or
%   modify it under the terms of the GNU General Public License
%   as published by the Free Software Foundation; either version
%   2 of the License, or (at your option) any later version.
%
%   SSPROP is distributed in the hope that it will be useful, but
%   WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public
%   License along with SSPROP; if not, write to the Free Software
%   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
%   02111-1307 USA

if (nargin<9)
  tol = 1e-5;
end
if (nargin<8)
  maxiter = 4;
end

nt = length(u0);
w = 2*pi*[(0:nt/2-1),(-nt/2:-1)]'/(dt*nt);

halfstep = -alpha/2;
for ii = 0:length(betap)-1;
  halfstep = halfstep - j*betap(ii+1)*(w).^ii/factorial(ii);
end
halfstep = exp(halfstep*dz/2);

u1 = u0;
ufft = fft(u0);
for iz = 1:nz,
  uhalf = ifft(halfstep.*ufft);
  for ii = 1:maxiter,
    uv = uhalf .* exp(-j*gamma*(abs(u1).^2 + abs(u0).^2)*dz/2);
        uv = fft(uv);
    ufft = halfstep.*uv;
    uv = ifft(ufft);
    if (norm(uv-u1,2)/norm(u1,2) < tol)
      u1 = uv;
      break;
    else
      u1 = uv;
    end
  end
  if (ii == maxiter)
    warning(sprintf('Failed to converge to %f in %d iterations',...
        tol,maxiter));
  end
  u0 = u1;
end
http://www.photonics.umd.edu/software/ssprop/ssprop-3.0.1-windows.zip

[ Last edited by 514233 on 2010-5-7 at 11:50 ]
回复此楼

» 收录本帖的淘帖专辑推荐

matlab

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

phyfriday

金虫 (小有名气)


★★★★★ 五星级,优秀推荐

很不错的程序 谢谢
18楼2011-03-18 18:43:30
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 20 个回答

janecool

铁杆木虫 (著名写手)


看看,学习学习!
2楼2010-05-07 12:03:28
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

chuxinbsn

木虫 (小有名气)


★★★★★ 五星级,优秀推荐

看看,学习学习!
3楼2010-05-08 21:48:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

leidh725

木虫 (著名写手)


★★★ 三星级,支持鼓励

Agrawal 写的《Nonlinear fiber optics 》第四版的附录中有作者写的 matlab程序的源代码。
4楼2010-05-09 23:30:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
☆ 无星级 ★ 一星级 ★★★ 三星级 ★★★★★ 五星级
普通表情 龙 兔 虎 猫 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[博后之家] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +3 ViqFlLSxHDGt 2026-09-26 3/150 2026-09-27 10:42 by 4IW0sJvtEqX8
[找工作] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 ViqFlLSxHDGt 2026-09-26 3/150 2026-09-27 10:26 by 4IW0sJvtEqX8
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 ViqFlLSxHDGt 2026-09-26 3/150 2026-09-27 10:21 by 4IW0sJvtEqX8
[公派出国] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +3 ViqFlLSxHDGt 2026-09-26 3/150 2026-09-27 10:15 by 4IW0sJvtEqX8
[考博] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +3 ViqFlLSxHDGt 2026-09-26 3/150 2026-09-27 10:03 by 4IW0sJvtEqX8
[考博] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 oeyPlfmMUpOC 2026-09-26 3/150 2026-09-27 09:13 by 4IW0sJvtEqX8
[考博] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 GxESXJmptOtQ 2026-09-25 4/200 2026-09-27 06:42 by XgCC8uTcwILl
[论文投稿] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 GxESXJmptOtQ 2026-09-25 4/200 2026-09-27 06:39 by XgCC8uTcwILl
[找工作] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +3 GxESXJmptOtQ 2026-09-25 3/150 2026-09-27 06:32 by XgCC8uTcwILl
[找工作] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 vQZoDrrm7mUF 2026-09-25 3/150 2026-09-27 06:08 by XgCC8uTcwILl
[考研] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +3 vQZoDrrm7mUF 2026-09-25 3/150 2026-09-27 05:56 by XgCC8uTcwILl
[论文投稿] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +4 vQZoDrrm7mUF 2026-09-25 4/200 2026-09-27 05:56 by XgCC8uTcwILl
[找工作] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +5 vQZoDrrm7mUF 2026-09-25 5/250 2026-09-27 05:53 by XgCC8uTcwILl
[博后之家] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +4 vQZoDrrm7mUF 2026-09-25 4/200 2026-09-27 05:50 by XgCC8uTcwILl
[考研] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 vQZoDrrm7mUF 2026-09-25 5/250 2026-09-27 05:44 by XgCC8uTcwILl
[公派出国] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +4 vQZoDrrm7mUF 2026-09-25 4/200 2026-09-27 05:44 by XgCC8uTcwILl
[论文投稿] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 vQZoDrrm7mUF 2026-09-25 6/300 2026-09-27 05:42 by XgCC8uTcwILl
[找工作] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +4 PGTSwSC3F6nQ 2026-09-24 5/250 2026-09-25 11:19 by yhq9807
[教师之家] 课题组招2027级博士 上海工程技术大学 激光智能制造方向 +4 oxidpl 2026-09-20 6/300 2026-09-24 20:37 by oxidpl
[基金申请] 师弟论文见刊大半年才想起来申请专利,还能抢救一下吗? +4 13108017953 2026-09-21 4/200 2026-09-24 10:06 by kudofaye
信息提示
请填处理意见