5

I'm using NSolve to find the roots to a transcendental equation. For this, I need to specify a bounded region where roots are searched. What I want to know is how NSolve mathematically finds these roots, and why I need to specify a bounded region.

When I look up NSolve on Mathematica all it says is that

NSolve[expr, vars]: attempts to find numerical approximations to the solutions of the system expr of equations or inequalities for the variables vars

It doesn't tell me anything about how it does this. If it is using Newton-Raphson's method or any other method?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Turbotanten
  • 691
  • 5
  • 18
  • For reference, the polynomial case is discussed here. It is also in the only case discussed in Some Notes on Internal Implementation – Michael E2 Oct 07 '17 at 13:10
  • One method NSolve does not seem to use is Chebyshev approximation, which in the link is a univariate method requiring a bounded domain. – Michael E2 Oct 07 '17 at 13:13
  • Related, but not very informative: http://library.wolfram.com/infocenter/Conferences/7331/, http://library.wolfram.com/infocenter/Conferences/7928/ – Michael E2 Oct 07 '17 at 13:37
  • Is there a reason you use NSolve rather than FindRoot? From your question it seems your are looking for the functionality of the latter. – TimRias Oct 07 '17 at 14:44
  • This may be an interesting read too: http://blog.wolfram.com/2008/12/18/mathematica-7-johannes-kepler-and-transcendental-roots/ Sadly, method are not well documented for Mathematica functions. Very likely, you will not get a complete answer. You will have a better chance for an answer if you ask about one specific equation. – Szabolcs Oct 07 '17 at 19:11
  • 1
    The blog linked by @Szabolcs gives a reason for the second part of your question about the need for a bounded region: "But a key fact is that the roots [of a holomorphic function] are always countable—and, more importantly, there can only be finitely many roots in a given closed and bounded region." – Michael E2 Oct 08 '17 at 12:29
  • Related: https://mathematica.stackexchange.com/a/80423/4999 – Michael E2 Oct 08 '17 at 16:46
  • @mmeent Yes the reason is that I don't need to specify an initial guess if I use NSolve. – Turbotanten Oct 09 '17 at 07:15
  • BTW, here's a trick to search the whole real line -∞ < x < ∞: {x -> Tan[u]} /. NSolve[x/100 - Sin[x] == 0 && -Pi/2 < u < Pi/2 /. x -> Tan[u]] -- won't always work (e.g. if there are infinitely many roots ). – Michael E2 Oct 09 '17 at 14:39
  • Good to know! Won't work for my problem though, because I'm pretty sure I have infinitely many roots. – Turbotanten Oct 09 '17 at 15:22
  • 1
    @Turbotanten, If you have infinitely many roots, then you'll need to bound the domain. (BTW, it sometimes works if there are infinitely many roots, to the extent that it will find finitely many of them: NSolve[Sin[1/x] == 0 && 0 < x < 1] returns 25K roots.) – Michael E2 Oct 10 '17 at 13:20
  • "I'm pretty sure I have infinitely many roots." - but you don't need all of them, do you? – J. M.'s missing motivation Oct 15 '17 at 13:58
  • If memory serves, a contour integral-type method similar to ones proposed by Kravanja and Van Barel are used, last time I asked. – J. M.'s missing motivation Oct 15 '17 at 14:02
  • 1
    @J.M. I think that method is only used is in one dimension, so pretty much the Cauchy Integral Formula for isolation and maybe refinement, followed up by a local method for further refinement (aka "polishing"). – Daniel Lichtblau Oct 15 '17 at 17:28

0 Answers0