Skip to content

About

Small physics and numerical-analysis simulations in Jupyter: projectile motion, random walks, the logistic map, numerical integration, root finding.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physics-Sim

This repository collects small, self‑contained physics and numerical simulation projects intended for learning, teaching, and quick experimentation. Each subfolder contains one or more Jupyter notebooks plus a focused README that explains the underlying mathematics and how to run the code.

Projects Overview

  • mProject_0/ — Projectile motion

    • Constant‑gravity projectile motion in 2D without air resistance.
    • The theoretical trajectory of a projectile launched with initial speed v0 and angle θ (from horizontal) is:
      • x(t) = v0 cos(θ) · t
      • y(t) = y0 + v0 sin(θ) · t − 0.5 g t²
    • The notebook compares numerical trajectories with these analytic expressions and explores how the range
      • R = (v0² · sin(2θ)) / g depends on launch angle.
  • mProject_1/ — Random walk

    • 2D random walk (drunkard’s walk) with independent steps in x and y.
    • Demonstrates that the typical displacement after N steps scales like:
      • <r²>^(1/2) ∝ √N which is a fundamental result in diffusion and stochastic processes.
  • Numerical Analysis/ — Numerical methods and dynamical systems

    • Numerical_Integration.ipynb: Approximates integrals of the form
      • I = ∫_a^b f(x) dx using the trapezoidal and Simpson rules, and compares numerical errors as the step size h is refined.
    • Root_Finding.ipynb: Solves nonlinear equations f(x) = 0 using bisection and Newton–Raphson iterations, for example
      • x_(k+1) = x_k − f(x_k) / f'(x_k).
    • Logistic Map.ipynb: Iterates the logistic map
      • x_(n+1) = r x_n (1 − x_n) and builds a bifurcation diagram showing period‑doubling and chaos as the control parameter r varies.

See the README in each subfolder for more detailed mathematical background and notebook‑specific instructions.

Requirements

  • Python 3.8+
  • numpy
  • matplotlib
  • A Jupyter environment (jupyterlab or notebook)

You can install dependencies either from requirements.txt (if present) or manually:

pip install numpy matplotlib jupyterlab

How to Run the Notebooks

  1. Create and activate a virtual environment (recommended).
  2. Install dependencies, e.g.
    pip install -r requirements.txt
    or
    pip install numpy matplotlib jupyterlab
  3. Start Jupyter in the repository root:
    jupyter lab
    or
    jupyter notebook
  4. Open the notebook of interest (e.g. mProject_0/Projectile.ipynb) and run the cells from top to bottom.

Each project README suggests experiments and parameter changes to help you explore the underlying physics or numerical method.

About

Small physics and numerical-analysis simulations in Jupyter: projectile motion, random walks, the logistic map, numerical integration, root finding.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages