bugGNU Octave - Bugs: bug #34251, When I use fzero to determine the...

 
 

bug #34251: When I use fzero to determine the roots around 0.5 for tan (x) - sqrt ((1 / x) - 1) I get a non zero complex part

Submitted by:  Pierre-Sandre Farrugia <pierresandre>
Submitted on:  Thu 08 Sep 2011 03:00:44 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: InvalidAssigned to: None
Originator Name: pierresandreOpen/Closed: Closed
Release: 3.2.4Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 08 Sep 2011 04:19:40 PM UTC, comment #3:

Thanks for your reply. Closing this bug.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu 08 Sep 2011 03:34:54 PM UTC, comment #2:

Hi Jordi,

No I could not reproduce the error using fsolve. The function fsolve give me no imaginary output.

I have nothing against closing the bug as not a bug.

Thank you for your patience.

Pierre-Sandre

Pierre-Sandre Farrugia <pierresandre>
Thu 08 Sep 2011 03:14:02 PM UTC, comment #1:

I can't reproduce this in Debian GNU/Linux with the current stable or development branch.

You have a sqrt in your function, so it's conceivable that fzero attempts at least one negative argument for fun which is why you're getting imaginary parts.

Would you agree to close this bug as not a bug? Numerical error is a fact of life.

Can you reproduce this with fsolve instead of fzero?

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu 08 Sep 2011 03:00:44 PM UTC, original submission:

Hi,

I have tried to find the roots of an equation using the following

fun=@(x) tan (x) - sqrt ((1 / x) - 1)
fzero(fun,0.5)

The result is,

6.4171e-001 - 1.4264e-018i

Hence the result contains a non zero imaginary part. While the imaginary part is effectively zero it might be desirable to avoid having it.

Thank you

Pierre-Sandre Farrugia <pierresandre>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by pierresandre (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 08 Sep 2011 04:19:40 PM UTCjordighStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1