mathtype 发表于 2005-11-21 15:44

[求助]请帮我看一下matlab解微分方程组

程序运行出错了
解常微分方程出错
??? Error using ==> KineticSimulate>f
Too many input arguments.

Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ==> ode23s at 188
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

Error in ==> KineticSimulate at 15
=ode23s(@f,,y0,k01,k02,k03,k04,k05,k06,k07,k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12,k13,k14,k15,k16,k17,k18,k19,k20,k21,k22,k23,k24,k25);

谢谢!

MVH 发表于 2005-11-21 15:52

回复:(mathtype)[求助]请帮我看一下matlab解微分方...

附件呢?

mathtype 发表于 2005-11-21 15:55

回复:(paul)回复:(mathtype)[求助]请帮我看一下...

对不起,我重新上传了

kkkttt 发表于 2005-11-21 20:53

回复:(mathtype)[求助]请帮我看一下matlab解微分方...

function KineticSimulate

clear all
clc

format long

y0=;

=ode23s(@f,,y0);
%--------------------------------------------------------------------------
function dydt=f(t,y)

k01=4.598E+04;k02=1.334E+04;k03=4.862E+03;k04=3.788E+02;k05=1.049E+04;k06=1.753E+04;k07=4.198E+05;
Ne=;
k1=5.446E+07; k2=3.126E+05; k3=1.838E+04; k4=2.162E+06; k5=2.974E+01; k6=1.989E+04; k7=4.927E+01; k8=9.391E+00; k9=4.000E+07;
k10=4.550E+01; k11=5.000E+07; k12=1.119E+05; k13=3.137E+04; k14=9.477E+05;k15=2.000E+07; k16=4.000E+07; k17=1.600E+08; k18=1.000E+07;
k19=1.742E+05; k20=2.215E+05; k21=1.406E+06; k22=3.824E+06; k23=4.185E+04; k24=3.041E+03; k25=1.959E+05;

f1=k1*y(7)*y(11)+k3*y(7)*y(3)+k6*y(7)*y(13)-k01*y(1)*Ne-k02*y(1)*Ne-k03*y(1)*Ne-k04*y(1)*Ne-k2*y(1)*y(11)-k4*y(1)*y(13)-k5*y(1)*y(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Ne+k6*y(7)*y(13)+k8*y(9)*y(13)+k20*y(11)*y(13)+k22*y(13)*y(13)+k23*y(11)*y(6)-k5*y(1)*y(12)-k7*y(8)*y(12)-k16*y(9)*y(12)-k18*y(12)*y(13)-k19*y(3)*y(12)-k24*y(5)*y(12);
f13=k7*y(8)*y(12)+k12*y(8)*y(6)+15*y(9)*y(6)+k17*y(11)*y(2)+k19*y(3)*y(12)+k23*y(11)*y(6)+2*k24*y(5)*y(12)-k4*y(1)*y(13)-k6*y(7)*y(13)-k8*y(9)*y(13)-k10*y(8)*y(13)-k18*y(12)*y(13)-k20*y(11)*y(13)-k21*y(13)*y(3)-k22*y(13)*y(13)-k25*y(4)*y(13);
dydt=;

kkkttt 发表于 2005-11-21 20:53

回复:(mathtype)[求助]请帮我看一下matlab解微分方...

y0多了一个数字

现在可以运行但是不知道结果对不对

superliu 发表于 2005-11-26 13:22

这么复杂的程序是怎么编出来的?

mathtype 发表于 2005-11-30 11:20

回复:(angle)回复:(mathtype)[求助]请帮我看一下...

谢谢。按照你的建议,我修改成功了,请密切关注我的下一个问题

mathtype 发表于 2005-11-30 11:29

回复:(angle)回复:(mathtype)[求助]请帮我看一下...

请帮我看一下解数值积分问题,万分感谢!

WF1987 发表于 2011-9-13 19:04

楼主能否帮忙看看我的程序?

ChaChing 发表于 2011-9-14 10:15

回复 9 # WF1987 的帖子

楼主已经五年多没出现了!
页: [1]
查看完整版本: [求助]请帮我看一下matlab解微分方程组