首页 -> 登录 -> 注册 -> 回复主题 -> 发表主题
光行天下 -> OptiSystem,PhotonDesign,Rsoft -> RP Fiber Power仿真设计掺铥光纤激光器代码详解 [点此返回论坛查看本帖完整版本] [打印本页]

小火龙果 2020-05-28 16:28

RP Fiber Power仿真设计掺铥光纤激光器代码详解

(* 3^p<Wx  
Demo for program"RP Fiber Power": thulium-doped fiber laser, xEv]V L:  
pumped at 790 nm. Across-relaxation process allows for efficient .xJW=G{/  
population of theupper laser level. cQkH4>C~  
*)            !(*  *)注释语句 W vh3Y,|3  
>q+o MrU  
diagram shown: 1,2,3,4,5  !指定输出图表 W 2/`O?  
; 1: "Powersvs. Position"     !分号是注释;光纤长度对功率的影响 ",wv*z)_>  
; 2:"Variation of the Pump Power"  !泵浦光功率变化对信号输出功率的影响 E`vCYhf{  
; 3:"Variation of the Fiber Length"!信号输出功率vs 光纤长度的变化,仿真最佳光纤长度 vLQ!kB^\W  
; 4:"Transverse Profiles"             !横向分布,横坐标为半径位置 5 9$B z'LY  
; 5:"Transition Cross-sections"    !不同波长的跃迁横截面,横坐标波长,纵坐标为横截面 r9!jIkILz  
]Tmx;[D  
include"Units.inc"         !读取“Units.inc”文件中内容 tbz?th\#  
OcR6\t'  
include"Tm-silicate.inc"    !读取光谱数据 EOqvu=$6  
8GpPyG ],e  
; Basic fiberparameters:    !定义基本光纤参数  P%#WeQ+  
L_f := 4 { fiberlength }      !光纤长度 [UO?L2$&  
No_z_steps := 50 {no steps along the fiber } !光纤步长,大括号{ }是注释,相当于备注 h<KE)^).  
r_co := 6 um { coreradius }                !纤芯半径 #i$/qk= N  
N_Tm := 100e24 { Tmdoping concentration }  !纤芯Tm离子掺杂浓度 |#<PI9)`  
/8V#6d_  
; Parameters of thechannels:                !定义光信道 k-5Enbkr  
l_p := 790 nm {pump wavelength }                !泵浦光波长790nm ;r(hZ%pD  
dir_p := forward {pump direction (forward or backward) }   !前向泵浦 4 ZD~i e  
P_pump_in := 5 {input pump power }                    !输入泵浦功率5W }T<[JXh=J  
w_p := 50 um {radius of pump cladding }               !包层泵浦相应的半径 50um C.SG m  
I_p(r) := (r <=w_p) { pump intensity profile }          !泵浦光强度分布 *#ccz  
loss_p := 0 {parasitic losses of pump wave }           !泵浦光寄生损耗为0 i3C5"\y  
,E&PIbDL1  
l_s := 1940 nm {signal wavelength }                   !信号光波长1940nm W i a%rm  
w_s := 7 um                          !信号光的半径 7;cb^fi/  
I_s(r) := exp(-2 *(r / w_s)^2)            !信号光的高斯强度分布 lMpjE  
loss_s := 0                            !信号光寄生损耗为0 k-;%/:Om  
H JFt{tq2  
R_oc := 0.70 {output coupler reflectivity (right side) }      !输出耦合反射率 K-D{Z7J^l  
AvW2)+6G  
; Function for defining themodel:   !定义模型函数,一定要有calc命令,否则函数只会被定义,但不会被执行 0bY}<x(;  
calc tvNh@it:F  
  begin r;3{%S._  
    global allow all;                   !声明全局变量 1.7tXjRd+  
    set_fiber(L_f, No_z_steps, '');        !光纤参数 <]f ru1  
    add_ring(r_co, N_Tm); Jt4&%b-T  
    def_ionsystem();              !光谱数据函数 &Nf10%J'<  
    pump := addinputchannel(P_pump_in, l_p,'I_p', loss_p, dir_p);  !泵浦光信道 &\(p<TF  
    signal_fw := addinputchannel(0, l_s, 'I_s',loss_s, forward);      !前向信号光信道 =-#>NlB$w  
    signal_bw := addinputchannel(0, l_s, 'I_s',loss_s, backward);    !后向信号光信道 h rfu\cI  
    set_R(signal_fw, 1, R_oc);                                 !设置反射率函数 $umh&z/  
    finish_fiber();                                   )vH6N_  
  end; r>fx5 5dw  
5<o8prt B  
; Display someoutputs in the Output window (on the right side): !在Output aera区域显示输出 aAHx^X^  
show "Outputpowers:"                                   !输出字符串Output powers: .~#<>  
show"pump:     ", P_out(pump):d3:"W"  !输出字符串pump:和计算值(格式为3个有效数字,单位W) /jJi`'{U  
show"signal:   ",P_out(signal_fw):d3:"W" !输出字符串signal:和计算值(格式为3个有效数字,单位W) 4k9O6  
YE<_a;yh1  
F+.:Ry FS  
; ------------- !Pnvqgp/  
diagram 1:                   !输出图表1 c_#\'yeW  
0@w8,x  
"Powers vs.Position"          !图表名称 }UwDHq=  
2z/qbzG7  
x: 0, L_f                      !命令x: 定义x坐标范围 an+`>}]F  
"position infiber (m)", @x      !x轴标签;@x 指示这些字符串沿坐标轴放置 XA`<*QC<  
y: 0, 15                      !命令y: 定义y坐标范围 MCN}p i  
y2: 0, 100                    !命令y2: 定义第二个y坐标范围 sQt]Y&_/@  
frame          !frame改变坐标系的设置 aAY=0rCI-  
legpos 600, 500  !图行在图表窗口中的位置(相对于左上角而言) \B _g=K  
hx             !平行于x方向网格 L"Y_:l3"7  
hy              !平行于y方向网格 vby[# S|  
" S6'<~s  
f: P(pump, x),    !命令f: 定义函数图;P(pump, x)函数是计算x位置处的泵浦光功率 ]^HlI4 z  
  color = red,  !图形颜色 ]MjQr0&M  
  width = 3,   !width线条宽度 Zy0u@``  
  "pump"       !相应的文本字符串标签 _jmkAmeu  
f: P(signal_fw, x),  !P(signal_fw ,x) 函数是计算x位置处的前向信号光功率 |2mm@):  
  color = blue,     X}?`G?'  
  width = 3, ^8S'=Bk  
  "fw signal" 98u$5=Z' /  
