| 2 | 1/1 | 返回列表 |
| 查看: 972 | 回復(fù): 1 | |||
[交流]
請大神幫忙看下這個程序
|
|
function Pout = fiberlaser_twoend global R1 R2 Ppl Ppr sigma_ap sigma_ep sigma_as sigma_es gamma_s ... gamma_p N alpha_p alpha_s Pssat Ppsat Ppsp Ppsv mu kappa elta %參數(shù)設(shè)置 lambda_s = 1090 * 1e-9; lambda_p = 975 * 1e-9; tau = 1e-3; sigma_ap = 25e-21*1e-4; sigma_ep = 25e-21*1e-4; sigma_as = 1.4e-23*1e-4; sigma_es = 2e-21*1e-4; A_c = 5e-11; N = 4e+025; alpha_p = 3e-5*1e2; alpha_s = 5e-5*1e2; gamma_s = 0.82; gamma_p = 0.0012; R1 =.98; R2 =.04; L = 50; %物理常數(shù)及中間過程參數(shù)計算 c = 3e8; h = 6.626e-34; nu_s = c/lambda_s; nu_p = c/lambda_p; Pssat = h * nu_s * A_c/( gamma_s * (sigma_es+sigma_as) * tau); Ppsat = h * nu_p * A_c/( gamma_p * (sigma_ep+sigma_ap) * tau); %抽運(yùn)光功率設(shè)置 Ppl =1:1:25; Ppr =0; Pout=zeros(1,25); for i=1:25 OPTION = bvpset('Stats','ON'); solinit = bvpinit(linspace(0,L,10),[Ppl(i) Ppr 10 Ppr]); sol = bvp4c(@f,@fsbc,solinit); x = [sol.x]; y = [sol.y]; Pout(i) = y(3,end)*(1-R2); end plot(Ppl,Pout,'r'); grid on; title('Pump and laser powers'); legend('Pp+(z)','Pp-(z)','Ps+(z)','Ps-(z)'); xlabel('Position z (m)'); ylabel('Power (W)'); %端面抽運(yùn)的光纖激光器速率方程組 function dy = f(x,y) global sigma_ap sigma_ep sigma_as sigma_es gamma_s gamma_p N ... alpha_p alpha_s Pssat Ppsat Ppsp Ppsv dy = zeros(4,1); N21=N*(sigma_ap/(sigma_ap+sigma_ep)*(y(1)+y(2))/Ppsat+sigma_as/... (sigma_as+sigma_es)*(y(3)+y(4))/Pssat)/((y(1)+y(2))/Ppsat+... 1+(y(4)+y(3))/Pssat); dy(1)=(-gamma_p*(sigma_ap*N-(sigma_ap+sigma_ep)*N21)-alpha_p)*y(1); dy(2)=-(-gamma_p*(sigma_ap*N-(sigma_ap+sigma_ep)*N21)-alpha_p)*y(2); dy(3)=(gamma_s*((sigma_as+sigma_es)*N21-sigma_as*N)-alpha_s)*y(3); dy(4)=-(gamma_s*((sigma_as+sigma_es)*N21-sigma_as*N)-alpha_s)*y(4); %端面抽運(yùn)的光纖激光器邊界條件 function res = fsbc(y0,yL) global R1 R2 Ppl Ppr res = [y0(1)-Ppl yL(2)-Ppr y0(3)-R1*y0(4) yL(4)-R2*yL(3)]; 老是出錯,清幫忙改一下,謝謝各位啦,初學(xué)者不大會 |
» 搶金幣啦!回帖就可以得到:
+1/180
+2/96
+1/87
+1/84
+1/51
+3/43
+1/40
+1/39
+1/35
+1/16
+1/15
+1/12
+1/9
+1/8
+1/7
+1/4
+1/2
+1/1
+1/1
+1/1
|
??? Error using ==> vertcat CAT arguments dimensions are not consistent. Error in ==> p300_fiberlaser_twoend>fsbc at 67 res = [y0(1)-Ppl Error in ==> bvparguments at 117 testBC = bc(ya,yb,bcExtras{:}); Error in ==> bvp4c at 130 [n,npar,nregions,atol,rtol,Nmax,xyVectorized,printstats] = ... Error in ==> p300_fiberlaser_twoend at 38 sol = bvp4c(@f,@fsbc,solinit); 老是顯示上面的錯誤 |
| 2 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研]
|
2117205181 2026-03-21 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 一志愿華中農(nóng)業(yè)071010,總分320求調(diào)劑 +5 | 困困困困坤坤 2026-03-20 | 6/300 |
|
|
[考研] 269專碩求調(diào)劑 +6 | 金恩貝 2026-03-21 | 6/300 |
|
|
[考研] 一志愿北京化工大學(xué)070300 學(xué)碩336求調(diào)劑 +5 | vv迷 2026-03-21 | 8/400 |
|
|
[考研] 286求調(diào)劑 +10 | Faune 2026-03-21 | 10/500 |
|
|
[考研] 初試 317 +7 | 半拉月丙 2026-03-20 | 7/350 |
|
|
[考研] 求助 +5 | 夢里的無言 2026-03-21 | 6/300 |
|
|
[考研] 0805材料320求調(diào)劑 +3 | 深海物語 2026-03-20 | 3/150 |
|
|
[考研] 279求調(diào)劑 +5 | 紅衣隱官 2026-03-21 | 5/250 |
|
|
[考研] 一志愿南昌大學(xué),327分,材料與化工085600 +9 | Ncdx123456 2026-03-19 | 9/450 |
|
|
[考研] 考研調(diào)劑求學(xué)校推薦 +3 | 伯樂29 2026-03-18 | 5/250 |
|
|
[考研] 材料學(xué)碩297已過四六級求調(diào)劑推薦 +11 | adaie 2026-03-19 | 11/550 |
|
|
[考研] 求調(diào)劑 +3 | @taotao 2026-03-20 | 3/150 |
|
|
[考研] 08工學(xué)調(diào)劑 +5 | 用戶573181 2026-03-20 | 5/250 |
|
|
[考研] 281求調(diào)劑(0805) +14 | 煙汐憶海 2026-03-16 | 25/1250 |
|
|
[考研] 0856調(diào)劑,是學(xué)校就去 +8 | sllhht 2026-03-19 | 9/450 |
|
|
[考研] 本科鄭州大學(xué)物理學(xué)院,一志愿華科070200學(xué)碩,346求調(diào)劑 +4 | 我不是一根蔥 2026-03-18 | 4/200 |
|
|
[考研] 材料專碩306英一數(shù)二 +10 | z1z2z3879 2026-03-16 | 13/650 |
|
|
[考研] 考研求調(diào)劑 +3 | 橘頌. 2026-03-17 | 4/200 |
|
|
[論文投稿] 有沒有大佬發(fā)小論文能帶我個二作 +3 | 增銳漏人 2026-03-17 | 4/200 |
|