JuliaNLSolvers / NLsolve.jl

Julia solvers for systems of nonlinear equations and mixed complementarity problems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redirect to Roots.jl for scrubs like myself

KronosTheLate opened this issue · comments

I came to this package something like separate 3 times, looking for a package to solve equations like exp(2x)=4. Simple univariate stuff. The first "simple example" shows me a bivariate function that mutates an input array to hold the output (New notation and use of a function to me), and defines a jacobian (which I have heard of but have no clue what is). Meeting a "simple example" that uses mathematical concepts that I don't know if was pretty intimidating, which turned me around in the doorway the first couple of times.

Considering the name of this package, I think it is quite natural that I ended up here. But it took quite the motivation and several attempts before first of all getting the guts to try my way on a "simple example", and secondly to realize that Roots.jl was what I was looking for.

Can something like the following be added to the start of the readme.md?

"For solving a single equation of a single variable like exp(2x)+x^2=7, a root-finding tool like Roots.jl is a more adequate/fitting tool." Possibly followed up with something like "Note that this can be accomplished by NLsolve as well, as shown below:
(insert the extra simple example)."

That's a fair criticism. To both of our luck, @mauro3 did the work for us 🥰

Is Roots.jl what you were looking for, or NonlinearSolve.jl? Roots.jl allocates a ton even on scalar rootfinding, so we had to put together NonlinearSolve.jl for our purposes and IMO it's the successor for that reason (it also fixes an accuracy issue in the falsi)

commented

Why did you not improve Roots.jl? Also Roots.jl seems to be fine for just solving a single variable equation if performance is not critical, which is what OP is after. It also has many fewer deps and a simpler interface.

Anyway, it would be good to specify in the respective readmes what which package is good for what. There is also https://github.com/JuliaNLSolvers/NLSolvers.jl, which I don't know how to place either. Are there others?

Anyway, that is for another PR.

Why did you not improve Roots.jl? Also Roots.jl seems to be fine for just solving a single variable equation if performance is not critical, which is what OP is after. It also has many fewer deps and a simpler interface.

Roots.jl pretty fundamentally needs an overhaul. So much stuff is put into untyped dictionaries. It was better to just scrap it and start from scratch. Roots.jl still does its thing, its interface is intact, etc. so there's no reason to just erase it... but the performance isn't there.

I like Roots.jl for its API, and I found the docs easy to understand. As a basic user without need for preformance, that was just fine for me. But all the options can definitly lead to a bit of analysis paralysis, making it hard to choose one. Some unification in the root-finding/nonlin eq-solving space would be much appriciated!

Anyway, it would be good to specify in the respective readmes what which package is good for what. There is also https://github.com/JuliaNLSolvers/NLSolvers.jl, which I don't know how to place either. Are there others?

100% agree with this. cross-references in the readme's, and an overview of who does what good and who does what less good, would go a long way as a user trying to solve some equations, without taking a deep dive into numerical equation solving.

But that is a larger discussion, which should take place elsewhere. With @mauro3's contributions (thanks!), I consider this issue closed.

I like Roots.jl for its API, and I found the docs easy to understand. As a basic user without need for preformance, that was just fine for me. But all the options can definitly lead to a bit of analysis paralysis, making it hard to choose one. Some unification in the root-finding/nonlin eq-solving space would be much appriciated!

That's nonlinear solve. Just need to do a few things before the docs can be released. SciML/NonlinearSolve.jl#33 . Happy to take comments.

Additionally, I'm writing up documentation right now that specifies how all of the differential equation, nonlinear solving, optimization, linear solving, symbolic modeling, and partial differential equation libraries are unified and their common structures. Needless to say, that is quite complex and I'll be happy to take comments. That will be in the SciMLBase repo, where in the near future we plan to build a pooled documentation that encompasses all of these domains together and make sure there's no inconsistencies.

Awesome. I know I have applauded you for your work before, but the ambition of your endevours, and quality of the product, are both simply astonishing. I'll be sure to create issues like this one if I should have ideas for improvements to the documentation. Possibly even a PR or two ^_^