How Can I Remove Imaginary Parts from a Complex Number Expression?

  • Thread starter Thread starter kaizen.moto
  • Start date Start date
  • Tags Tags
    Imaginary parts
Click For Summary
SUMMARY

The discussion focuses on methods to extract the real parts from a complex number expression in Mathematica. Users suggested utilizing the FullSimplify function while ensuring that the coefficients (Ao and Bo) are treated as real numbers. Alternatives include reducing precision, avoiding complex numbers in derivations, and using formulas specifically designed to compute the real part of a complex number. The Chop function was also recommended to eliminate small imaginary components.

PREREQUISITES
  • Understanding of complex numbers and their properties
  • Familiarity with Mathematica syntax and functions
  • Knowledge of the FullSimplify and Chop functions in Mathematica
  • Basic concepts of numerical precision in computational mathematics
NEXT STEPS
  • Research how to use FullSimplify with assumptions in Mathematica
  • Learn about the Chop function and its applications in numerical analysis
  • Explore methods for handling complex numbers in Mathematica
  • Investigate techniques for reducing numerical precision in mathematical computations
USEFUL FOR

Mathematics students, computational scientists, and anyone working with complex number expressions in Mathematica who seeks to simplify or manipulate these expressions effectively.

kaizen.moto
Messages
94
Reaction score
0
Hi all,

I have this expression containing complex numbers and I wanted the expression to be displayed with real parts only. How can i do this?

For instance, the original expression is,

eqn = (16.0001+3.16141*10^-21 i)-(0.00860351-1.16927*10^-18 i) Ao[1]+(0.00537811-4.47536*10^-19 i) Ao[2]+(0.00220452-3.26709*10^-19 i) Ao[3]+(0.000739715-4.06632*10^-19 i) Ao[4]+(0.00013763-7.3495*10^-20 i) Ao[5]+(0.0000531553-2.41817*10^-20 i) Ao[6]+(0.0000215401-7.71228*10^-21 i) Ao[7]+(8.33787*10^-6-2.34411*10^-21 i) Ao[8]+(3.04878*10^-6-6.62795*10^-22 i) Ao[9]+(1.05209*10^-6-1.65167*10^-22 i) Ao[10]+(3.41169*10^-7-3.05161*10^-23 i) Ao[11]+(1.03042*10^-7-4.88271*10^-25 i) Ao[12]+(2.84435*10^-8+1.99951*10^-24 i) Ao[13]+(1.97033*10^-9-1.78568*10^-25 i) Ao[14]-(1.27252*10^-9-2.32126*10^-24 i) Ao[15]+(1.48923*10^-9+1.28512*10^-24 i) Ao[16]+(2.6173*10^-9+5.15919*10^-24 i) Ao[17]-(0.00140526-1.73272*10^-18 i) Bo[1]-(0.00102695-5.8933*10^-20 i) Bo[2]-(0.00120414-4.97092*10^-19 i) Bo[3]-(0.000925213+9.831*10^-19 i) Bo[4]-(0.000299566+1.36884*10^-21 i) Bo[5]-(0.000114259-2.87861*10^-22 i) Bo[6]-(0.0000407664-5.94754*10^-22 i) Bo[7]-(0.0000136803-4.09024*10^-22 i) Bo[8]-(4.28978*10^-6-2.03871*10^-22 i) Bo[9]-(1.23214*10^-6-8.23679*10^-23 i) Bo[10]-(3.08143*10^-7-2.67666*10^-23 i) Bo[11]-(5.67061*10^-8-5.63015*10^-24 i) Bo[12]-(1.24165*10^-9+3.89669*10^-25 i) Bo[13]+(1.79991*10^-9-2.12938*10^-24 i) Bo[14]+(2.8092*10^-9-5.68199*10^-24 i) Bo[15]+(6.17782*10^-9-8.51869*10^-24 i) Bo[16]+(4.60098*10^-9+5.81194*10^-24 i) Bo[17].


I have tried to various methods but still failed including Re[eqn] etc etc etc.

Please let me know and thank you in advance.
 
Physics news on Phys.org
kaizen.moto said:
I have tried to various methods but still failed including Re[eqn]
Did you try to FullSimplify that? You might need to tell FullSimplify that the Ao's and Bo's are real. (They are real, right?)

You could probably tell Mathematica to reduce the precision.

You could repeat the derivation in a way that doesn't use complex numbers.

You could use one of the formulas for computing the real part of a number.

You could tell it to replace i with 0.



You could find a way to do whatever you wanted to do next that doesn't require the coefficients to be real.
 
Chop[eqn]
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 24 ·
Replies
24
Views
3K
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 68 ·
3
Replies
68
Views
12K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K