湖泊有机物新陈代谢模型问题
%微分方程组求解主程序clc;clear all;clf;close all;
%微分方程组求解主程序
clc;clear all;clf;close all;
%windows时钟自动计时
T1=clock; %函数clock返回的值是clock=
disp('计算机正在准备输出湖泊有机物新陈代谢结果,请耐心等待······');
=ode45('lbwfun',,);
t=tt(191:end,:)
ys=(191:end,1)
yp=(191:end,2)
yh=(191:end,3)
yr=(191:end,4)
yo=(191:end,5)
ye=(191:end,6)
T2=clock;
API_elapsed_time=T2-T1;
if API_elapsed_time(6)<0
API_elapsed_time(6)=API_elapsed_time(6)+60;
API_elapsed_time(5)=API_elapsed_time(5)-1;
end
if API_elapsed_time(4)<0
API_elapsed_time(4)=API_elapsed_time(4)+60;
API_elapsed_time(4)=API_elapsed_time(4)-1;
end
str=sprintf('湖泊新陈代谢模拟程序共运行 %d 小时 %d 分钟 %.4f 秒',```
API_elapsed_time(4),API_elapsed_time(5),API_elapsed_time(6));
disp(str);
%子函数:微分方程组odefile文件并命名为lbwfun.m
function ydot=lbwfun(t,y);
ydot=[121.793*pi*cos(2*pi*t);
y(1)-4.03*y(2);
0.48*y(2)-17.87*y(3);
4.85*y(3)-4.65*y(4);
2.55*y(2)+6.12*y(3)+1.95*y(4);
1.10*y(2)+6.90*y(3)+2.70*y(4)];
运行结果(我是按书上写出来的程序)
计算机正在准备输出湖泊有机物新陈代谢结果,请耐心等待······
??? Error using ==> feval
Undefined function or method 'lbwfun' for input arguments of type 'double'.
Error in ==> odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode45 at 173
页:
[1]