McStas is an open source software simulator for neutron scattering instruments and experiments. The software consists of a compiler that translates instrument and component definitions to C code.
McStas is based on a compiler that reads a high-level specification language defining the instrument to be simulated and produces C code that performs the Monte Carlo Simulation. The system is very fast in use, both when setting up the instrument definition and when doing calculations.
McStas is based on a unique design where an automatic compilation process translates high-level textual instrument descriptions into efficient ANSI-C code. This design makes it simple to set up typical simulations and also gives essentially unlimited freedom to handle more unusual cases.
Key Features
- Very fast in use.
- Supports triple-axis.
- Supports time-of-flight instruments.
- Supports polarised neutrons.
- Library of well-tested components that include most standard elements of neutron scattering instruments, including steady-state and pulsed sources, monochromators/analysers, guides, collimators, vanadium and powder samples, velocity selectors and choppers, and a variety of detectors.
- Generates histograms (tallies) as formatted (easy to read) text files. Such text files may be read by the McStas internal plotter using PGPLOT, but also using Matlab, Scilab, VRML/HTML (web page), HDF/NeXus, XML/NeXus, Octave, IDL and more.
- Comprehensive manual.
Website: www.mcstas.org
Support: Manual
Developer: Risø / ILL / KU
License: GNU Lesser General Public License

McStas is written in C. Learn C with our recommended free books and free tutorials.
Related Software
| Physics Tools | |
|---|---|
| ROOT | Solves the data analysis challenges of high-energy physics |
| OpenFOAM | Facilitates the numerical solution of partial differential equations |
| McStas | Neutron ray-trace simulation application |
| Octopus | Real-space, real-time implementation of TDDFT |
| Geant4 | Toolkit for the simulation of the passage of particles through matter |
| Rivet | Particle-physics MC analysis toolkit |
| HepMC | Event record for High Energy Physics Monte Carlo generators |
| Elmer | Finite Element Software for Multiphysical Problems |
| PYTHIA | Generation of high-energy physics events |
| CP2K | Quantum chemistry and solid state physics software package |
| Sherpa | Monte Carlo event generator |
| FastJet | Software for jet finding in pp and e+e− collisions |
| SU2 | Suite for multiphysics simulation and design |
| Herwig | Multi-purpose particle physics event generator |
| Tracker | Video analysis and modeling tool designed to be used in education |
| Step | Interactive physics simulator |
| LHAPDF | General purpose C++ interpolator |
| Gerris Flow Solver | Tool for generic numerical simulations of flows |
| ASL | Hardware accelerated multiphysics simulation platform |
Read our verdict in the software roundup.
| Ray Tracing Software | |
|---|---|
| POV-Ray | Full-featured ray tracer |
| Blender | 3D content creation suite with a huge range of uses |
| McXtrace | Monte Carlo Xray Tracing for simulation X-ray beamlines and experiments |
| McStas | Simulator for neutron scattering instruments and experiments |
| BRL-CAD | Combinatorial Constructive Solid Geometry (CSG) solid modeling system |
| Embree | High-performance ray tracing library |
| LuxCoreRender | Rendering system for physically correct image synthesis |
| Visionaray | C++ ray tracing template library |
| YafaRay | Montecarlo raytracing engine |
| MantaRay | Advanced renderer using modern rendering techniques |
| Tachyon | Parallel / multiprocessor ray tracing system |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Know a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

