×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Significant digits and complex numbers

Significant digits and complex numbers

Significant digits and complex numbers

(OP)
I am running into some difficulty formatting the numbers that come out of manipulation of complex numbers.  In order to do the mathematical computations, I have to break a complex number down to do operations on the imaginary and real components separately.
When I return to complex notation, the number of significant digits is untenable.  I cannot get any of the built in number formats to change the way the number is displayed.  
For information, I am starting with a number like:
3E-002+3.6E-002i which is displayed using the formula: =COMPLEX(0.03,0.036,"j")
In order to do unit conversion on these numbers, however, I am using the formula:
=COMPLEX((IMREAL(B22)*5.28/C17),IMAGINARY(B22)*5.28/C17,"j")
this is where I get the insane number of significant digits.
How can I bring the results down to 2 or 3 significant digits?
Any suggestions on how to better handle complex numbers would also be appreciated.
Thanks!

RE: Significant digits and complex numbers

What software are you using ? Excel / 123 / Quattro ?

RE: Significant digits and complex numbers

Have you tried the custom formatting?  Sometimes this seems to do just fine and other times its off.  Just checking to see what you've done.

RE: Significant digits and complex numbers

Looks like Excel.

I've just spent 10 minutes messing about with it, and the only approach I can see that seems to have a chance is to write your own display function, separate from the actual calculated result.

The complex number you want to format is in c23

d23=IMREAL(C23)
d24=imaginary(c23)
d25=text(d23,"0.00")&"+"&text(d24,"0.00")&"j"

Then you can hide the original result (c23, d23,d24 in this case).

Very ugly!



Cheers

Greg Locock

RE: Significant digits and complex numbers

Another alternative is to cut down significant digits by using one of the ROUND functions during your unit conversion process: of course you will lose precision for any subsequent calculations, but if you can accept this...
By the way, I have no complex handling functions in my Excel 2000 installation: is this an add-on or what?


prex
motori@xcalcsREMOVE.com
http://www.xcalcs.com
Online tools for structural design

RE: Significant digits and complex numbers

(OP)
Thanks, everyone.  Yes, as GregLocock surmised, it is Excel that I am using. Sorry about my omission.  

For Prex: You are correct.  The complex number functions are included in the Analysis Toolpak Add-in.

I just tried the custom formatting, and Excel seems to ignore that.  
I will give these suggestions a shot.  The intermediate formatting step may work, but I will also try writing a VB function and see if I can control the variable type that I pass back out.
Thanks for the advice, and I will give feedback when I get the chance to try these hints.
Regards,
Kraigb

RE: Significant digits and complex numbers

(OP)
Well, I have taken some time to mess with this some more, and the least painful method is the text conversion method that Greg Locock proposed.  As Greg mentioned, though, the actual caculations need to happen in some other hidden cells, but this does provide a formatted output that is a little more aesthetically pleasing.
Thanks to all for their suggestions and responses on this!
Kraigb

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources