| 3 | 1/1 | 返回列表 |
| 查看: 568 | 回復(fù): 2 | ||||
[交流]
用1stopt擬合動力學(xué)方程參數(shù)無法運行,新手不懂如何調(diào)試,請求各位高手幫忙,謝謝! 已有2人參與
|
|
程序是利用龍格庫塔法模擬動力學(xué)方程的相關(guān)參數(shù),我用低版本的軟件運行的時候一直報錯,一直無法運行,提示我的編寫有問題,菜鳥不太懂,希望各位大神幫忙指正,謝謝啦。 下面是程序代碼: Title "cyclohexanone"; Parameters k1,E1,k2,E2,kA,EA,kH2,EH2,kCNE,ECNE,kCOL,ECOL,DEN; Variable V0,PP,TT,yAin,yH2in,yArin,yCNEin,yCOLin; Variable yCNE[Output],yCOL[Output]; StartProgram [VB]; Dim iter As Integer Dim N0 As Double Dim RK_i As Integer Dim h As Double Dim i As Integer dim j As Integer dim c As Double dim DM As Double dim RCNE As Double dim RCOL As Double dim yAr As Double dim yA As Double dim yCNE As Double dim yH2 As Double dim yCOL As Double Dim KT1 As Double dim KT2 As Double dim KA As Double dim KH2 As Double dim KCNE As Double dim KCOL As Double Dim T As Double Dim BB As Double Dim pH2 As Double dim pCOL As Double dim pCNE As Double dim pA As Double Dim Y_Y01 As Double Dim Y_Y02 As Double Dim Y_Y03 As Double dim y_y1 As Double dim y_y2 As Double dim y_y3 As Double Dim x_x1 As Double Dim x_x2 As Double Dim x_x3 As Double dim d_d1 As Double dim d_d2 As Double dim d_d3 As Double dim e_e1 As Double dim e_e2 As Double dim e_e3 As Double dim e_e4 As Double dim e_e5 As Double for iter=0 to Datalength-1 N0=V0(iter) h=0.35/20 Y_Y01=yCNEin(iter) Y_Y02=yCOLin(iter) Y_Y03=0 For RK_i=1 to 20 e_e1=0.5 e_e2=0.5 e_e3=1 e_e4=1 e_e5=0.5 x_x1=Y_Y01 x_x2=Y_Y02 x_x3=Y_Y03 y_y1=Y_Y01 y_y2=Y_Y02 y_y3=Y_Y03 For j=1 To 4 yCNE=x_x1 yCOL=x_x2 BB=(1+2*yA)/(1+2*yAin(iter)) yA=BB*(yAin(iter)+yCNEin(iter))-yCNE yH2=BB*(yH2in(iter)+yCOLin(iter)+2yCNEin(iter))-2yCNE-yCOL yAr=BB*yArin(iter) T=TT(iter)+273.15 pA=PP(iter)*yA pH2=PP(iter)*yH2 pCNE=PP(iter)*yCNE pCOL=PP(iter)*yCOL KT1=k1*Exp(-E1/(8.315*T)) KT2=k2*Exp(-E2/(8.315*T)) KA=kA*Exp(-EA/(8.315*T)) KH2=kH2*Exp(-EH2/(8.315*T)) KCNE=kCNE*Exp(-ECNE/(8.315*T)) KCOL=kCOL*Exp(-ECOL/(8.315*T)) DEN=1+KA*PA+KH2*PH2+KCNE*PCNE+KCOL*PCOL RCNE=(KT1*KA*PA*(KH2*PH2)^2)/(DEN^3) RCOL=(KT2*KCNE*PCNE*KH2*PH2)/(DEN^2) DM=(1+2*yCNE)/(N0*(1+2*yCNEin(iter))) d_d1=DM*(1+2*yCNE)*RCNE d_d2=DM*(RCOL+2*yCOL*RCNE) d_d3=1 c=h*d_d1 if j=1 then x_x1=Y_Y01+e_e1*c y_y1=y_y1+e_e2*c/3 elseif j=2 then x_x1=Y_Y01+e_e2*c y_y1=y_y1+e_e3*c/3 elseif j=3 then x_x1=Y_Y01+e_e3*c y_y1=y_y1+e_e4*c/3 elseif j=4 then x_x1=Y_Y01+e_e4*c y_y1=y_y1+e_e5*c/3 end if c=h*d_d2 if j=1 then x_x2=Y_Y02+e_e1*c y_y2=y_y2+e_e2*c/3 elseif j=2 then x_x2=Y_Y02+e_e2*c y_y2=y_y2+e_e3*c/3 elseif j=3 then x_x2=Y_Y02+e_e3*c y_y2=y_y2+e_e4*c/3 elseif j=4 then x_x2=Y_Y02+e_e4*c y_y2=y_y2+e_e5*c/3 end if c=h*d_d3 if j=1 then x_x3=Y_Y03+e_e1*c y_y3=y_y3+e_e2*c/3 elseif j=2 then x_x3=Y_Y03+e_e2*c y_y3=y_y3+e_e3*c/3 elseif j=3 then x_x3=Y_Y03+e_e3*c y_y3=y_y3+e_e4*c/3 elseif j=4 then x_x3=Y_Y03+e_e4*c y_y3=y_y3+e_e5*c/3 end if Next Y_Y01=y_y1 Y_Y02=y_y2 Y_Y03=y_y3 Next yCNE(iter)=y_y1 yCOL(iter)=y_y2 Next EndProgram; Data; 4.06 0.2 120 0.113 0.788 0.099 0.0001 0.0001 0.00796539 7.23E-05 2.03 0.2 120 0.114 0.787 0.099 0.0001 0.0001 0.018276944 0.000165986 1.02 0.2 120 0.117 0.784 0.099 0.0001 0.0001 0.027001782 0.000272745 1.02 0.2 120 0.115 0.786 0.099 0.0001 0.0001 0.028928857 0.000292211 0.51 0.2 120 0.114 0.787 0.099 0.0001 0.0001 0.05419921 0.000602822 1.66 0.2 141 0.133 0.771 0.096 0.0001 0.0001 0.024173136 0.000244173 4.07 0.2 140 0.115 0.787 0.098 0.0001 0.0001 0.018688673 0.000169726 2.04 0.2 140 0.117 0.785 0.098 0.0001 0.0001 0.041576064 0.00041996 1.03 0.2 140 0.127 0.775 0.098 0.0001 0.0001 0.077775178 0.001668313 1.03 0.2 140 0.12 0.781 0.099 0.0001 0.0001 0.067879227 0.000824444 0.52 0.2 141 0.125 0.777 0.098 0.0001 0.0001 0.124489331 0.002152918 4.46 0.2 162 0.122 0.776 0.102 0.0001 0.0001 0.011771229 9.49E-05 3.32 0.2 162 0.121 0.774 0.105 0.0001 0.0001 0.016481008 0.000149676 1.66 0.2 162 0.133 0.771 0.096 0.0001 0.0001 0.039389391 0.000397873 4.08 0.2 161 0.117 0.784 0.099 0.0001 0.0001 0.035950835 0.000326496 2.05 0.2 161 0.12 0.781 0.099 0.0001 0.0001 0.071190475 0.000791805 1.04 0.2 161 0.137 0.766 0.097 0.0001 0.0001 0.137103964 0.002229333 1.04 0.2 161 0.132 0.771 0.097 0.0001 0.0001 0.134541091 0.00218766 4.45 0.2 182 0.119 0.778 0.103 0.0001 0.0001 0.018492489 0.000149133 3.32 0.2 182 0.122 0.772 0.106 0.0001 0.0001 0.029740384 0.000270094 1.66 0.2 182 0.13 0.773 0.097 0.0001 0.0001 0.060335598 0.000671073 4.09 0.2 181 0.12 0.782 0.098 0.0001 0.0001 0.058478171 0.000590689 2.06 0.2 181 0.126 0.777 0.097 0.0001 0.0001 0.107592821 0.001527687 1.05 0.2 181 0.141 0.763 0.096 0.0001 0.0001 0.186241228 0.006156735 1.05 0.2 182 0.142 0.762 0.096 0.0001 0.0001 0.183768277 0.005488445 1.04 0.2 181 0.138 0.766 0.096 0.0001 0.0001 0.179658491 0.005747588 1.04 0.2 182 0.136 0.767 0.097 0.0001 0.0001 0.176490707 0.005458475 文件中是我需要模擬的動力學(xué)方程 |
新蟲
![]() |
專家經(jīng)驗: +1059 |

