24小时热门版块排行榜    

查看: 6543  |  回复: 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 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖支持 ( 显示支持度最高的前 50 名 )

hywdx510

木虫 (小有名气)


这个不错,FFT用C++写的,有利于运行速度的提高,
14楼2011-01-12 11:55:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hywdx510

木虫 (小有名气)


★ 一星级,一般

LZ把C++程序顺便也传上来吧,没源程序纯粹就是一个工具,以前那个集成的工具比这更好用啊,有源程序大家才能学习提高。
15楼2011-01-12 12:10:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hywdx510

木虫 (小有名气)


http://www.photonics.umd.edu/software/ssprop/download.html可到这里下载源代码,呵呵,原来美国人早做好了
16楼2011-01-12 16:11:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

514233

银虫 (初入文坛)


引用回帖:
Originally posted by hywdx510 at 2011-01-12 16:11:48:
http://www.photonics.umd.edu/software/ssprop/download.html可到这里下载源代码,呵呵,原来美国人早做好了

对,我就是从这里网址复制的。所以在帖子的最后行给出了所引用得网址哈!
17楼2011-01-12 18:51:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

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的回帖

kramerb

木虫 (正式写手)


★★★ 三星级,支持鼓励

看不懂
5楼2010-05-10 18:50:41
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

514233

银虫 (初入文坛)


引用回帖:
Originally posted by leidh725 at 2010-05-09 23:30:36:
Agrawal 写的《Nonlinear fiber optics 》第四版的附录中有作者写的 matlab程序的源代码。

我看过那本书附录中的源代码,没有这个用着方便,这个您只需编写程序时,调用这个函数文件,输入参数即可。
6楼2010-05-11 13:33:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

415131606

铁杆木虫 (文坛精英)


楼主和我同行啊!呵呵
8楼2010-05-22 16:38:13
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

wangwei05

金虫 (小有名气)


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

楼主真是太棒啦
9楼2010-12-06 23:25:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

枫无悔

金虫 (正式写手)


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

ллLZ
11楼2010-12-23 10:16:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

石页

银虫 (小有名气)


好东西
12楼2010-12-27 15:41:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

phyfriday

金虫 (小有名气)


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

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

晒裤衩的螃蟹

新虫 (初入文坛)


引用回帖:
642067楼: Originally posted by 514233 at 2010-05-07 11:40:53
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
% Fourie ...

程序里面迭代那部分是做什么用的呀,看不太懂。
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
19楼2012-10-24 10:41:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

schwein107

新虫 (初入文坛)


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

这个去UMD看了,没有sspropc.m,也没有C++的程序,是被删除了还是需要付费?大家有吗?
20楼2022-06-09 17:29:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
简单回复
2010-05-11 14:13   回复  
 
张小肆10楼
2010-12-21 10:14   回复  
 谢谢分享~~~
2010-12-29 20:50   回复  
五星好评  谢谢分享!
相关版块跳转 我要订阅楼主 514233 的主题更新
☆ 无星级 ★ 一星级 ★★★ 三星级 ★★★★★ 五星级
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料学硕318求调剂 +11 February_Feb 2026-03-01 13/650 2026-03-01 23:53 by ccp273206157
[考研] 材料化工调剂 +12 今夏不夏 2026-03-01 13/650 2026-03-01 23:32 by L135790
[考研] 江苏省农科院招调剂1名 +3 Qwertyuop 2026-03-01 3/150 2026-03-01 23:18 by aaadim
[考研] 0854复试调剂 276 +3 wmm9 2026-03-01 3/150 2026-03-01 23:13 by 热情沙漠
[硕博家园] 博士自荐 +7 科研狗111 2026-02-26 11/550 2026-03-01 22:24 by 哲平L
[考研] 0805总分292,求调剂 +7 幻想之殇 2026-03-01 7/350 2026-03-01 21:22 by 公瑾逍遥
[考研] 299求调剂 +3 Y墨明棋妙Y 2026-02-28 5/250 2026-03-01 21:01 by tangxiaotian
[考研] 高分子化学与物理调剂 +6 好好好1233 2026-02-28 12/600 2026-03-01 19:48 by 好好好1233
[考研] 化工299分求调剂 一志愿985落榜 +5 嘻嘻(*^ω^*) 2026-03-01 5/250 2026-03-01 19:47 by 无际的草原
[考研] 298求调剂 +6 axyz3 2026-02-28 6/300 2026-03-01 19:00 by 18137688336
[考研] 272求调剂 +6 材紫有化 2026-02-28 6/300 2026-03-01 18:58 by 18137688336
[考研] 0856材料求调剂 +11 hyf hyf hyf 2026-02-28 12/600 2026-03-01 18:57 by 18137688336
[考研] 328求调剂 +3 aaadim 2026-03-01 5/250 2026-03-01 17:29 by njzyff
[考研] 290求调剂 +9 材料专硕调剂; 2026-02-28 11/550 2026-03-01 17:21 by sunny81
[考研] 求调剂 +6 repeatt?t 2026-02-28 6/300 2026-03-01 14:37 by Sakura绘
[考研] 295复试调剂 +3 简木ChuFront 2026-03-01 3/150 2026-03-01 14:27 by zzxw520th
[考研] 317一志愿华南理工电气工程求调剂 +6 Soliloquy_Q 2026-02-28 11/550 2026-03-01 11:14 by 歌liekkas
[考研] 311求调剂 +9 南迦720 2026-02-28 10/500 2026-03-01 10:55 by sunny81
[考研] 085600材料工程一志愿中科大总分312求调剂 +8 吃宵夜1 2026-02-28 10/500 2026-02-28 20:27 by L135790
[硕博家园] 【博士招生】太原理工大学2026化工博士 +4 N1ce_try 2026-02-24 8/400 2026-02-26 08:40 by N1ce_try
信息提示
请填处理意见