Python software and reproducible numerical examples for the paper Error attribution in gradient random walk methods for parabolic equations by Stephen Abkin and Prabir Daripa.
The repository supports two uses:
- reproduce the reported tables and figures, and
- modify the supplied configurations or study scripts to run new cases.
Clone the revised-paper branch:
git clone --branch grw-solvers-v3 https://github.com/stephen122204/Gradient-Random-Walk-Solvers.git
cd Gradient-Random-Walk-SolversFor the archived version 1.1.0, download the ZIP from
Zenodo, extract it, and open a
terminal in Gradient-Random-Walk-Solvers-1.1.0/. If using the journal
code supplement ZIP, open its source/ folder instead.
Create a Python 3.11 environment:
python -m venv .venvActivate it on macOS or Linux:
source .venv/bin/activateOn Windows PowerShell, use:
.\.venv\Scripts\Activate.ps1On Windows Command Prompt, use:
.venv\Scripts\activate.batThen install the pinned dependencies:
python -m pip install -r requirements.txtThe pinned environment uses Python 3.11.4. Generated files are written under
output/ or outputs/. Both directories are ignored by Git.
Generate all eleven figures directly from the committed data:
python reproduce.py paperRerun the representative simulations, refinement studies, ensembles, and two-step heat study, and compare their outputs with the committed results:
python reproduce.py verify-allReproduce the additional heat identity controls, independent seed-block controls, and fitted-rate bootstrap comparison:
python checks/heat_cdf_identity_check.py --fresh
python checks/two_step_reference_and_seed_blocks.py
python checks/bootstrap_seed_grouping_check.py --heat-profiles --json output/bootstrap.jsonThe bootstrap output's joint intervals are those reported in the manuscript.
Figures are saved under output/final_prepublication_tests/paper_figures/.
Rerunning replaces generated outputs. Allow several minutes for the full
studies and several GB of available memory for the direct-distribution control.
Runtime depends on hardware.
To run one study, use t4 for heat, t7 for paired heat reconstructions,
t5 for the scalar reaction–diffusion front, t3 for Cole–Hopf plateau
controls, t8 for Burgers controls, or t9 for two-step heat predictions
and validation. For example:
python reproduce.py t9Run python reproduce.py with no target to display the available commands.
Copy a JSON file from configs/, change its parameters, and pass it to the
solver:
cp configs/heat_step_dirichlet.json configs/my_heat.json
python main.py configs/my_heat.jsonReaction–diffusion and Burgers examples are fhn_grw_steady.json and
burgers_stationary_shock.json in configs/. config_template.jsonc
documents the available fields. Plots are saved below outputs/.
Save your edited input alongside them.
For a case matching one of the supplied exact references, also compute and print error metrics with:
python verify_solver.py --equation heat --config configs/my_heat.jsonThe files in studies/ are complete examples of parameter sweeps, multi-seed
experiments, error decompositions, and controlled comparisons. Adapt their
parameters, seed lists, and output directories for new studies.
simulation.py,config.py,utils.py: solvers, configuration, and shared helpers.main.py,verify_solver.py: run a case and compare with an exact reference.configs/,config_template.jsonc: editable example inputs.studies/,study_paper_refinement.py: paper experiments and reusable study examples.reproduce.py,verify_ensembles.py,checks/: reproduce and check reported results.figure_data/,pinned_ensembles/,expected_values.json: reference data for the reported values and figures.figure_scripts/: figure generation.
Version 1.1.0, including the two-step heat study and updated checks, is
archived on Zenodo. Cite this
version when reproducing the revised paper. See CITATION.cff for author
and paper citation metadata.
The authors thank Oliver Stalker for providing an early version of the Python code.
Principal Investigator: Professor Prabir Daripa — Texas A&M University, Department of Mathematics
Other projects from the Daripa Research Group are available on the group's GitHub page.