JuliaMath / RandomMatrices.jl

Random matrices package for Julia
Other
85 stars 38 forks source link

Switch to DifferentialEquations.jl #29

Closed ChrisRackauckas closed 6 years ago

ChrisRackauckas commented 7 years ago

I am trying to uproot ODE.jl dependencies to make its maintenance less pressing. As a bonus you should get a bonus update. The quick update is just to change your (ts, y)=ode23(deq, y0, [t0, t]) call to sol = solve(ODEProblem(deq, y0, (t0, t)),Tsit5();kwargs...). That would work, though you might want to make the function inplace as well:

function deq(t, y,dy) 
  dy[1] = y[2]
  dy[2] = t*y[1]+2y[1]^3
  dy[3] = y[4]
  dy[4] = y[1]^2
end

or use SArrays. You can do this by depending on just OrdinaryDiffEq + DiffEqBase instead of DifferentialEquations.jl. Let me know if you'd like a PR.

dlfivefifty commented 7 years ago

I think there's a good argument for moving the Tracy–Widom distributions out of this package; especially since the ODE solved here is numerically unstable, see

https://www-m3.ma.tum.de/foswiki/pub/M3/Allgemeines/FolkmarBornemannPublications/NumericalRMT.pdf

for better ways of computing it (either as a BVP or using Fredholm det).

ChrisRackauckas commented 7 years ago

Well, that paper at least shows that using ode23 is a really really bad idea. Vern8() is probably a good method here, and using BigFloats in DiffEq would work. But yes, setting it up as a BVP is probably the way to go.

dlfivefifty commented 7 years ago

Maybe it's worth making the change you propose, but automatically use BigFloat, if you have the energy. A good example to showcase why solving ODEs with high precision is useful.