無蟲
![]() |
專家經(jīng)驗: +65 |

| 3 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 271求調(diào)劑 +10 | 勒布朗@ 2026-03-31 | 12/600 |
|
|---|---|---|---|---|
|
[考研] 322求調(diào)劑 +3 | 三水sss 2026-04-01 | 3/150 |
|
|
[考研] 材料專碩306英一數(shù)二 +3 | z1z2z3879 2026-03-31 | 3/150 |
|
|
[考研] 08工科,295,接受跨專業(yè)調(diào)劑 +6 | lmnlzy 2026-03-30 | 6/300 |
|
|
[考研] 英一數(shù)一408,總分284,二戰(zhàn)真誠求調(diào)劑 +3 | 12.27 2026-03-30 | 5/250 |
|
|
[考研] 085601材料工程找調(diào)劑 +17 | oatmealR 2026-03-29 | 18/900 |
|
|
[考研] 322求調(diào)劑 +10 | 宋明欣 2026-03-27 | 10/500 |
|
|
[考研] 0703化學(xué)求調(diào)劑 +6 | 丹青奶蓋 2026-03-26 | 8/400 |
|
|
[考研] 一志愿南開大學(xué)0710生物學(xué)359求調(diào)劑 +5 | 兔兔兔111223314 2026-03-29 | 7/350 |
|
|
[考研] 329求調(diào)劑 +8 | 星野? 2026-03-26 | 8/400 |
|
|
[考研] 考研調(diào)劑 +5 | Sanmu-124 2026-03-26 | 5/250 |
|
|
[考研] 一志愿北京工業(yè)大學(xué),324分求調(diào)劑 +6 | 零八# 2026-03-28 | 6/300 |
|
|
[考研] 070305高分子化學(xué)與物理 304分求調(diào)劑 +12 | c297914 2026-03-28 | 12/600 |
|
|
[考研] 327求調(diào)劑 +6 | 汲亦昊 2026-03-29 | 6/300 |
|
|
[考研] 086000生物與醫(yī)藥調(diào)劑 +5 | Feisty。 2026-03-28 | 9/450 |
|
|
[考研] 332求92調(diào)劑 +8 | 蕉蕉123 2026-03-28 | 8/400 |
|
|
[考研] 316求調(diào)劑 +7 | 江辭666 2026-03-26 | 7/350 |
|
|
[考研] 本科新能源科學(xué)與工程,一志愿華理能動285求調(diào)劑 +3 | AZMK 2026-03-27 | 5/250 |
|
|
[考研] 一志愿吉大071010,316分求調(diào)劑 +3 | xgbiknn 2026-03-27 | 3/150 |
|
|
[考研] 347求調(diào)劑 +4 | L when 2026-03-25 | 4/200 |
|