NanoSimLab
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.
๐ Key Features
- ๐ฌ 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
๐ฆ Installation
Quick Install (Recommended)
pip install nanosimlab
Development Install
git 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]"
Optional Dependencies
# 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]"
๐โโ๏ธ Quick Start
Command Line Interface
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 --diffusion
Python API
import 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)
๐ฏ Use Cases
Nanoparticle Self-Assembly
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)
Drug Delivery Simulation
# 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
)
Micro-swimmer Collective Behavior
# Simulate active particles with propulsion (future feature)
# sim.add_external_field(PropulsionField(strength=2.0, direction="random"))
๐ Documentation
๐ง Project Structure
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
๐ ๏ธ Development Roadmap
Current Status (v0.1.0)
- โ
Core Brownian dynamics engine
- โ
Basic pair potentials (LJ, Yukawa)
- โ
MSD and RDF analysis
- โ
Command-line interface
Upcoming Features (v0.2.0)
- ๐ HOOMD-blue GPU backend
- ๐ Advanced visualization with NGLView
- ๐ External field support (E/M fields, flow)
- ๐ Jupyter notebook tutorials
Future Vision (v1.0.0)
- ๐ Machine learning integration
- ๐ Nanorobot control algorithms
- ๐ Multi-scale modeling capabilities
- ๐ Commercial simulation package integration
๐ค Contributing
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
๐ Citation
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}
}
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- 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
๐ Support
NanoSimLab: Bridging the gap between nanorobotics theory and simulation practice ๐ฌ๐ค