小火龙果 |
2020-05-28 16:28 |
RP Fiber Power仿真设计掺铥光纤激光器代码详解
(* 3^p<Wx Demo for program"RP Fiber Power": thulium-doped fiber laser, xEv]VL: pumped at 790 nm. Across-relaxation process allows for efficient .xJW=G{/ population of theupper laser level. cQ kH4>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.SGm 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 Wi 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 HJFt{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); !后向信号光信道 hrfu\cI set_R(signal_fw, 1, R_oc); !设置反射率函数 $umh&z/ finish_fiber(); )vH6N _ end; r>fx55dw 5<o8prtB ; Display someoutputs in the Output window (on the right side): !在Output aera区域显示输出 aA Hx^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}pi 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" !相应的文本字符串标签 _jmkA meu 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, -e H5s3:A "n3 (%, right scale)" h^E"eC BD6oN] d+ P<nI/| ; ------------- Hk'D@(hS 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 906b= hx `Pa z 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,TX
3 x: 0.1, 5 5,H,OZ} "fiber length(m)", @x 2y"]rUS` y: 0, 10 O7& | |