multiple summation of series (3 variables)

7 ビュー (過去 30 日間)
Valentin Buchinger
Valentin Buchinger 2018 年 6 月 5 日
Hello all,
I am trying to solve the triple sum of a series attached but don't seem to be able to do that and cannot do so even having looked at previous threads to similar issues.
The formula should give 3D temperature distribution in a brick but that does not really change the task much :)
h,t,K are constants. x,y,z are the coordinates, a,b,c are the dimensions of the brick and m,n,p are the variables to be summed up.
I have tried to solve it with symsum but do not get a value as the result. This might well be that this is a user mistake as I am not familiar with symbolic variables.
x=0.0575;
y=0.0575;
z=0.045;
t=20;
syms m n p;
T_xyz=h*t-(64*h/(Dc*pi^3))*symsum(symsum(symsum((sin((2*m-1)*pi*x/X))*(sin((2*n-1)*pi*y/Y))*(sin((2*p-1)*pi*z/Thick))*(1-exp(-Dc*t*pi^2*(((2*m-1)^2/X^2)+((2*n-1)^2/Y^2)+((2*p-1)^2/Thick^2))))/(pi^2*(((2*m-1)^2/X^2)+((2*n-1)^2/Y^2)+((2*p-1)^2/Thick^2))*(2*m-1)*(2*n-1)*(2*p-1)),p,1,3),n,1,3),m,1,3);
Please note that I am using X instead of 2a, Y instead of 2b, Thick instead of 2c and Dc instead of K but yet again this should not hamper the functionality.
Any help to move forward would be greatly appreciated.
Many thanks in advance, Valentin
  5 件のコメント
Valentin Buchinger
Valentin Buchinger 2018 年 6 月 5 日
Hi Basil,
thank you for the hint. Now I indeed get a numerical value as the result :) Thanks for the swift support on this.
Cheers
Stephen23
Stephen23 2018 年 6 月 5 日
編集済み: Stephen23 2018 年 6 月 5 日
@Valentin Buchinger: do NOT use eval for this, it is the wrong tool for the job (not matter how much other beginners will tell you to use it). Use double, just like the symbolic toolbox documentation advises.

サインインしてコメントする。

採用された回答

Stephen23
Stephen23 2018 年 6 月 5 日
The correct tool to use is double.
  1 件のコメント
Valentin Buchinger
Valentin Buchinger 2018 年 6 月 6 日
Thank you very much for the help.

サインインしてコメントする。

その他の回答 (1 件)

Basil Saeed
Basil Saeed 2018 年 6 月 5 日
If your expression does not contain any undefined symbols, then try adding the line:
eval(T_xyz)
to your code (after you preform the summation)
  2 件のコメント
Steven Lord
Steven Lord 2018 年 6 月 5 日
DON'T use eval. Since T_xyz is a symbolic expression, use the double function instead as recommended in the Release Notes.
Valentin Buchinger
Valentin Buchinger 2018 年 6 月 6 日
Thank you for the help.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by