MIDAS

MIDAS (Mineral Interface Dynamics and apparent-Age Simulation) is a crystal-growth model that couples interface kinetics and diffusion across an explicit moving boundary (a chemical Stefan/moving-boundary problem), for a mineral (phase A) growing or resorbing in a matrix phase (phase B), with major- and trace-element diffusion and partitioning tracked between the two. The example used throughout this repository is a garnet-biotite pair (major elements Mg-Fe; trace elements Lu, Hf, Mn), built for modeling Lu-Hf garnet geochronology, apparent and isochron ages, and interface (growth/resorption) velocities over a metamorphic P-T-t path.

“A” indicates the parameters and variables with respect to the crystal, whereas “B” refers to the matrix.

Note: MIDAS is under active development (currently v1.0.0) - interfaces, defaults, and file formats may still change between versions, and known limitations exist (see CHANGELOG.md). Feedback and bug reports are welcome - see CONTRIBUTING.md.

Also note: MIDAS was originally written for and developed in MATLAB - matlab//GUI/ are the mature, primary implementation, while octave/ is a port only recently run under real Octave for the first time. Several Octave-only compatibility bugs have been found and fixed this way (see CHANGELOG.md), and more may still surface. Something that misbehaves under Octave but works fine in MATLAB is likely a porting gap, not a physics/numerics issue - please report it.

Three ways to run it

   
Getting started Run it from MATLAB or Octave in a few lines
GUI guide The interactive front-end - MATLAB App Designer, or the Octave rebuild
Octave notes Setup and differences for the GNU Octave port

Background and reference

   
Equations The physics and numerics MIDAS actually solves
Configuration options Every mode switch, what it changes, how they interact
Mesh & time-step refinement Choosing nx_A/nx_B/CFL, and what to do if a run errors
Interpreting output What to look at in R, and what it means
Benchmarks Mass-balance conservation checks (and open items found so far)
Phase diagrams Building a Perplex look-up table for eqMode='PD'
References Every citation used across this documentation, in one place

What it models

Schematic: phase A (crystal) and phase B (matrix) sharing a moving interface S(t), with a diffusion profile C(x,t) across both.

Quick example

addpath('examples');
params = Example1_Baseline();               % fully automated, phase-diagram-driven
R = MIDAS_Main(params);
plot_all_composition_profiles(R);           % every element/isotope, phase A vs phase B

See Examples for all six included configurations, and API reference for every parameter and every plotting function.

Citing

If you use MIDAS in your research, please cite it - see CITATION.cff in the repository root.

Funding

The development of this package is supported by the DFG project 524829125 (VECTOR).

AI use

We used Claude to help find and fix bugs, restructure the code into the matlab//GUI//octave/ layout used here, and build a clearer, user-friendly version of it, including the GUI and logo. Based on the authors’ own instructions and content, Claude created the documentation - both the in-code function documentation and this documentation site. Furthermore, Claude helped with visualizations as well as translation and readability. Claude was not used to develop, derive, or validate any of the model’s underlying physics or numerics - that work is the authors’ own. All AI-assisted output was reviewed and is approved by the authors.

Main authors

Annalena Stroh, Evangelos Moulas - Johannes Gutenberg University Mainz (JGU), 2026

License

MIT - see LICENSE.