DIFFUSION MC3
Try our model
Click here or scroll down to read the introduction

Diffusion MC3 introduction

Introduction
ApDiffusionMC3 is a MATLAB-based tool for modelling F-Cl-OH multicomponent diffusion in apatite (a phosphate mineral) using a finite-difference and Markov Chain Monte Carlo (MCMC) algorithm. The tool is applicable to the estimation of timescales of magma degassing during ascent via simulating diffusion in apatite with time-varying boundary conditions (changing volatile concentrations in the melt due to decompression-induced degassing and crystallisation).

References
Please cite the papers below if you use ApDiffusionMC3 (or parts of the code) in your research.
Citation for this model:
Li, W. & Yang, Q. in prep
Citation for the apatite multicomponent diffusion model:

Li, W., Chakraborty, S., Nagashima, K., & Costa, F. (2020a) Multicomponent diffusion of F, Cl, OH in apatite with application to magma ascent rates. Earth and Planetary Science Letters 550, 116545. https://doi.org/10.1016/j.epsl.2020.116545

Team members
Weiran (Alex) Li (wl413@cam.ac.uk and weiranli.geo@gmail.com) : MATLAB code
Qingyuan Yang (qingyuan.yang@ntu.edu.sg) : MATLAB code
Bui Quang Huy (HUY009@ntu.edu.sg) : Webpage

Diffusion forward model

Here, we will instruct you how to download the files and run our code on MATLAB. The process is very straightforward, so just keep going!

Diffusion-MC3_files
  • Codes
    • diffusion.m The forward ApTimer model from Li et al. (2021, EPSL). Click to download.
    • boundary_condition_generator.m The function that helps generate boundary conditions for ApTimer. Click to download.
    • likelihood_cal.m The function that calculates the likelihood (as part of the MH algorithm). Click to download.
    • prior_cal.m The function that calculates the prior (as part of the MH algorithm). Click to download.
    • mh_sampling.m The function that couples with codes listed above to implement the MH algorithm. Click to download.
    • plot_result.m The function to examine results from the method. Click to download.
    • input_specification.m The function in which users specify some inputs and locations of the other inputs. Click to download.
    • process_run_save.m The function that run the method and save the results. Click to download.

Diffusion MC3 example plots

The results of our model will look like this:

If you have any queries, please contact us at: wl413@cam.ac.uk or weiranli.geo@gmail.com