This tutorial has been developed with support from EPSRC (GR/T09156/01). It covers most of the OCaml features that are used in the nsim library which is used by nmag.