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...

 Respuesta aceptada

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));
interval = [0 200000000];
yInit = 3;
odsefcn = @(t,y)y(1)*(-((1)/((tao_p)+((tao_p*N_s*a)/(V*((1+a*y(1))^2))))))
odsefcn = function_handle with value:
@(t,y)y(1)*(-((1)/((tao_p)+((tao_p*N_s*a)/(V*((1+a*y(1))^2))))))
[tSol,ySol] = ode45(odsefcn,interval,yInit);
plot(tSol,ySol)

3 comentarios

Thnak you so much for your kind support. I have one minor issue. When I try to set the axis limits
% plot(tSol,ySol)
[tSol,ySol] = ode45(odsefcn,interval,yInit);
loglog(tSol,ySol)
ylim([1e-2 1e-11])
xlim([10 1e6])
I get the following error:
Error using ylim (line 31)
Limits must be a 2-element vector of increasing numeric values.
Error in TEST_Outgassing_ode_Matlab_fixed (line 22)
ylim([1e-2 1e-11])
How can I set my time scale ? the time in the actual experiments is upto 150 hours.
Thanks in advance.
Limits must be a 2-element vector of increasing numeric values.
and
1e-2 > 1e-11
Do you see the problem ?
Thats great! I Appreciate your support!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Preguntada:

N/A
el 7 de En. de 2023

Editada:

N/A
el 7 de Feb. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by