how to write a series over one of the variables??

조회 수: 2 (최근 30일)
Omidreza Ghafarinejad
Omidreza Ghafarinejad 2015년 5월 15일
댓글: Walter Roberson 2015년 5월 16일
hi friends. I am writing a code to solve a mathematics problem. I have an expression which includes several variables. I should write the series of this expression over one of the variables and then assign variables using subs function. My code is here:
syms x y L n real
assume(n,'integer');
f=1000; h=0.5;
beta=n*pi/L;
J=h^3/12;
Q=dirac(x)*f;
q1=int(Q*cos(n*pi*x/L),x,-L,L)/L;
sigmax_cosine=-(q1*cos(beta*x)*(2*cosh((beta*(h+2*y))/2)-2*cosh((beta*(3*h-2*y))/2)+2*beta...
sigmax_tot=symsum(sigmax_cosine,n,1,Inf);
I must mention that this series is derived from Fourier series of "Q" and after this series I should assign variables (L,x,y) by subs function. The problem is that it doesn't give me the right answer. and also when I type this:
subs(sigmax_tot,[x y L],[0 0.25 2])
It gives me 3050 but when I type:
subs(sigmax_tot,[x y L],[0 -0.25 2])
The answer is: symprod((500*(16*cosh((pi*n)/2) + 2*pi^2*n^2 - 16))/(pi^2*n^2 - 8*cosh((pi*n)/2) + 8), n, 1, Inf) - 3050
and also I can not plot the sigmax_tot over because it gives me this error: "Undefined function 'symprod' for input arguments of type 'double'." can anyone help me to write the appropriate code for this series??
  댓글 수: 3
Omidreza Ghafarinejad
Omidreza Ghafarinejad 2015년 5월 16일
no it is not truncated. it is a bit long and I didn't write the rest.
Walter Roberson
Walter Roberson 2015년 5월 16일
I would need the rest of the line in order to investigate further.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 5월 15일
The limit of (500*(16*cosh((pi*n)/2) + 2*pi^2*n^2 - 16))/(pi^2*n^2 - 8*cosh((pi*n)/2) + 8) as n approaches infinity is -1000, so you are multiplying together an infinite number of non-zero terms so the result would be -infinity
For further examination I would need the full formula.
  댓글 수: 5
Walter Roberson
Walter Roberson 2015년 5월 16일
With that definition for sigmax_cosine I can demonstrate that when y = -h/2 and x = 0, the limit of the term as n goes to infinity is -f/L . As that is on the order of -500, the infinite sum is -infinity. I am not getting an infinite product at all.
Walter Roberson
Walter Roberson 2015년 5월 16일
Please confirm that the sigmax_cosine term is
-q1 * cos(beta * x) * (2 * cosh(beta * (h + 2 * y) / 2) - 2 * cosh(beta * (3 * h - 2 * y) / 2) + 2 * beta * y * sinh(beta * (h + 2 * y) / 2) + beta * h * sinh(beta * (3 * h - 2 * y) / 2) + 2 * beta * y * sinh(beta * (3 * h - 2 * y) / 2) - 2 * beta ^ 2 * (h ^ 2) * cosh(beta * (h + 2 * y) / 2) + 5 * beta * h * sinh(beta * (h + 2 * y) / 2) + 4 * beta ^ 2 * h * y * cosh(beta * (h + 2 * y) / 2)) / (4 * beta ^ 2 * (h ^ 2) - 2 * cosh(2 * beta * h) + 2)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by