Add arbitrary-order GaussLegendre FIRK method (draft)#3470
Add arbitrary-order GaussLegendre FIRK method (draft)#3470Sreeram-Shankar wants to merge 6 commits intoSciML:masterfrom
Conversation
|
Needs some tests, but otherwise, looks reasonable. |
| end | ||
| e = b .- b_low | ||
| else | ||
| e = b |
There was a problem hiding this comment.
It looks like for s = 1, no real embedded method is implemented. Should an adaptive time integration for s = 1 be checked during initialization to throw an error in this case?
There was a problem hiding this comment.
we probably should make s=2 be the minimum (otherwise we just have a trapezoid method)
There was a problem hiding this comment.
If we use the general (all s) implementation, it could be nice to still allow s = 1 to compare the performance with the ImplicitMidpoint method.
There was a problem hiding this comment.
That's fair. I think the lack of a natural embedded method may make integrating it difficult, but it is likely worth a try.
There was a problem hiding this comment.
I changed the error estimator to a Richardson controller for now since embedding error estimators into the method in the way I tried requires extra stages and is nontrivial. I can look into natural embedded pairings for GL methods and implement that if you have any suggestions.
There was a problem hiding this comment.
using Gauss-Lobatto quadrature to get 2s-2 order LobattoIIIA methods, which share the same nodes as GL plus the endpoints, could be an option
There was a problem hiding this comment.
I think it would also be totally fine to just implement Gauss methods as non-adaptive methods for now.
There was a problem hiding this comment.
Yes, one step to get them converging at the right order, then another to make them adaptive, is a very common thing to make the PRs saner to review.
There was a problem hiding this comment.
Got it, I’ll scope this around the fixed-step Gauss methods so the review stays focused on correctness/order. DID also add convergence/order tests with some basic coverage for the Richardson controller.
| A = Matrix{T1}(undef, num_stages, num_stages) | ||
| for i in 1:num_stages | ||
| for j in 1:num_stages | ||
| nodes, weights = gausslegendre(2 * num_stages) |
There was a problem hiding this comment.
As far as I know, FastGaussQuadrature.jl only works with Float64. Would it make sense to implement the analytical coefficients for the known cases when higher precision is required?
There was a problem hiding this comment.
With JuliaApproximation/FastGaussQuadrature.jl#149 that concern will be resolved.
|
Is there an advantage to having this in the same subpackage as the Radau methods? |
|
we could split them, but this is a FIRK method, it uses all the same deps, and this is only a single algorithm so the include and image size change should be minimal. IMO this seems like a good place for it. |
|
I’ve added convergence/order tests (checking 2s order for s = 2, 3 and a higher-order accuracy check for s = 4), plus some basic adaptive tests for the Richardson controller. Also integrated them into the existing FIRK problem tests and allocation tests. Is there anything else you’d like to see test-wise? I was thinking about symplectic or A-stability checks. |
|
formatted with runic |
…air (which can be brought back later) with a half-step based controller for now
2f8be28 to
9649936
Compare
| linsolve = nothing, precs = nothing, | ||
| extrapolant = :dense, fast_convergence_cutoff = 1 // 5, | ||
| new_W_γdt_cutoff = 1 // 5, | ||
| controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true, |
There was a problem hiding this comment.
we probably should use a PI controller until we get order adaptivity
| extra_keyword_description = extra_keyword_description, | ||
| extra_keyword_default = extra_keyword_default | ||
| ) | ||
| struct GaussLegendre{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <: |
There was a problem hiding this comment.
the type params here are missing the v7 updates
Add arbitrary-order Gauss-Legendre FIRK method
Closes #3454
This is a draft implementation of arbitrary-order Gauss-Legendre
collocation methods as requested in the linked issue. With
sstagesthe method has classical order
2sand is symplectic, making itsuitable for Hamiltonian systems and problems requiring long-time
geometric integration.
What's implemented
GaussLegendre(num_stages=s)algorithm struct following the existingRadau interface pattern
FastGaussQuadrature.gausslegendrewithLagrange basis integration for the
Amatrixsn × snsystemadaptive stepping (placeholder, needs improvement)
Known issues / TODOs
and Murua paper but haven't implemented it yet
Testing
Basic out-of-place solve works correctly:
Happy to iterate on any of this based on feedback.