Lightweight, extensible Brownian dynamics toolkit for nanoparticles and proto-nanorobotics
NanoSimLab provides accessible tools for simulating and analyzing nanoparticle systems using Brownian dynamics, with a focus on nanorobotics research and development. The toolkit runs out-of-the-box with NumPy/SciPy and offers seamless integration with popular computational chemistry and materials science libraries.
- π¬ Brownian Dynamics Simulations: Overdamped Langevin integration in 2D/3D with periodic boundary conditions
- βοΈ Multiple Pair Potentials: Lennard-Jones, Yukawa/screened Coulomb, with extensible framework
- π Built-in Analysis: Mean-squared displacement (MSD), radial distribution function (RDF), diffusion coefficients
- π₯οΈ Simple CLI: User-friendly command-line interface for non-programmers
- π§ Extensible Architecture: Optional integrations with HOOMD-blue, OpenMM, ASE, MDAnalysis, and more
- π€ Nanorobotics Focus: Designed for proto-nanobot behavior and collective particle control
pip install nanosimlabgit clone https://github.com/hkevin01/NanoSimLab.git
cd NanoSimLab
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e ".[dev,analysis,viz]"# For advanced analysis and visualization
pip install "nanosimlab[analysis,viz]"
# For molecular simulation integration
pip install "nanosimlab[molsim,builder]"
# For development
pip install "nanosimlab[dev]"Run a simple nanoparticle simulation:
# Simulate 200 Lennard-Jones particles
nanosim simulate --n 200 --box 20 --steps 20000 --dt 1e-4 --temp 1.0 \
--potential lj --epsilon 1.0 --sigma 1.0 --rcut 2.5 \
--out trajectory.npz
# Analyze the results
nanosim analyze --traj trajectory.npz --rdf --msd --diffusionimport numpy as np
from nanosimlab.system import BDSimulation
from nanosimlab.potentials import LennardJones
from nanosimlab.analysis import msd, rdf
# Create simulation
sim = BDSimulation(
n=200, # Number of particles
box=20.0, # Periodic box size
dim=3, # 3D simulation
temperature=1.0, # Reduced temperature
potential=LennardJones(epsilon=1.0, sigma=1.0, rcut=2.5)
)
# Run simulation
trajectory = sim.run(steps=10000, dt=1e-4, save_every=100)
# Analyze results
times, msd_values = msd(trajectory["positions"], trajectory["times"])
r, g_r = rdf(trajectory["positions"], box=trajectory["box"])
# Save results
np.savez("results.npz",
positions=trajectory["positions"],
times=times, msd=msd_values,
r=r, rdf=g_r)from nanosimlab.potentials import Yukawa
# Simulate charged nanoparticles with screening
sim = BDSimulation(n=100, potential=Yukawa(A=5.0, kappa=1.0))
trajectory = sim.run(steps=50000, dt=5e-5)# Model drug-carrier nanoparticles in biological medium
sim = BDSimulation(
n=50, box=15.0, temperature=310/300, # Body temperature
potential=LennardJones(epsilon=0.5, sigma=2.0) # Biocompatible particles
)# Simulate active particles with propulsion (future feature)
# sim.add_external_field(PropulsionField(strength=2.0, direction="random"))- User Guide: Comprehensive tutorials and examples
- API Reference: Detailed function documentation
- Examples Gallery: Jupyter notebooks for common use cases
- Contributing Guide: How to contribute to the project
NanoSimLab/
βββ src/nanosimlab/ # Core package source code
β βββ __init__.py # Package initialization
β βββ potentials.py # Pair potential implementations
β βββ integrators.py # Numerical integration schemes
β βββ system.py # Main simulation engine
β βββ analysis.py # Trajectory analysis tools
β βββ cli.py # Command-line interface
βββ tests/ # Unit and integration tests
βββ docs/ # Documentation source files
βββ scripts/ # Utility scripts
βββ data/ # Example datasets
βββ assets/ # Images and media files
βββ pyproject.toml # Project configuration
- β Core Brownian dynamics engine
- β Basic pair potentials (LJ, Yukawa)
- β MSD and RDF analysis
- β Command-line interface
- π HOOMD-blue GPU backend
- π Advanced visualization with NGLView
- π External field support (E/M fields, flow)
- π Jupyter notebook tutorials
- π Machine learning integration
- π Nanorobot control algorithms
- π Multi-scale modeling capabilities
- π Commercial simulation package integration
We welcome contributions from the research community! See our Contributing Guide for details on:
- Setting up development environment
- Code style and testing requirements
- Submitting pull requests
- Reporting bugs and feature requests
If you use NanoSimLab in your research, please cite:
@software{nanosimlab2025,
title={NanoSimLab: Brownian Dynamics Toolkit for Nanoparticles and Nanorobotics},
author={Kevin},
year={2025},
url={https://github.com/hkevin01/NanoSimLab},
version={0.1.0}
}This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by computational tools in the nanorobotics and materials science communities
- Built on the robust NumPy/SciPy scientific Python ecosystem
- Designed to complement existing molecular simulation frameworks
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- Email: kevin@example.com
NanoSimLab: Bridging the gap between nanorobotics theory and simulation practice π¬π€