Welcome to the Physics Simulations repository! This collection includes various physics simulations that do not belong to any of my other themed repositories. These simulations are created using Python and Jupyter Notebooks, providing an interactive and visual approach to understanding complex physical phenomena.
Physics simulations are powerful tools for visualizing and understanding physical processes and phenomena. This repository includes simulations such as the Double-Slit Experiment, Cellular Automata, the Double Pendulum, Fluid Dynamics, and Magnetism, which help illustrate core concepts in quantum mechanics, complex systems, fluid mechanics, and electromagnetism.
Ensure you have the following software installed:
- Python 3.x
- Jupyter Notebook
- NumPy
- Matplotlib
- Other dependencies as specified in the notebooks
Clone the repository and install the required libraries:
git clone https://github.com/hbarquanta/Physics-Simulations.git
cd Physics-Simulations
To install dependencies for a specific application, navigate to the application's directory and install the requirements:
cd Applications/Double_Pendulum
pip install -r requirements.txt
For the Fluid Dynamics application:
cd Applications/Fluid_Dynamics
pip install -r requirements.txt
For the Magnetism application:
cd Applications/Magnetism
pip install -r requirements.txt
The repository is organized as follows:
Physics-Simulations/
├── Animations/
│ ├── automata_simulation.gif
│ ├── double_pendulum_simulation.gif
│ ├── double_slit_simulation.gif
│ ├── Magnetism_simulation.gif
│ ├── navier_stokes_simulation.gif
│ └── ...
├── Applications/
│ ├── Double_Pendulum/
│ │ ├── Double_Pendulum_App.py
│ │ └── requirements.txt
│ ├── Fluid_Dynamics/
│ │ ├── Fluid_Dynamics_App.py
│ │ ├── requirements.txt
│ │ └── car.png
│ ├── Magnetism/
│ │ ├── Magnetism_App.py
│ │ └── requirements.txt
│ └── ...
├── Cellular Automata.ipynb
├── Double_Slit_Experiment.ipynb
├── Double_Pendulum.ipynb
├── Fluid_Dynamics.ipynb
├── Magnetism.ipynb
└── README.md
To run the Jupyter notebooks, navigate to the repository directory and start Jupyter Notebook:
jupyter notebook
Open the notebook you are interested in from the Jupyter interface.
- Double_Slit_Experiment.ipynb: This notebook simulates the famous double-slit experiment, demonstrating the wave-particle duality of light and matter.
- Animations: View the animations here.
- Celular Automata.ipynb: This notebook explores cellular automata, including the Game of Life, illustrating how simple rules can lead to complex behaviors.
- Animations: View the animations here.
- Double_Pendulum.ipynb: This notebook describes the theoretical framework of the (chaotic) Double Pendulum, explores how a slight change of initial conditions leads to completely different solutions after a certain time span i.e. chaotic behavior, and also includes the basic code for the standalone application.
- Double Pendulum Application: This application simulates the motion of a double pendulum.
- Fluid_Dynamics.ipynb: This notebook contains a basic implementation of fluid dynamics simulations using the Navier-Stokes equations.
- Fluid Dynamics Application: This Streamlit application simulates fluid flow around various objects, such as circles, squares, ellipses, cars, and planes.
- Magnetism.ipynb: This notebook explores the magnetic field generated by bar magnets and simulates various configurations to visualize the resulting magnetic fields.
- Magnetism Application: This Streamlit application simulates the magnetic field generated by two bar magnets, allowing users to control the dimensions, positions, and orientations of the magnets.
Contributions are welcome! If you would like to improve the simulations or add new ones, please fork the repository and submit a pull request.