1
$\begingroup$

The appendix of the preprint Gravitational potential and energy of homogeneous rectangular parallelepiped contains a Mathematica expression which I would like to appreciate before using.

It contains (), [] and {}. According to this Wolfram reference the round parenthesis are the usual separators for order of calculation, and the square braces are specific to arguments of functions.

However, the curly braces are said to be for lists. This confuses me because the expression is a scalar function $U$ of six scalar variables $X, Y, Z, a, b, c$ and I don't understand how a list would come into play as there are no commas.

Question: What would be the function of the curly braces in this expression?

As an aside, the eighth line in the expression should might end in ])] and the eight-from-last line should end in ^2]-Z]+. These appear to be typos.


Here the potential is given in units of G ρ and the Mathematica’s language is used except of first ”additional” line,U(X, Y, Z, a, b, c) =; Mathematica’s designations are corresponding to ”usual” mathematical formulas as follows: Log[x]≡ln(x), Arctan[x]≡ arctan(x), Sqrt[x]≡ x^1/2.

U(X,Y,Z,a,b,c)=
{(-c-Z)^2*ArcTan[((-a-X)*(-b-Y))/(Sqrt[(-a-X)^2+(-b-Y)^2+(-c-Z)^2]*(-c-Z))]-
(-c-Z)^2*ArcTan[((a-X)*(-b-Y))/(Sqrt[(a-X)^2+(-b-Y)^2+(-c-Z)^2]*(-c-Z))]-
(-c- Z)^2*ArcTan[((-a-X)*(b-Y))/(Sqrt[(-a-X)^2+(b-Y)^2+(-c-Z)^2]*(-c-Z))]+
(-c-Z)^2*ArcTan[((a-X)*(b-Y))/(Sqrt[(a-X)^2+(b-Y)^2+(-c-Z)^2]*(-c-Z))]+
(-b-Y)^2*ArcTan[((-a-X)*(-c-Z))/((-b-Y)*Sqrt[(-a-X)^2+(-b-Y)^2+(-c-Z)^2])]+
(-a-X)^2*ArcTan[((-b-Y)*(-c-Z))/((-a-X)*Sqrt[(-a-X)^2+(-b-Y)^2+(-c-Z)^2])]-
(-b-Y)^2*ArcTan[((a-X)*(-c-Z))/((-b-Y)*Sqrt[(a-X)^2+(-b-Y)^2+(-c-Z)^2])]-
(a -X)^2*ArcTan[((-b-Y)*(-c-Z))/((a-X)*Sqrt[(a -X)^2+(-b-Y)^2+(-c-Z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Z)^2]]+
(a-X)*(c-Z)*Log[b-Y+Sqrt[(a-X)^2+(b-Y)^2+(c-Z)^2]]-
(-a-X)*(-b-Y)*Log[-c+Sqrt[(-a-X)^2+(-b-Y)^2+(-c-Z)^2-Z]+
(a-X)*(-b-Y)*Log[-c+Sqrt[(a-X)^2+(-b-Y)^2+(-c-Z)^2]-Z]+
(-a-X)*(b-Y)*Log[-c+Sqrt[(-a-X)^2+(b-Y)^2+(-c-Z)^2]-Z]-
(a-X)*(b-Y)*Log[-c+Sqrt[(a-X)^2+(b-Y)^2+(-c-Z)^2]-Z]+
(-a-X)*(-b-Y)*Log[c+Sqrt[(-a-X)^2+(-b-Y)^2+(c-Z)^2]-Z]-
(a-X)*(-b-Y)*Log[c+Sqrt[(a-X)^2+(-b-Y)^2+(c-Z)^2]-Z]-
(-a-X)*(b-Y)*Log[c+Sqrt[(-a-X)^2+(b-Y)^2+(c-Z)^2]-Z]+
(a-X)*(b-Y)*Log[c+Sqrt[(a-X)^2+(b-Y)^2+(c - Z)^2]-Z].
$\endgroup$
  • 1
    $\begingroup$ It seem that curly braces should be parenthesis, as the content inside is divided by 2. The whole expression ends with a period, and should ended with a "]". I agree with typos you detected. Finally, if this is a function definition, it should be U[X_,Y_,Z_,a_,b_,c_]:= as usual $\endgroup$ – José Antonio Díaz Navas Dec 9 '17 at 10:45
  • $\begingroup$ @JoséAntonioDíazNavas OK I'm having some luck now, thank you for looking into it! I'll leave a note tomorrow with what I find. $\endgroup$ – uhoh Dec 9 '17 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.