f: P(signal_bw, x),   !P(signal_bw ,x) 函数是计算x位置处的后向信号光功率 l4c9.'6  
  color = blue, 96fzSZS,  
  style = fdashed, STMc@MeZU_  
  width = 3, c`]_Q1'30w  
  "bw signal" m'h`%0Tc  
}K\] M@  
f: 100 * n(x, 2),    !n(x ,2) 函数是计算x位置处激活粒子数在能级2上的占比  M1>< K:  
  yscale = 2,            !第二个y轴的缩放比例 >;Er[Rywr  
  color = magenta, DyiyH%SSD  
  width = 3, (8C ,"Dc[0  
  style = fdashed, Y*-#yG9  
  "n2 (%, right scale)" :BLD &mb"Y  
?3ldHWa  
f: 100 * n(x, 3),          !n(x ,3) 函数是计算x位置处激活粒子数在能级3上的占比 wfH#E2+pk  
  yscale = 2, 7hPiPv  
  color = red, U8_<?Hd  
  width = 3, 8c-r;DE  
  style = fdashed, -eH5s3:A  
  "n3 (%, right scale)" h^E"eC  
BD6oN]  
d+ P<nI/|  
; ------------- Hk'D@(h S  
diagram 2:                    !输出图表2 5 rpX"(  
 5VWyc9Q  
"Variation ofthe Pump Power" k&-SB -  
&)?ECj0`  
x: 0, 10 G }B)bM2  
"pump inputpower (W)", @x s!* m^zx  
y: 0, 10 }G,PUjg_^3  
y2: 0, 100 &S/@i|_  
frame 9 06b=  
hx `Paz   
hy jqULg iC  
legpos 150, 150 APydZ  
R"NR-iU  
f: (set_P_in(pump, x);P_out(signal_fw)), !set_P_in(pump,x)改变泵浦信道功率;P_out(signal_fw)输出前向信号光 &s.S) 'l4l  
  step = 5, .!yXto:  
  color = blue, ]"Y? ZS;H  
  width = 3, Bf37/kkf(  
  "signal output power (W, leftscale)",     !相应的文本字符串标签 6CoDn(+z  
  finish set_P_in(pump, P_pump_in) SJ(<u2J]  
:\I88 -N@'  
f: (set_P_in(pump,x); 100 * n_av(2)),   !改变泵浦信号功率对能级2上激活粒子占比的影响 iYwzdW1  
  yscale = 2, p*F.WxB)4  
  step = 5, xY] Y  
  color = magenta, M`6rI  
  width = 3, V\U,PNkZQ  
  "population of level 2 (%, rightscale)", .wj?}Fr?97  
  finish set_P_in(pump, P_pump_in) <Co\?h/<  
Gt >*y.]  
f: (set_P_in(pump,x); 100 * n_av(3)),   !改变泵浦信号功率对能级3上激活粒子占比的影响 cB,O"-  
  yscale = 2, O}Y& @V%4k  
  step = 5, aj>6q=R  
  color = red, x+niY;Z E  
  width = 3, ~?l>QP|o  
  "population of level 3 (%, rightscale)", WCf?_\cG  
  finish set_P_in(pump, P_pump_in) [T|_J$ ;  
Tf [o'=2  
hzG+s#  
; ------------- @)"= b!q=  
diagram 3:                         !输出图表3 ;JQ:S~K9  
v?\Z4Z|f  
"Variation ofthe Fiber Length" CKoRq|QG_  
qX,T X 3  
x: 0.1, 5 5,H,OZ}  
"fiber length(m)", @x 2y"]rUS`  
y: 0, 10 O7&6]/`  
"opticalpowers (W)", @y $CT 2E  
frame -u!{8S~wA  
hx ){~]-VK  
hy >x /;'Y.  
Pe-1o#7~W  
f: (set_L(x);P_out(signal_fw)),     !改变光纤长度对信号光输出功率的影响 E'_3U5U  
  step = 20,             3<c_`BWu  
  color = blue, zTP|H5HyK  
  width = 3, gaBVD*>  
  "signal output" ~yrEB:w`_  
h!>K[*  
;f: (set_L(x);P_out(pump)),                     !改变光纤长度对泵浦信号输出功率的影响 X:3W9`s )*  
   step = 20, color = red, width = 3,"residual pump" >P-{2 a,4  
Gp&o  
! set_L(L_f) {restore the original fiber length } ak_&\'P  
aJAQ G  
aaa6R|>0  
; ------------- _VvXE572  
diagram 4:                                  !输出图表4 B)^uGS W  
(g>8!Gl  
"TransverseProfiles" 8v|?g8e3  
+;@p'af!9  
I_max :=maxr(I(pump, -1, 0, 0), I(signal_fw, -1, 0, 0)) xfAnZBsVo  
V~tZNR J-  
x: 0, 1.4 * r_co /um C71\9K*X  
"radialposition (µm)", @x oQsls9t  
y: 0, 1.2 * I_max *cm^2 hXF#KVqx  
"intensity (W/ cm&sup2;)", @y `Z)]mH\X  
y2: 0, 1.3 * N_Tm GxFmw:  
frame J%|n^^ /un  
hx [pAW':  
hy KUR9vo  
J ~"h&>T  
f: N_dop(1, x * um,0),      !掺杂浓度的径向分布 PPj_NV  
  yscale = 2, p|q}z/  
  color = gray, Uo D@ix&0  
  width = 3, pb`!_GmB  
  maxconnect = 1, f&ZFG>)6  
  "N_dop (right scale)" :4HZ >!i  
