I have a large complex fraction and I want to separate its real and imaginary parts. I have declared all my variables real in the beginning of the notebook and I am applying ComplexExpand[Re[frac]], notebook is running for weeks, yet no output. Please help me out. The notebook is attached.
What is your ultimate intended use of this expression? Since all the coefficients are numerical, I’d guess that in the end you are intending to perform a numerical calculation with the result. If that is the case (and it may not be) then why not work numerically with your expression directly and take the appropriate real and imaginary parts of the result. It’s still a challenge to make sure that your numerical results are accurate since you have such a large expression that is a combination of large powers of your parameters… but that would be the way I would go. However, if I have a calculation that seems that it would go on for weeks, I would stop and reevaluate my strategy.
Thanks a lot for your suggestion. But I have already applied another trick (multiplying and dividing expr1 by complex conjugate of denominator of expr1 ) and I also did as you said ( there was a little error in your suggestion which I corrected); but both ways give me some error in final expression (precision and accuracy related, since there are very high negative powers). For example,
Thanks for the help. My goal is first to solve two parts (real and imaginary) for Rdot. Later I want to extract coefficient of theta (with specific exponent) from Rdot. Then I expect to get a relation between Rdot and theta in terms of another paramters followed by continuation method to investigate the trend among paramters.
I do not know how Denominator[1/p+q] will behave. I find this simple example
In[1]:= expr1 = 1/(a + I b) + c + I d;
Denominator[expr1]
Out[2]= 1
In[3]:= Numerator[expr1]
Out[3]= 1/(a + I b) + c + I d
In[4]:= {LeafCount[expr1], LeafCount[expr1[[1]]] + LeafCount[expr1[[2]]],
LeafCount[Denominator[expr1]] + LeafCount[Numerator[expr1]]}
Out[4]= {168640, 168639, 167369}
The first total is 1 less than the leaves in expr1 because the Plus has been removed. The second total appears to be missing 1271 items so I am concerned about your multiplying and dividing by conjugate of denominator. I suppose it might be possible that the Numerator and Denominator are somehow rearranging the expressions to end up with fewer leaves, but I would verify that the results are correct before using them.
My apologies for making any error. If you can explain what I did incorrectly I would appreciate it.
I do not think Conjugate[Denominator[expr1]] * Numerator[expr1] should be real, but I had hoped that this would provide a rapid method of extracting the real and complex parts. I would verify your calculation on a smaller example to see if this is correct.
I do not know how to interpret your using Chop, everything I was doing was intending to be exact calculations.