matlab程序求助(有关ode45解微分方程的)主程序:for T1=0:0.01:250% dynamic concentration equation tspan=[T1,T1+0.01];y0=ci;[t,y]=ode45(@initiatorc,tspan,y0); % solve the initiator concentrationXci=y(end);调用的函数:function dy
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 18:04:13
matlab程序求助(有关ode45解微分方程的)主程序:for T1=0:0.01:250% dynamic concentration equation tspan=[T1,T1+0.01];y0=ci;[t,y]=ode45(@initiatorc,tspan,y0); % solve the initiator concentrationXci=y(end);调用的函数:function dy
matlab程序求助(有关ode45解微分方程的)
主程序:
for T1=0:0.01:250
% dynamic concentration equation
tspan=[T1,T1+0.01];
y0=ci;
[t,y]=ode45(@initiatorc,tspan,y0); % solve the initiator concentration
Xci=y(end);
调用的函数:
function dydt = initiatorc( t,y )
%INITIATORC Summary of this function goes here
% Detailed explanation goes here
global K V F ci
dydt=((ci-y)*F/V)-K(1)*y;
end
结果:
Error using ==> odearguments at 116
Solving INITIATORC requires an initial condition vector of length 1.
Error in ==> ode45 at 173
[neq,tspan,ntspan,next,t0,tfinal,tdir,y0,f0,odeArgs,odeFcn,...
Error in ==> mma at 66
[t,y]=ode45(@initiatorc,tspan,y0); % solve the initiator concentration
希望大神帮我看看 本人MATLAB小白一枚 求大家耐心指导 感激不尽
matlab程序求助(有关ode45解微分方程的)主程序:for T1=0:0.01:250% dynamic concentration equation tspan=[T1,T1+0.01];y0=ci;[t,y]=ode45(@initiatorc,tspan,y0); % solve the initiator concentrationXci=y(end);调用的函数:function dy
从结果来看,你把一个数组赋给了y0
检查看看是不是ci的问题