Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Imaginary Component from a Complex Number 1

Status
Not open for further replies.

dik

Structural
Joined
Apr 13, 2001
Messages
26,111
Location
CA
I've tried multiplying with the conjugate and ended up with a 'tiny' complex component. Does anyone know how to remove the imaginary component from a complex number. I'm using SMath.

Dik
Wind-Change_Return_Period_f9iwhu.png


Thanks

Dik
 
Thanks Dave... I found it in one of the articles.

Dik
 
Smath is doing something weird - I can replicate your result using Smath, but the same expressions entered into Mathcad Prime work fine.

Drilling down, it is apparent that the complex number is generated by the last term:

[tt]ln(-0.0339/(ln(1-1/n)))[/tt]

Checking the parameters shows that this should yield a real result, but for some reason it throws a complex result.

Bizarrely, if I do simple evaluation of this term, Smath gives a real solution; entering:

[tt]ln(-0.0339/(ln(0.8))) =[/tt]

yields the expected result: [tt]-1.8844[/tt]

However, saving this same expression into a variable, and then outputting the saved result, yields a complex result:

[tt]test := ln(-0.0339/(ln(0.8)))
test =[/tt]

yields a complex solution: [tt]-1.8844 + 3.1416 i[/tt]

Why this is so, I don't have a clue. However, "[tt]3.1416 i[/tt]" looks suspiciously like "[tt]pi i[/tt]", which is surely not a coincidence. I would guess it's some sort of glitch with storing the results of the log of a negative number divided by another negative number.

Hope this might help a little.




 
IRS:
I'll check. I thought I was running the latest version.

Dik
 
Well, that was weird. it turns out that my bad habit of using the immediate evaluation changed the outcome. I posted it as a bug in their bug tracker. Not sure how long it takes to get resolved; it looks like they've got a pretty long list

pg1a_hsxcif.png


TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top