Integrating the Kuramota-Sivashinsky Equation in Mathematica
I recently was reading this paper by Jaideep Pathak, Brian Hunt, Michelle Girvan, Zhixin Lu, and Edward Ott (because I read this article by Natalie Wolchover), and got interested in trying to reproduce the numerical integration of the Kuramota-Sivashinsky equation as shown in Figure 2 of the paper (sorry, I know the paper is paywalled):
The top plot is the numerical integration, the middle one is the prediction using reservoir computing, and the bottom is the difference. For now, I am just interested in the top plot.
I found a nice paper by Aly-Khan Kassam and Lloyd Trefethen that contains Matlab code for doing this integration (using a method they developed called exponential time-differencing). I reproduced this code in Mathematica. There were a few annoying differences; the worst one being a difference in the Fourier conventions between Matlab and Mathematica.
Here is the Mathematica code initializing things:
The initial profile looks like this:
Then code for calculating some things used in the integration loop:
And finally the full numerical integration loop:
The result can be plotted using
I should emphasize that this is nothing original; I just changed a few small things to make the Matlab code given by Kassam and Trefethen work in Mathematica. I put the full Mathematica code on my github in case anyone finds it useful. I’m sure the code could be shortened and made more efficient by using some of Mathematica’s functional programming capabilities.