I got 'NaN'(which is not 'NaN') for my for loop calculation and I found that it was because of 'inf/inf'
Here is my coding. I kinda simplified it for better readability.
Could anyone help me getting r(1), r(2), …..,r(11) for this problem?
When I solved it by hand, r(2) was 160.71
Thank you
>> syms x r>> a=1; b=0; dx=5; t=40;K=10;>> f(x) = a*x+b;>> df(x)=diff(f(x));>> r(1)=inf;>> for i=1:10 r(i+1)=K*int((1+df(x)).^(1/2),x,i,i+dx)+(r(i)*(K*f(i*dx)+t))./(r(i)+(K*f(i*dx)+t)); end>> rr=[ Inf , NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]
Best Answer