This project is a simulation of Brownian motion, also known as random walk, using the Chart.js
library. The simulation allows the user to adjust parameters such as the number of iterations, the time step, and the dimensionality of the system. The resulting motion of the particles is visualized in a scatter plot. Additionally, the user can export the data to an Excel file using the xlsx
library and save the plot as an image using the FileSaver
library.
- Chart.js: Used for visualizing the Brownian motion in a scatter plot.
- xlsx: Allows the user to export the data to an Excel file.
- FileSaver: Allows the user to save the plot as an image.
You can see the live preview of the project here: https://mathias007.github.io/brownian-motion/
To run the simulation, simply open the index.html
file in your web browser. The simulation will start automatically. You can also change the parameters of the simulation, such as the number of particles and the diffusion coefficient, by modifying the variables in the script.js
file.
The simulation shows the random motion of particles in a fluid over time. The results can be exported to a XLXS
file for further analysis. Additionally, we calculated the mean square displacement and its dependence on time, as well as the diffusion coefficient. The results are consistent with theoretical predictions and experimental data.
The project successfully simulates the Brownian motion of particles in a fluid using computer simulation. The results agree with theoretical predictions and experimental data, and the code can be easily modified to explore different scenarios. This project can be a useful tool for studying the behavior of small particles in a fluid, and for understanding the fundamental principles of diffusion and random motion.