| 5 | 1/1 | 返回列表 |
| 查看: 3584 | 回復(fù): 10 | |||
| 當(dāng)前只顯示滿(mǎn)足指定條件的回帖,點(diǎn)擊這里查看本話(huà)題的所有回帖 | |||
shidoudou新蟲(chóng) (初入文壇)
|
[求助]
matlab 求指點(diǎn) 動(dòng)力學(xué)方程擬合過(guò)程中導(dǎo)數(shù)的獲取
|
||
|
本人matlab不通,勉強(qiáng)做了一個(gè)程序能夠達(dá)到預(yù)期目的,可是老師想要中間運(yùn)算的導(dǎo)數(shù)值,也就是dxdt的值,不知道如何填補(bǔ)表達(dá)式實(shí)現(xiàn),望各位高手出手相助,不勝感激。 主程序: format short global Umax Ks Kp Y1 Y2 Uo Ko D Ux Kx Ku Ki; Ki=0.0001;Ku=0.0006; k0=[0.2 0.5 0.1 10 10 0.01 0.01 0.1 0.01 0.01]; %參數(shù)的初始值 x0=[0.0514 0.250 0]; %菌體濃度、底物濃度和產(chǎn)物濃度的初始值 t1=[0 6 12 18 24 30 36 42 48 54 60 66]';%發(fā)酵時(shí)間的實(shí)驗(yàn)數(shù)據(jù) tspan=[0 6 12 18 24 30 36 42 48 54 60 66 ]';%時(shí)間間隔 %yexp實(shí)驗(yàn)數(shù)據(jù)[菌體濃度x1、底物濃度x2和產(chǎn)物濃度x3] yexp=[[0.0514 0.0711 0.0997 0.1887 0.3478 0.6634 0.8711 1.1023 1.2336 1.4239 1.5849 1.6739];[0.25 0.2447 0.2366 0.2258 0.2196 0.203 0.1872 0.1698 0.1453 0.1124 0.0855 0.0608];[0 0.0012 0.0021 0.0039 0.0088 0.0137 0.0183 0.0268 0.0361 0.0438 0.0557 0.0643]]'; lb=[0 0 0 0 0 0.0216 0.001 0 0.001 0.001];ub=[1 10 10 50 50 2 1 1 0.1 0.1];%參數(shù)的下、上限 [k,resnorm,residual,exitflag,output,lambda,jacobian]=lsqnonlin(@ObjFunc4LNL103,k0,lb,ub,[],x0,yexp);%非線性擬合 y1=[yexp(:,1)];y2=[yexp(:,2)];y3=[yexp(:,3)]'; [t4plot,x4plot]=ode45(@kineticseqs103,[0 100],x0,[],k); plot(t1,y1,'b*',t4plot,x4plot(:,1),'k-'),xlabel('T(h)'),ylabel('Cx/(g/L)'); figure plot(t1,y2,'g*',t4plot,x4plot(:,2),'k-'),xlabel('T(h)'),ylabel('Cs/(mmol/L)'); figure plot(t1,y3,'r*',t4plot,x4plot(:,3),'k-'),xlabel('T(h)'),ylabel('Cp/(mmol/L)'); disp(k) 子程序: 1) function f=ObjFunc4LNL103(k,x0,yexp) tspan=[0 6 12 18 24 30 36 42 48 54 60 66]; [t1,x]=ode45(@kineticseqs103,tspan,x0,[],k); y(:,1)=x(:,1);y(:,2)=x(:,2);y(:,3)=x(:,3); f1=y(: ,1)-yexp(: ,1);f2=y(: ,2)-yexp(: ,2);f3=y(: ,3)-yexp(: ,3); f=[f1*1 f2*5 f3*10]; 2) function dxdt=kineticseqs103(t,x,k) %模型方程 global Umax Ks Kp Y1 Y2 Uo Ko D Ux Kx Ku Ki Umax=k(1); Ks=k(2); Kp=k(3); Y1=k(4); Y2=k(5); Ux=k(6); Kx=k(7); D=k(8); Uo=k(9); Ko=k(10); dxdt1=Umax*x(2)*x(1)*(1-Kp*x(3))/(Ks+x(2)); if dxdt1<0 dxdt1=0; end dxdt2=-1/Y1*dxdt1-Ux*x(2)*x(1)/(Kx+x(2))*(Ki/(Ki+x(3))); dxdt3=D*(-dxdt2-1/Y2*dxdt1-Uo*x(2)*x(1)/(Ko+x(2))*(Ku/(Ku+x(3)))); if dxdt3<0 dxdt3=0; end dxdt=[dxdt1;dxdt2;dxdt3]; 只要能顯示對(duì)應(yīng)時(shí)間t1,這些點(diǎn)的dxdt值就可以了。謝謝 |
matlab |
新蟲(chóng) (初入文壇)
鐵桿木蟲(chóng) (職業(yè)作家)
新蟲(chóng) (初入文壇)
送鮮花一朵 |
非常感謝您哈。 我的本來(lái)的目的就是,建立了 微生物發(fā)酵的動(dòng)力學(xué)方程,是三個(gè)微分方程,然后利用實(shí)驗(yàn)所得的數(shù)據(jù)就是yexp那組數(shù)據(jù),非線性擬合微分方程里面的參數(shù)即可,以上的程序可以實(shí)現(xiàn)這個(gè)了?墒,老師讓我能夠顯示這三個(gè)微分方程在對(duì)應(yīng)的時(shí)間點(diǎn)t1那幾個(gè)點(diǎn)處的導(dǎo)數(shù)值,我就不知道怎么樣加語(yǔ)句了。不知道我表達(dá)清楚了沒(méi)有~ |
實(shí)習(xí)版主 (著名寫(xiě)手)
DOE鍋爐工

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 本科新能源科學(xué)與工程,一志愿華理能動(dòng)285求調(diào)劑 +3 | AZMK 2026-03-28 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 283求調(diào)劑 +3 | A child 2026-03-28 | 3/150 |
|
|
[考研] 070300求調(diào)劑306分 +4 | 26要上岸 2026-03-27 | 4/200 |
|
|
[考研] 081200-314 +3 | LILIQQ 2026-03-27 | 4/200 |
|
|
[考研]
|
孅華 2026-03-22 | 17/850 |
|
|
[考研] 308求調(diào)劑 +7 | 墨墨漠 2026-03-27 | 7/350 |
|
|
[考研] 07化學(xué)280分求調(diào)劑 +10 | 722865 2026-03-23 | 10/500 |
|
|
[考博] 26申博 +3 | 加油沖! 2026-03-26 | 3/150 |
|
|
[考研] 085600,材料與化工321分調(diào)劑 +4 | 大饞小子 2026-03-27 | 6/300 |
|
|
[考研] 324求調(diào)劑 +8 | hanamiko 2026-03-26 | 10/500 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +4 | 崔wj 2026-03-26 | 4/200 |
|
|
[考研] 化學(xué)工程085602 305分求調(diào)劑 +17 | RichLi_ 2026-03-25 | 17/850 |
|
|
[考研] 085601求調(diào)劑總分293英一數(shù)二 +4 | 鋼鐵大炮 2026-03-24 | 4/200 |
|
|
[考研] 07化學(xué)303求調(diào)劑 +5 | 睿08 2026-03-25 | 5/250 |
|
|
[考研] 0854電子信息求調(diào)劑 324 +4 | Promise-jyl 2026-03-23 | 4/200 |
|
|
[考研] 318求調(diào)劑 +5 | plum李子 2026-03-21 | 8/400 |
|
|
[考研] 340求調(diào)劑 +5 | 話(huà)梅糖111 2026-03-24 | 5/250 |
|
|
[考研] 300求調(diào)劑,材料科學(xué)英一數(shù)二 +5 | leaflight 2026-03-24 | 5/250 |
|
|
[考研] 284求調(diào)劑 +3 | yanzhixue111 2026-03-23 | 6/300 |
|
|
[考研] 求老師收我 +3 | zzh16938784 2026-03-23 | 3/150 |
|