# Translating sigma notation / summation / series and integral equation from Microsoft Word into MATLAB syntax and graphing / plotting

12 views (last 30 days)
Taosui Li on 20 Aug 2019
Commented: Taosui Li on 21 Aug 2019
Hello everybody,
I have a little trouble here. I trying to graph/plot the following equation with MATLAB. I already solved the integral of this equation:
f(t)=0.111627907+∑_(n=1)^∞▒〖(1/430 ∫_0^50▒〖((-0.000003072(t-25)^4+1.2) cos⁡(2nπt/860) )dt(nπt/430))〗〗+∑_(n=1)^∞▒〖(1/430 ∫_0^50▒〖((-0.000003072(t-25)^4+1.2 ) sin⁡(2nπt/860) )dt(nπt/430))〗〗
f(t)=0.111627907+∑_(n=1)^∞▒(1/430 1/((π)^4 n^4 ) (-177504/5 (π)^2 n^2+7876917504/125)+1(π)^5 n^5 (-177504/625 (-6450(π)^2 n^2+3816336) sin⁡(5/43 πn)-17750462/5 (125(π)^3 n^3-221880πn) cos⁡(5/43 πn) )(nπt/430)) +∑_(n=1)^∞▒〖(1/430 1/((π)^5 n^5 )(45796032/25 (π)^2 n^2-677414905344/625)+1/((π)^5 n^5 )(-177504/625 (6450(π)^2 n^2-3816336)cos(5/43 πn)-177504/625 (125(π)^3 n^3-221880πn)sin(5/43 πn)(nπt/430))〗

Walter Roberson on 20 Aug 2019
Why do you have 1/430 before each of the integrals, and then multiply the result of the integral by (n*pi*t/430) ? It is strange that you have two divisions by 430 there. Please check your equations, as I suspect there should be only one of them.
Walter Roberson on 21 Aug 2019
You are defining f(t) so t is certainly a parameter of f.
Taosui Li on 21 Aug 2019
Sorry, I mean t is a parameter of f.

Walter Roberson on 20 Aug 2019
syms n t
Q = @(v) sym(v); %convert to rational
Pi = sym('pi');
f1 = Q(0.111627907);
f2a = int((Q(-0.3072*10^(-5))*(t - 25)^4 + Q(1.2))*cos((2*n*Pi*t)/860), t, 0, 50)
f2 = symsum(1/430*f2a*n*Pi*t/430, n, 1, inf)
f3a = int((Q(-0.3072*10^(-5))*(t - 25)^4 + Q(1.2))*sin((2*n*Pi*t)/860), t, 0, 50)
f3 = symsum(1/430*f3a*n*Pi*t/430, n, 1, inf)
f(t) = f1 + f2 + f3;
However, f2 returns NaN. Tracing in a different package, the computation does look suspicious.

Show 1 older comment
Walter Roberson on 21 Aug 2019
When I check for any given numeric value in a different software package, the result I get is -inf for each of the input values I tried. What is the expected range of t for f(t) ?
Walter Roberson on 21 Aug 2019
When I did some investigation, I could see that in at least one way of writing the formulas you could end up with a partial term of -inf*(A-1) for some formula A. Under the circumstances it was probably reasonable to work out that A-1 would be positive, giving you -inf as a result. But if you expand then you get -inf*A -inf*(-1) and that leads you to -inf + inf for positive A and that is NaN. It is not exactly wrong, but it is a limitation on the analysis.
Taosui Li on 21 Aug 2019
Thank you very much.
I try to do more research on why a negative infinity is returned.