Check for missing argument or incorrect argument data type in call to function 'int'.
Show older comments
I have an issue with performing ode45 when my function has an integral. I wish to integrate a function with one of my input variables defined for my function, but Matlab wants me to use syms to define the variable. Is there a way I can work around this issue? Any help is appreciated and thank you for your time.
function g = odefunction(t,p)
T = p(1); C = p(2);
Cp = (3.5*8.314)+(((1200/T)^2)*8.314*exp(1200/T)/((exp(1200/T)-1)^2));
Q = int(Cp,[298 T]); %Error message on this line
dTdt = ((10*Q)+(1000*(4.518*10^-8*exp(-100/(8.314*T)))))/100;
dCdt = 4-C+(4.518*10^-8*exp(-100/(8.314*T)));
g = [dTdt; dCdt];
%Script
tspan = [0 24];
initial = [298 5];
[t p] = ode45(@odefunction,tspan,initial);
Accepted Answer
More Answers (0)
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!