Code for the manuscript Data-driven continuation of patterns and their bifurcations
Authors: Wenjun Zhao, Samuel Maffa, Bjorn Sandstede
This software computes pattern statistics in spatially extended systems and uses them for bifurcation tracing. Depending on the task, typically it requires (1) an initial value problem solver which generates desired patterns, e.g. snapshots of Brusselator in spatial dimension 2 at a certain terminal time; (2) a pattern statistic to be used when performing the bifurcation tracing task, usually computed via
For simulating spiral waves, this repository provides the EZ-Spiral code written by Dwight Barkley and Matlab code written by Stephanie Dodson and Bjorn Sandstede that were used in Sandstede and Scheel. Spiral waves: linear and nonlinear theory.
This work uses the following implementation:
Wasserstein distance between 1D histograms: Niklas Kolbe (2024) https://github.com/nklb/wasserstein-distance
Transportation cost given a cost matrix: Antoine Rolet (2014) https://github.com/gpeyre/2017-ot-beginners/blob/master/matlab/mexEMD/mexEMD.cpp (based on an implementation by Nicolas Bonneeel).
MATLAB
git clone https://github.com/sandstede-lab/Pattern_Continuation.git
The scripts are organized (tentatively) as the following:
-
model.m
: takes a structmodelpar
as input, with all model settings as its attributes, and outputs a pattern, which is either (1) positive/negative sets for spot/stripe related applications, or (2) tip point trajectory for spiral wave related applications. -
feature_evaluation.m
: takes two structsmodelpar
for evaluation of patterns, andfeatpar
for mapping patterns to feature functions. The output is pattern statistics associated with the models. -
objective_evaluation.m
: takes two sets of pattern statistics as inputs, and output the distance metric between them, depending on the data type of inputs. Note that this function has dependency onws_distance.m
andmedEMD/
for evaluating Wasserstein distance. -
continuation.m
: this is the main function for continuation. It takesmodelpar
,featpar
, and two function handles for feature evaluation and objective evaluation as inputs. In addition, it requriescontpar
, which is a struct specifying details on running the continuation, and a starting point for the algorithmstart
.
The following file contains examples for (1) snaking in 1D Swift-Hohenberg model, and (2) stripes/spots in various 2D reaction-diffusion systems (Brusselator, Swift-Hohenberg, Gray-Scott, Schnakenberg).
Example usage: tracing out stripe/spot interface for Brusselator:
cd ReproduceCurves
Main_Brusselator
The file has starting points/directions already. An alternative is to use the automated starting point search tool:
cd ReproduceCurves
Test_IC_Brusselator
Spiral wave (Barkley):
cd ReproduceCurves
Main_Barkley
The file has starting points/directions already. An alternative is to use the automated starting point search tool:
cd ReproduceCurves
Test_IC_Barkley
Note that the spiral wave simulations may require compilation locally. Users may need to create their own Mex files by typing `make' in command line within the corresponding folder, such as DataGenerator/Spiral_Wave/Barkley.
cd FreezingMethod
freezing_method
Scripts to reproduce each figure in paper are hosted under ReproduceFigures and labeled according to the index in paper. For example, to generate Figure 6 (simulations displayed together with our results):
Cd ReproduceFigures
Figure6