Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Complex number Manipulation and replacement rules in Mathematica
Posted:
Jul 11, 1996 8:01 PM


Hello Everybody, I am doing some numerical analysis work, that involves obtaining the eigenvalues of matrix, and checking that the largest eigenvalue is less than one, for possible stability conditions. The eigenvalues are complex in general, and I use Mathematica to obtain them. The problem is that the matrices are originally large, so the eigenvalues are complicated, and usually span more than one page of output. I would like to simplify them further, by introducing some nondimensional arguments, and seperating the real and the imaginary parts. My attempts failed! Here is what I tried, and I hope that someone would show me a better and (working way!).
First I load the Algebra/ReIm.m package, then define all variables as real using Im[variable_name]^=0; Then I try to get Re[exp], and Im[exp]. On very small expressions like Re[a+I b] this works! But on larger expressions, like my eigenvalues it takes ages to compute (6 ~ 7 hours, and I stop the computation without getting an answer). I can discern by eye, that anything multiplying 'I' is definitely the imaginary part as all variables are real, and eigenvalues donot have sqrts', powers or stuff that might produce complex numbers if negative.
I next try to introduce nondimensional groups by defining replacement rules like this rules1 = { k/h > cs, nu/rho > c}; and stuff like that. However, if in an expression k is not immediately devided by h, the replacements donot work. I tried { k > h cs}; and stuff like that, but finally Mathematica would not divide the h in the numerator and the denominator.
Is there any solution to these perplexing problems, and is there a way to define the type of variables like real, complex, and properties like positive negative, in Mathematica?
Help is greately appreciated
 Abdelwahab Taha Dept. of Theoretical and Applied Mechanics, UIUC WWW: http://www.students.uiuc.edu/~taha email: taha@uiuc.edu "Take care of the sense, and the signs will take care of themselves",  Lewis Carrol Drive carefully; 90% of the people in the world are caused by accidents. 



