How to solve these ode45 errors?
Mostrar comentarios más antiguos
Greetings
I'm trying to solve some problems of thermal systems in matlab (we only care about ODEs of course)
So I've created two files with their own code, one for the functions and parameters and the other for the ode45
My error messages:
??? Error using ==> odearguments at 101
THERMEX22 must return a column vector.
Error in ==> ode45 at 172
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in ==> thermex22sol at 3
[t,A] = ode45('thermex22',[0 100],[300;300]);
The functions & parameters code:
function att2 = thermex22(t,A)
c1 = 1e3;
c2 = 2e3;
r1 = 2.5e-3;
r2 = 1.5e-3;
a = 300;
b = 1500;
q1o = (1/r1) * (A(1) - A(2));
q2i = (1/r1) * (A(1) - A(2));
q2o = (1/r2) * (A(2) - a);
Eq1 = (1/c1) * (b - q1o);
Eq2 = (1/c2) * (q2i - q2o);
att2 = [Eq1 , Eq2];
The ode45 code:
clc
clear
[t,A] = ode45('thermex22',[0 100],[300;300]);
plot(t,A);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!