2012-11-12 27 views
1

有沒有一種方法來簡化這個結合表達式:數學簡化共軛表達

expr=d12*Conjugate[C1]*C2 + d12*Conjugate[C2]*C1 + d13*Conjugate[C1]*C3 + d13*Conjugate[C3]*C1 

成類似:

2 d12 (Re[C1*Conjugate[C2]]) + 2 d13 (Re[C1*Conjugate[C3]]) 

而在一般情況下,數學如何確定一個表達比另一種更簡單?有沒有辦法在簡化過程中添加一些個性化規則?例如,我們可以告訴Mathematica我們更喜歡2*Re[C1*Conjugate[C2]]而不是C1*Conjugate[C2]+C2*Conjugate[C1]?謝謝。

更新

感謝您的建議。 ComplexExpand可以將其擴展到實部和虛部,但似乎仍不能簡化爲首選形式:

In: Simplify[ComplexExpand[expr, {C1, C2, C3}]] 
Out: 2 (Im[C1] (d12 Im[C2] + d13 Im[C3]) + Re[C1] (d12 Re[C2] + d13 Re[C3])) 

我試過TransformationFunctions功能就像這一點,但它不工作:

In: t = # /. (Im[C1] Im[C2] + Re[C1] Re[C2] -> 1/2 Re[C1\[Conjugate] C2]) &;  
In: Simplify[ComplexExpand[expr, {C1, C2, C3}], TransformationFunctions -> {Automatic, t}] 
Out: 2 (Im[C1] (d12 Im[C2] + d13 Im[C3]) + Re[C1] (d12 Re[C2] + d13 Re[C3])) 

我做錯了嗎?謝謝。

+0

你試過'ComplexExpand []'? –

回答

3

其實它簡化爲更小的表達

expr=d12*Conjugate[C1]*C2+d12*Conjugate[C2]*C1+d13*Conjugate[C1]*C3 + 
    d13*Conjugate[C3]*C1; 
Simplify[ComplexExpand[expr]] 

2 C1 (C2 d12 + C3 d13) 

數學如何確定一個表達比另一種更簡單?有沒有辦法爲其簡化過程添加一些個性化規則

您可以使用ComplexityFunction選項Simplify。默認值是Automatic,我認爲這是使用Leaf計數來決定的。您也可以使用TransformationFunctions選項來提供您自己的功能來應用。看到幫助。

http://reference.wolfram.com/mathematica/ref/ComplexityFunction.html

http://reference.wolfram.com/mathematica/ref/TransformationFunctions.html

http://reference.wolfram.com/mathematica/ref/LeafCount.html

+0

謝謝。但'ComplexExpand [expr]'假定expr中的所有變量都是Real,這裏'C1 C2 C3'是複雜的。如果使用'Simplify [ComplexExpand [expr,{C1,C2,C3}]]'我得到'2(Im [C1](d12 Im [C2] + d13 Im [C3])+ Re [C1] [C2] + d13 Re [C3]))'。但它仍然不是我喜歡的形狀。 – xslittlegrass