How to start Partial Differential Equation (PDE) Solving in Julia for modified Wave Equation

Hi again, after doing a ridiculous amount of reading (and watching Chris’ extremely helpful video), most of the reply posts on this topic are starting to make sense to me.

It is now clear that the best way to address my equation is with the Method of Lines for the resulting ODE diff eq’s in time (t), after first discretizing in space (x). The best way here to make x discrete is to use what you’re calling Finite Differences with DiffEqOperators. A possible 2nd choice for backup/verification is discretizing x with ApproxFun, but for my G(t,x) function that should only work using the Hermite basis.
Also, I must use “totally absorbing” boundary conditions, which add a couple of “ghost cells” on either side (in x) that keep the spatial derivatives zero at the edges, to kill off any edge reflections or aliased waves from outside the calc domain.

I spent a lot of time reading about Finite Volume methods, but those are bad for hyperbolic eq’s unless one uses something like Lax-Wendroff. But that causes unacceptable phase shifts here. (Solvable with flux limiters, but then the method gets too complicated and mysterious.) And Finite Element methods (and its spinoffs) aren’t called for in this kind of problem.

Within a day or two, I will post a couple of rough draft code snippets outlining my attempted approach; feedback/corrections would be most welcome, if anyone has time. For now, I just have a couple of general questions about this method:

(i) With DiffEqOperators, getting uxx with CenteredDifference(2, order, Δx, N), the usual setting is order=2. But why not crank it up to order=3,4,5…? Any reason not to do to that (e.g., accuracy side effects), other than computational burden?

(ii) My G(t,x) varies so much in magnitude that I may have to use a LARGE number of points in discrete x, ending up with LOTS of ODE’s. (100? 1000? 5000??) For my ODE work in June, the best solvers I found were Vern9 (non-stiff), RadauIIA5 and Rodas5 (stiff). Chris’ talk also mentions Rodas5 as good for the PDE problem. (KenCarp4 gave me less accuracy on ODE’s, and CVODE_BDF has other warnings.) But the ODE solvers documentation says for large numbers of ODE’s, to use LSODA (or VCABM). Is Rodas5 good enough, or are LSODA or VCABM necessary?

(iii) The global methods with ApproxFun mix things together non-locally (by design). For my problem, there will be regions with zero wave energy, that should numerically stay zero. Will ApproxFun (with Hermite) be fairly bad at that, putting real wave energy where physically there shoudn’t be any? (Also, would ApproxFun mess up my attempted totally-absorbing boundary conditions?)

(iv) Unlikely, but is it possible to make Δx of the spatial grid variable, e.g., finer spaced where the variations are stronger? (Even more unlikely, can the program sense this and distribute points appropriately; and most unlikely, maybe even adapt evolve the Δx grid over time?)

Lots of info & questions, I know, but thanks for any feedback!!

2 Likes