Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.independent

Topic: Complex number Manipulation and replacement rules in Mathematica
Replies: 2   Last Post: Jul 15, 1996 9:54 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Abdelwahab Taha

Posts: 7
Registered: 12/11/04
Complex number Manipulation and replacement rules in Mathematica
Posted: Jul 11, 1996 8:01 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



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
e-mail: 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.
--------------------------------------------------







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.