MATLAB Answers

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

12 views (last 30 days)
Taosui Li
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))〗

  6 Comments

Show 3 older comments
Walter Roberson
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.

Sign in to comment.

Answers (1)

Walter Roberson
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.

  4 Comments

Show 1 older comment
Walter Roberson
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
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.

Sign in to comment.

Sign in to answer this question.


Translated by