| 2 | 1/1 | 返回列表 |
| 查看: 973 | 回復(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); %抽運光功率設(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)'); %端面抽運的光纖激光器速率方程組 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); %端面抽運的光纖激光器邊界條件 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)]; 老是出錯,清幫忙改一下,謝謝各位啦,初學者不大會 |
» 搶金幣啦!回帖就可以得到:
+2/140
+1/85
+1/84
+1/80
+1/72
+2/42
+2/38
+1/35
+1/31
+1/19
+1/17
+1/14
+1/9
+1/9
+2/8
+1/8
+1/6
+1/3
+1/2
+1/2
|
??? 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ā)表 | |
|---|---|---|---|---|
|
[考研] 287求調(diào)劑 +8 | 晨昏線與星海 2026-03-19 | 9/450 |
|
|---|---|---|---|---|
|
[考研] 289求調(diào)劑 +7 | 懷瑾握瑜l 2026-03-20 | 7/350 |
|
|
[考研] 305分求調(diào)劑(食品工程) +4 | Sxy112 2026-03-21 | 6/300 |
|
|
[考研] 求調(diào)劑院校信息 +6 | CX 330 2026-03-21 | 6/300 |
|
|
[考研] 資源與環(huán)境 調(diào)劑申請(333分) +5 | holy J 2026-03-21 | 5/250 |
|
|
[考研] 0703化學調(diào)劑 +4 | 妮妮ninicgb 2026-03-21 | 4/200 |
|
|
[考研] 工科0856求調(diào)劑 +3 | 沐析汀汀 2026-03-21 | 3/150 |
|
|
[考研] 336求調(diào)劑 +5 | rmc8866 2026-03-21 | 5/250 |
|
|
[考研] 268求調(diào)劑 +9 | 簡單點0 2026-03-17 | 9/450 |
|
|
[考研] 346求調(diào)劑[0856] +4 | WayneLim327 2026-03-16 | 7/350 |
|
|
[考研] 一志愿山大07化學 332分 四六級已過 本科山東雙非 求調(diào)劑! +3 | 不想理你 2026-03-16 | 3/150 |
|
|
[考研] 303求調(diào)劑 +5 | 睿08 2026-03-17 | 7/350 |
|
|
[考研] 304求調(diào)劑 +7 | 司空. 2026-03-18 | 7/350 |
|
|
[考研] 350求調(diào)劑 +5 | weudhdk 2026-03-19 | 5/250 |
|
|
[考研] 求調(diào)劑 +3 | @taotao 2026-03-20 | 3/150 |
|
|
[考研] 環(huán)境工程調(diào)劑 +9 | 大可digkids 2026-03-16 | 9/450 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +7 | 困于星晨 2026-03-17 | 9/450 |
|
|
[考研] 一志愿中國海洋大學,生物學,301分,求調(diào)劑 +5 | 1孫悟空 2026-03-17 | 6/300 |
|
|
[考研] 0703化學調(diào)劑 +4 | 18889395102 2026-03-18 | 4/200 |
|
|
[考研] 有沒有道鐵/土木的想調(diào)劑南林,給自己招師弟中~ +3 | TqlXswl 2026-03-16 | 7/350 |
|