-
-
Notifications
You must be signed in to change notification settings - Fork 239
Prevent rationalization in QNDF #2922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Why would this be faster? Multiplication by a rational number requires doing a division, which is slower than just a floating point multiplication. All rationals should just be turned into floats for the actual calculation |
|
The core of the problem is
Here So we should either turn |
|
It is faster: using OrdinaryDiffEqBDF, ProfileCanvas, BenchmarkTools
f(du, u, p, t) = du .= 0.0
prob = ODEProblem(f, ones(10), (0.0, 1.0))
@btime sol = solve(prob, QNDF(); adaptive = false, dt = 1e-5, save_everystep = false)But other solutions avoiding the |
|
we probably should make |
|
Yes the answer is to make |
|
Makes sense. Does it make sense to do it only for NDF in this PR, or would you only want to do it for all solvers at once? |
|
all at once. |
|
Understandable, closing this for now as I don't have the capacity to go at that now. |
|
I assume it would be pretty quick from what you have? I'll see if claude can just finish it. |
|
Ok, thanks. I thought you meant this has to be gone through for every single solver in all of OrdinaryDiffEq? Or did you mean just the BDF family ones? |
|
This has been addressed in #2923 which converts |
|
Perfect. |
This fixes #2921 because
γₖnow remain rational, and are not converted to floats due to thetTypeNoUnitsconversion.I don't know whether this is ok. Why do only BDF/NDF methods do this
tTypeNoUnitsconversion when constructing their cache? Can I also remove all the othertTypeNoUnitsconversions in the same file?