Implementing semi-implicit Fourier spectral method

I’m trying to implement the semi-implicit Fourier spectral method described here. It is basically a fourth-order phase-field equation, the linear fourth order operator is treated implicitly and the nonlinear operator term explicitly. I’d like to get some hints on how to implement it using the available solvers and packages in Julia and particularly DifferentialEquations.jl.

When I was solving similar problems using finite difference, I just need to define the RHS of the equation and choose the appropriate solver and I didn’t really need to care about implicit vs explicit method when defining the RHS. What about a semi-implicit scheme? The closest example I can find is this one. Do I just define a SplitODEProblem as in the example?

And then what about the Fourier spectral method? I have tried creating a pre-plan using FFTW.jl and passing it inside the parameter struct to do the Fourier transform inside the RHS function, but then I ran into issues with the automatic differentiation. Is ApproxFun.jl of any use in this case? I have found two examples in the SciML benchmark on Allen-Cahn and Burger’s equation on ‘pseudospectral method’ but I’m not sure if they are up-to-date and they don’t have much documentation.

Yes, that example is doing the same semi-implicit (i.e. IMEX) scheme.

Just discretize to an ODE via Fourier decomposition, no difference on the solver part.

PreallocationTools.jl will be helpful here. Just use the LazyBufferCache for the discretization. If your discretization isn’t changing then you can instead just solve in Fourier space and cut down on the work.

ApproxFun is useful and those examples should do “fine”, though I plan on updating them a bit they should serve as useful background for how to do this.