Skip to content

MKX Structure

An MKX input file is built from a small number of top-level declarations and blocks:

  1. let
  2. components
  3. reactions
  4. simulation
  5. output

Overview

let arr = {Vf=1e13, Vb=1e13}

components {
  A  {phase=gas, init=1.0, role=reactant},
  A* {phase=surface, init=0.0},
  *  {phase=surface, init=1.0, tags=[emptysite]}
}

reactions {
  {A}+{*}=>{A*} @ ArrheniusDefault(*arr, Eaf=50e3, Eab=55e3)
}

simulation {
  base @ transient_solve(
    model=thermal,
    solver={method=cvode_bdf, atol=1e-10, rtol=1e-10, t_end=1e6},
    conditions=[{T=600}]
  )
}

output {
  formats=[tabdelim, hdf5],
  folder="results"
}

Expressions inside these blocks can use the language features documented in MKX Language, including where (...), spread syntax, and block-style if (...) { ... } else { ... } conditionals in components and reactions.

Top-Level Elements

  • let Defines reusable values. let is a top-level declaration, not a block.
  • components Defines the species in the model.
  • reactions Defines the elementary reaction steps and kinetic models.
  • simulation Defines how the model is solved.
  • output Defines how results are written.