Error When Using ODE45 to solve symbolic ODE Equation : Too many input arguments.
显示 更早的评论
Hi All,
I'm trying to solve the equation below. But when I tried to solve the equtioon I keep reciveing the error "Too Many Input Arguments". I'm not sure what I'm doing wrong.
syms p(t)
s = 1;
N_s = 3e15;
V = 16.7;
S = 4.6;
tao_p = 3.6;
tao_0 = 10e-13;
v=4.82e20;
R=8.31;
T=295;
Ed = 25;
a = ((s*v*tao_0)/(N_s))*exp((Ed)/(R*T));
ode = diff(p)*(1/p) == -((1)/((tao_p)+((tao_p*N_s*a)/(V*((1+a*p)^2)))));
cond = p(0) == 3;
pSol(t) = dsolve(ode,cond)
pp = odeToVectorField(ode);
odsefcn = matlabFunction(pp)
interval = [0 2000];
yInit = [3];
ySol = ode45(odsefcn,interval,yInit);
tValues = linspace(0,20,100);
yValues = deval(ySol,tValues,1);
plot(tValues,yValues)
Thanks in advance...
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