zJxO\  
f: I(pump, -1, x *um, 0) * cm^2,    !泵浦光沿光纤径向的强度分布 liU/O:Ap  
  color = red, 1I^uq>r  
  maxconnect = 1,           !限制图形区域高度,修正为100%的高度 /kK%}L_D  
  width = 3, Zo12F**{  
  "pump" {Xj2c]A1  
= nIl$9  
f: I(signal_fw, -1,x * um, 0) * cm^2,  !信号光沿光纤径向的强度分布 6/4?x)l3-  
  color = blue, 1G6 %?Iph  
  maxconnect = 1, X{-@3tG<r  
  width = 3, 8dBG ZwyET  
  "signal" mW+QJ`3  
&IZthJqV  
8i?Hh?Mf}  
; ------------- $VgazUH% =  
diagram 5:                                  !输出图表5 #0F6{&; M  
s\Zp/-Q  
"TransitionCross-sections" 0Qa kFt  
vwc)d{ND  
I_max :=maxr(I(pump, -1, 0, 0), I(signal_fw, -1, 0, 0)) _7k6hVQ  
I7Uj<a=(q  
x: 1450, 2050 [Y%H8}  
"wavelength(nm)", @x })Pq!u:3  
y: 0, 0.6 >^U$2P  
"cross-sections(1e-24 m&sup2;)", @y S1`;2mAf*  
frame c^%vyBMY  
hx l&2}/A  
hy 'IykIf  
uyfH;9L5$  
f: s12_Tm(x * nm) /1e-24,      !Tm3+吸收截面与波长的关系 `H#G/zOr  
  color = red, 4!3mSWNV  
  width = 3, /-mo8]J#2~  
  "absorption" /4Q^L>a  
f: s21_Tm(x * nm) /1e-24,  !Tm3+发射截面与波长的关系 c}l?x \/  
  color = blue, VvS  ^f  
  width = 3, L'KgB=5K&i  
  "emission" ^kF-mM=  
O! t> @%)  
lileisgsz 2021-09-28 09:47
感谢,视频上有点看不清楚
查看本帖完整版本: [-- RP Fiber Power仿真设计掺铥光纤激光器代码详解 --] [-- top --]

Copyright © 2005-2025 光行天下 蜀ICP备06003254号-1 网站统计