我发布的程序:
function dz=film(t,H)
global A eo d e1 ho gr_pn phiup dX Bl Bu
eo=8.85e-12;
e1=2.5;
phiup=20;
gamma=0.048;
nu=1;
A=1.51e-20;
d=100e-9;
lo=1e-9;
ho=20e-9;
lambda=(2*pi*((e1*d)-((e1-1)*ho))^1.5)/(((eo*e1*((e1-1)^2))^0.5)*phiup);
k=(2*pi)/lambda;
grid_l=4*lambda;
grid_l_dmn=grid_l*((0.5*eo*e1*(e1-1)*(phiup^2))^0.5)/((gamma*(ho^3))^0.5);
grid_point=200;
dX=grid_l_dmn/grid_point;
grd_pn=grid_point+1;
size(dX)
grid_point=200;
dX=grid_l_dmn/grid_point;
grd_pn=grid_point+1;
size(dX)
for i= 1 : grd_pn
z(i) = 4 ;
h_initial(i)=ho* sin(k* z(i));
H_initial(i)=h_initial(i)/ho;
end
t=2;
tm_dmn1=t*(0.5*eo*e1*(e1-1)*(phiup^2))/(3*nu*gamma*ho);
grid_time=200;
tm_div=tm_dmn1/grid_time;
tinitial=0;
gr_tme=grid_time+1;
for j=1:gr_tme
tend=tinitial+tm_div;
end
tspan=[tinitial tend];
[t,H]=ode45 ('filmode',tspan,H_initial);
Bl=(((A/(6*pi*(lo^3)))-((0.5*eo*e1(e1-1)*phiup^2)/((e1*d-(e1-1)*lo)^2)))*(lo^9))/8;
Bu=(((A/(6*pi*((d-lo)^3)))-((0.5*eo*e1(e1-1)*phiup^2)/((e1*d-(e1-1)*(d-lo))^2)))*((d-lo)^9))/8;
end
function dHdt=filmode(t,H) %declaring the ode
global A eo d e1 gr_pn ho phiup dX Bl Bu
for i=3:gr_pn-3
Phi(i)=A/(6*pi*(H(i)^3)*(ho^3))-(8*Bl/((H(i)^9)*(ho^9)))+(8*Bu/((d-(H(i)*ho))^9))-((0.5*eo*e1*(e1-1)*(phiup^2))/(((e1*d)-(e1-1)*H(i)*ho)^2));
dHdz(i)=(H(i+1)-H(i-1))/(2*dX);
d3Hdz3(i)=(H(i+2)-(2*H(i+1))+(2*H(i-1))-H(i-2))/(2*(dX^3));
d4Hdz4(i)=(H(i+2)-(4*H(i+1))+(6*H(i))-(4*H(i-1))+H(i-2))/(dX^4);
dPhidz(i)=(Phi(i+1)-Phi(i-1))/(2*dX);
d2Phidz2(i)=(Phi(i+1)-(2*Phi(i))+Phi(i-1))/(dX^2);
dHdt=@(t,H)(3*(H(i)^2)*dHdz(i)*d3Hdz3(i))+((H(i)^3)*d4Hdz4(i))-(3*(H(i)^2)*dHdz(i)*dPhidz(i))- ((H(i)^3)*d2Phidz2(i));
end
end `
当我尝试运行它时出现错误
???使用==>时出错feval 未定义的函数或方法'filmode'用于'double'类型的输入参数。
==>中的错误在110的odearguments f0 = feval(ode,t0,y0,args {:}); %ODE15I将args {1}设置为yp0。
==>中的错误ode45 at 173 [neq,tspan,ntspan,next,t0,tfinal,tdir,y0,f0,odeArgs,odeFcn,...
==>中的错误电影在39 [T,H] = ODE45( 'filmode',TSPAN,H_initial);
这里有一些线程可以通知这种类型的错误但是我无法找到链接,因为这个程序发生了这个错误的原因 如果有人会对此进行调查,我将非常感激,因为这对我来说是非常重要的计划