0
|
1526 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# Is ComplexExpand[Abs[]] the most efficient way to compute absolute value

Posted 7 months ago
 I am trying to compute the absolute value of the complex expression 1/3 (1 + a + b) + ((1 - I Sqrt[3]) (-(-1 - a - b)^2 + 3 (a c + b c + b d - a b d)))/(3 2^( 2/3) (2 + 6 a + 6 a^2 + 2 a^3 + 6 b + 12 a b + 6 a^2 b + 6 b^2 + 6 a b^2 + 2 b^3 - 9 a c - 9 a^2 c - 9 b c - 18 a b c - 9 b^2 c - 9 b d + 9 a^2 b d - 9 b^2 d + 9 a b^2 d + 27 c d - 27 a c d + Sqrt[(2 + 6 a + 6 a^2 + 2 a^3 + 6 b + 12 a b + 6 a^2 b + 6 b^2 + 6 a b^2 + 2 b^3 - 9 a c - 9 a^2 c - 9 b c - 18 a b c - 9 b^2 c - 9 b d + 9 a^2 b d - 9 b^2 d + 9 a b^2 d + 27 c d - 27 a c d)^2 + 4 (-(-1 - a - b)^2 + 3 (a c + b c + b d - a b d))^3])^( 1/3)) - (1/( 6 2^(1/3)))(1 + I Sqrt[3]) (2 + 6 a + 6 a^2 + 2 a^3 + 6 b + 12 a b + 6 a^2 b + 6 b^2 + 6 a b^2 + 2 b^3 - 9 a c - 9 a^2 c - 9 b c - 18 a b c - 9 b^2 c - 9 b d + 9 a^2 b d - 9 b^2 d + 9 a b^2 d + 27 c d - 27 a c d + Sqrt[(2 + 6 a + 6 a^2 + 2 a^3 + 6 b + 12 a b + 6 a^2 b + 6 b^2 + 6 a b^2 + 2 b^3 - 9 a c - 9 a^2 c - 9 b c - 18 a b c - 9 b^2 c - 9 b d + 9 a^2 b d - 9 b^2 d + 9 a b^2 d + 27 c d - 27 a c d)^2 + 4 (-(-1 - a - b)^2 + 3 (a c + b c + b d - a b d))^3])^(1/3)  by using ComplexExpand[Abs[]] of the expression. I thought I could do this because the parameters $a,b,c,d$ are all real. But it just keeps running indefinitely. Is there a workaround/a way to actually get an answer?
2 Replies
Sort By:
Posted 7 months ago
 Are there particular values of a, b, c, and d other than those just being Real?For example, when a=1 and b=1, the absolute value is just a function of c (as d disappears from the result).
Posted 7 months ago
 As one may expect, the result will depend on the contents of the square root. If the expression to be evaluated with a polynomial in four variables of degree 6 at least in my count. So the decision, what the non-holomorphic functions Abs, Arg, Re, Im have to return depends on the position of the roots of the general polynomial degree 6 in C^4, known to be undecidable.But there is a way out. If all parameters are real, we define  pc = p /. Complex[a_, b_] :> a - I b and by complete expansion at least terms with different signs cancel and squares are real positive.  Norm2[a_, b_, c_, d_] := Evaluate[ Simplify@ExpandAll[ pc*p ]] Numerically one checks  Norm2 @@ RandomReal[{-12, 12}, 4] yielding  50.2231 instead of  328.049 + 2.84217*10^-14 I if only a simplify is applied.There is no possibilty of Simplify. There ar at least four symbolic mathematical constants in the system.  Norm2[1, 2, 88, 4] // FullSimplify 264 An integer mapping?
Community posts can be styled and formatted using the Markdown syntax.