Request for examples: Systems of nonlinear equations that have jacobians with special structure

I’m changing some things in NLsolve.jl, in particular the possibility to chose the solver than solves the linear system of equations to determine the step direction. This means that if you have a package MySpecialLinsolve.jl you can now (hopefully) use your awesome linsolve or \ to calculate the direction faster by exploiting the Jacobian structure.

However, this is not something I use too much myself, it’s just been requested, and it makes sense. So I need your help! Please provide the residual function and Jacobian in a snippet of code so I can try to see if it works as intended before I tag a new version. You don’t need to show the full nlsolve example (it might not even work!) I’m just interested in the functions. I’m interested in many different versions. Dense (Array) jacobians with special structure, sparse (SparseMatrixCSC or other) matrices, special matrix types (Diagonal' is obvious by boring as it's handled by` already), and so on. It’s just important that there’s an interesting, efficient, fast, …, linsolve you can pass to exploit that sweet sweet structure.



There are some nice examples from ODEs, which reduce to nonlinear solves with implicit time steppers. One that comes to mind is Toda flow which would have SymTridiagonal Jacobians.