Re: Root finding for non-polynomials



This is what pursued originally, but it never really worked out well. Now I realize that was partly because of my coding error. The other problem is that 'roots' can return values that are not even roots! For example, consider the function: -3*x + 2*sqrt(x) + (3-2i)

roots([-3,2,3-2i]).^2 >> 1.9536-0.8692i; 0.4909-0.4641i
secant(), findroot() >> 1.9536-0.8692i

Substituting 0.4909-0.4641i into the equation returns 3.05-1.2i; clearly not a root. I can easily throw out nonsense values but am still often left with a decision about which of a couple of values is most appropriate.
.



Relevant Pages


Loading