Written in Python 3.8 by Alex C.
The best way to install the jupyter notebook dependencies is to install conda and activate the provided environment using conda env create -f environment.yml
To utilize the environment and ensure the code runs on your computer, download miniconda from conda.io.
The data was taken through Google Science Journal on iOS 14.
Each test was run for 5 seconds 5 times, and then exported to a .csv file. The trials were conducted at lengths of 0-10 cm.
The raw files are in the directory ./magnet-data/
.
The gathered data was analyzed using matplotlib.pyplot, numpy, and scipy.stats.
For point electric charges like monopoles, the electric field strength decreases as the distance from the source increases, following Coulomb's law:
Linear regression model fitting did not work, and with the small amount of data points, fitting to Coulomb's law was not as effective as a wider array of points. The function was best plotted using the lambda expression for reverse exponential regression:
lambda t, a, b: a * np.exp(b * t)
Check ./figs/
for .png files of the data from each of the results.
The subdirectory ./out/
contains csv files of each dataset where the first row is the mean, the second row is the standard deviation, and the third row is the chisquared values.
In a bash/zsh/sh shell with conda installed run:
git clone https://github.com/doc-ock/magnets.git
cd magnets
conda env create -f environment.yml
conda activate magnets
Once you are in an environment that has the required packages installed, open the jupyter notebook:
jupyter notebook