Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-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
Apr 13, 2001
25,566
0
36
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
 
Replies continue below

Recommended for you

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.




 
Status
Not open for further replies.
Back
Top