I have the two m files given below. "a" and "T" are returned as complex with the coefficient of the complex part being zero (the real part gives the correct answer and hence the plot is fine) . Also dadT is becoming complex.
Why are values becoming complex?
Jeff _______________________________ %this is in file alpha.m function dadT = alpha(T,a) b = 20 l= 50.1 k=exp(l) ner = -36108.73 n=1.269 dadT = (k/b)*(exp(ner/T)) *((1-a)^n ________________________________________
%this is in file alpha_ode45.m clear T0 = 0.00255 Tspan = [653.25,773] [T,a] = ode45(@alpha,Tspan,T0);
% Print display in command window disp('Solution, T and alpha') format short [T a]
% plot a vs T plot(T,a) axis([600 800 0 1]) ____________________________