The program is composed of 5 separate MATLAB script files (.m). 4 of those contain the code:
- read.m
- init.m
- simul.m
- figures.m The last script, main.m, calls the 4 other script sin succession.
The config.txt file lists all the essential parameters that the program needs in order to properly run the simulations. The syntax should not be tampered with as it might aversely affect the reading script. Numerical and boolean values can be changed to create a customised configuration.
The read.m script requires a configuration text file (.txt) to be located in the same location, named “config.txt”. In order to import a configuration file with another name or from another location please alter line 3 of the script accordingly.
The init.m script takes the data read from the read.m script, stores in the data_read matrix, and initialises matlab variables with the inputted numerical values.
This is the main script of the code. Its structure and functions are detailed by the comments in the code.
This final script takes the estimates in each axis, stored in the variables S_i, and plots their difference with the true background field as a histogram. The histogram is fitting with a normal distribution, of which the mean and standard deviation are added to the legend of the figure.
Adjust the config.txt file to an appropriate configuration. Open the main.m script and run it. This will generate 3 figures that represent the error distribution for each axis.
The recommended number of simulations is nsimul = 10’000, as this equates to a running time of about 30s. nsimul = 100’000 is feasible but much lengthier and does not generate different results.
Nicholas Delmotte
Daniel Montagna
Imperial College London, 2019