-
-
Notifications
You must be signed in to change notification settings - Fork 97
Resolving Issue: Errors in Simple Handwritten PDEs as ODEs #1291
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
base: master
Are you sure you want to change the base?
Conversation
For the psuedospectral, see the comment in #929. The ApproxFun dev mentioned we should change to OrthogonalPolynomials.jl for this part so we should take that recommendation. |
@ChrisRackauckas Could you please run the workflow so I can check the logs for errors?
|
Why are mass matrices required here? Most of these should resolve to not have any algebraic constraints if the right spectral discretization is chosen. (Singular) Mass matrices (DAEs) would prohibit most of the solvers from being used. Though if that's a requirement for one of them, then so bit and that changes the solvers that should be chosen there (and would be an interesting contrast) |
L = 2.0 # Domain length | ||
xs, prob = allen_cahn(N, L) | ||
# @time sol = solve(prob, AutoVern7(RadauIIA5(autodiff=false)); dt=1e-2, abstol=1e-14, reltol=1e-14, adaptive=true) | ||
@time sol = solve(prob, Tsit5(); abstol=1e-14, reltol=1e-14, adaptive=true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicit methods usually have issues with convergence due to order loss. I'm not sure changing to an explicit method for these for the reference will work out well. Though you'll see the in the work-precision diagram if you have a problem with the convergence, since all of the other methods will hit a wall and only converge to the error of the reference solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I commented the wrong line in this commit. Thanks!
reltols = 0.1 .^ (1:3) | ||
multipliers = 0.5 .^ (0:3) | ||
setups = [ | ||
Dict(:alg => IMEXEuler(), :dts => 1e-4 * multipliers), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the same sets as above. A set showing all of the exponential integrators, all of the IMEX methods, all of the normal methods, and then a comparison of the best between the families.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, planning to reincorporate the complete tests for the server builds as I can only prototype a few sets with the current local resources. Should these still be fixed time-steps or use adaptive time-stepping?
Dict(:alg => Rodas4(), :dts => 1e-4 * multipliers), | ||
Dict(:alg => Rodas5(), :dts => 1e-4 * multipliers), | ||
Dict(:alg => GRK4T(), :dts => 1e-4 * multipliers), | ||
Dict(:alg => GRK4A(), :dts => 1e-4 * multipliers), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main ones to add to the mass matrices comparisons would be FBDF and QNDF. Also a DAEProblem formulation testing DASKR.jl and Sundials.IDA. You can benchmark multiple simultaneous problem implementations using the prob_choice
setup, see the DAE benchmarks for how this is done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to know; thanks for the tips!
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
This merges changes to resolve issue #1284 on the benchmarks of handwritten PDEs as ODEs via finite-difference and pseudo-spectral methods.
The package dependencies have been updated to remove unused ones, and the compat entries have been updated for Julia v1.10. The implementations have been tested on local machines (Macbook Pro M1 Pro on MacOS Sequoia and a beefier CPU running Ubuntu 22.04 LTS) by running
SciMLBenchmarks.weave_file
on the relevant.jmd
files.At present, changes have been implemented for the following PDEs in one spatial and one time dimension:
The following changes have been implemented to the finite-difference method benchmarks:
SparseArrays
.MatrixOperator
interfaces are used from the updatedSciMLOperators
forSplitODEProblem
.These are functioning for certain solver algorithm choices (
IMEXEuler
,CNAB2
,CLAF2
,ETDRK2
,SBDF2
)Commits will be progressively added in this pull (such as pseudo-spectral method updates), including revisions based on comments from the reviewers (@ChrisRackauckas).