Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Findroot does not find the root' topicStudent Support Forum > General > Archives > "Findroot does not find the root"

Next Comment >Help | Reply To Topic
Author Comment/Response
Hettie
08/23/12 08:39am

I have a problem with Findroot. When I try to find the (second) root of a parabolic function, for example:
X^2-5x+a, I plot:
Root2[a_]:=Re[(x /. FindRoot[x^2-5x+a==0,{x,10, 0,10}])]

However, when parameter 'a' increases, I know from the plot of this function, that there does not exist a root. But Mathematica still gives a solution. This solution is then the minimum of this parabolic function (and thus not a root).

Can anyone help me? I want to find a root, only if there is a root, and otherwise I want that mathematica tells me somehow, that there is no root. I allready tried to make it into an if-function. This works, however, I have a big m-file that uses a findrootfunction into another findroot function etc. So my program becomes really slow if I have to make a lot of if-functions.

Maybe is there another code that I can use?

Thanks,
Greets!

URL: ,

Subject (listing for 'Findroot does not find the root')
Author Date Posted
Findroot does not find the root Hettie 08/23/12 08:39am
Re: Findroot does not find the root jf 08/23/12 11:16am
Re: Re: Findroot does not find the root Hettie 08/23/12 11:47am
Re: Re: Re: Findroot does not find the root jf 08/23/12 1:33pm
Next Comment >Help | Reply To Topic