Symsum returns symbolic expression instead of value

8 vues (au cours des 30 derniers jours)
Grant Lee
Grant Lee le 26 Fév 2021
Commenté : Grant Lee le 1 Mar 2021
I would like to solve the equation shown in the picture.
Try to run the code:
syms m
assume(m,{'positive','integer'})
x=2
y=2
%W=0.4 L=0.3
r=symsum(((1-cos(m*pi))/(m*pi))*sinh((m*pi*(0.4-y)/0.3))/(sinh((m*pi*0.4/0.3)))*sin(m*pi*x/0.3),m,1,inf)
and it returns to:
val =
symsum((sin((20*pi*m)/3)*sinh((16*pi*m)/3)*(cos(pi*m) - 1))/(m*sinh((4*pi*m)/3)), m, 1, Inf)/pi
It would not returns to the exact value, as I tried eval()/vpa().
Not sure what else I can do to solve it.
Thank you for your time and help.

Réponse acceptée

Steven Lord
Steven Lord le 26 Fév 2021
What makes you believe that this summation converges?
syms m
f = sinh(16*pi*m/3)./sinh(4*pi*m/3);
fplot(f, [0 10])
This term takes off like a rocket by the time you reach m = 6 or m = 7.
The fact that you're working with trig functions whose arguments are integer multiples of pi makes me suspect there's a lot of multiplication and division by zero (or would be if pi were exactly πor if you used sinpi and cospi.)
  4 commentaires
Walter Roberson
Walter Roberson le 27 Fév 2021
With 0.0096 it does appear to converge.
Even m the result is 0 because 1-cos(pi*m) -> 1-1
So you can remap to m = 2*M+1, M=1..infinity .
The number of terms to use depends upon your desired accuracy. It looks to me as if M=160 should get you accuracy to +/- 1e-16
Grant Lee
Grant Lee le 1 Mar 2021
Thank you for your help!

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by