I am trying to execute the following code
clear all
clc
global mdot mass Ti UA Cp Ts
mdot=0.2;
mass=760;
Cp=2300;
UA=191.66;
Ts=150;
Ti=25;
tspan=[0:10:3000];
T0=25;
[t,T]=ode45(@(t,T) Heatingcoil(t,T,tspan,T0);
disp('Time(sec) Temp(deg cel)');
disp([t,T]);
plot(t,T);
xlabel('Time(sec)');
ylabel('Temp(deg cel)');
title('Time vs Temp');
dT=Heatingcoil(t,T);
global mdot mass Ti UA Cp Ts
dT=(mdot*(Ti-T)+(UA*(Ts-T)/Cp))/mass;
But I am getting the following erros:
Error using feval
Undefined function 'Heatingcoil' for input arguments of type 'double'.
Error in odearguments (line 87)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 113)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, …
Error in heatingwithcoil (line 12)
[t,T]=ode45(@Heatingcoil,tspan,T0);
Please help me in fixing these errors
Best Answer