資源簡介
被動調Q激光器的MATLAB仿真

代碼片段和文件信息
?function?Qswitch?
?clc?
?clear?
?close?all??
?T0?=?0.7;???%可飽和吸收體初始透射率?
?R?=?0.8;????%輸出鏡反射率?
?Rp?=?2e28;??%抽運速率?
?y0?=?[1;0;1];???%設定初值???
?tspan=[0?0.05];??%設定計算時間范圍??
?tic???
?[ty]?=?ode45(‘rate_eq‘tspany0);%解耦合速率方程組rate_eq(ode23常微分方程的數值求解)
?toc?
?figure??
?subplot(311);?
?plot(ty(:1));??
?axis([0?0.05?0?10^24])?
?xlabel(‘時間(s)‘);???
?ylabel(‘光子數密度(m^{-3})‘);??
?
?subplot(312);??
?plot(ty(:2));?
?axis([0?0.05?0?15*10^24])
?xlabel(‘時間(s)‘);???
?ylabel(‘反轉粒子數密度(m^{-3})‘);?
?
?subplot(313);?
?plot(ty(:3));??
?axis([0?0.05?0?6*10^24])?
?xlabel(‘時間(s)‘);???
?ylabel(‘基態粒子數密度(m^{-3})‘);???
?
?figure??%將光子數密度和反轉粒子數密度隨時間變化畫于同一圖中??
?[AXH1H2]?=?plotyy(ty(:1)ty(:2));??
?set(H2‘Linestyle‘‘--‘)?
?xlabel(‘時間(s)‘)??
?axis([0?0.05?0?10^24])?
?set(get(AX(1)‘Ylabel‘)‘String‘‘光子數密度(m^{-3})‘)?
?set(get(AX(2)‘Ylabel‘)‘String‘‘反轉粒子數密度(m^{-3})‘)?
?
??figure??%將光子數密度和反轉粒子數密度隨時間變化畫于同一圖中??放大看
?[AXH1H2]?=?plotyy(ty(:1)ty(:2));??
?set(H2‘Linestyle‘‘--‘)?
?xlabel(‘時間(s)‘)??
?axis(AX(1)[0.015227190?0.015227192?0?10^24])?;
?axis(AX(2)[0.015227190?0.015227192?0?15*10^24])?
?set(get(AX(1)‘Ylabel‘)‘String‘‘光子數密度(m^{-3})‘)?
?set(get(AX(2)‘Ylabel‘)‘String‘‘反轉粒子數密度(m^{-3})‘)?
?
?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-06-08?16:43??Qswitch\
?????文件????????1422??2017-06-04?20:53??Qswitch\Qswtich.m
?????文件????????1163??2017-06-03?20:18??Qswitch\rate_eq.m
評論
共有 條評論