A web-based platform for simulating memristive circuits and networks. This application provides an intuitive interface for researchers, students, and engineers to configure, simulate, and analyze memristor behavior without requiring extensive programming knowledge.
- What is a Memristor?
- What This Application Does
- Quick Start with Docker (Recommended)
- Project structure
- Alternative: Manual Installation
- Web Interface Usage
- Contributing
- License
A memristor is a passive electronic component that changes its resistance based on the history of current that has flowed through it. This "memory resistance" makes memristors valuable for neuromorphic computing, non-volatile memory, and analog computation applications.
- Circuit Simulation: Generate and simulate memristive circuits using industry-standard NGSpice
- Multiple Models: Support for Pershin and Vourkas memristor models
- Network Analysis: Simulate individual devices or complex networks
- Visualization: Automatic generation of I-V curves, hysteresis loops, and time-domain plots
- Export Results: Download simulation data and plots as organized ZIP files
Docker provides the easiest way to run the application across all operating systems. No need to install Python, NGSpice, or manage dependencies manually.
- Download Docker Desktop for Windows
- Follow the installation wizard
- Restart your computer when prompted
- Open Docker Desktop and wait for it to start. You might have to install/update WSL version (
wsl --update)
- Download Docker Desktop for Mac
- Drag Docker.app to Applications folder
- Launch Docker from Applications
- Complete the setup process
# Update package index
sudo apt-get update
# Install Docker
sudo apt-get install docker.io docker-compose
# Add your user to docker group (optional, avoids using sudo)
sudo usermod -aG docker $USER
# Log out and back in for this to take effectFollow the official Docker installation guide for your specific distribution.
- Go to the repository page
- Click the green "Code" button
- Select "Download ZIP"
- Extract the ZIP file to your desired location
- Open the terminal/command prompt (Windows Key + R > type "cmd" > Accept)
- Go to the extracted folder, for example
cd C:\Users\ExampleUser\Downloads\memristor_simulation-master
git clone https://github.com/ignaciopineyro/memristor_simulation.git
cd memristor_simulation- First time setup
docker-compose up --build- Subsequent runs
docker-compose up# If you have make installed (recommended)
make up-build # First time
make up # Subsequent runs
# Without make
docker-compose up --build # First time
docker-compose up # Subsequent runsOnce you see "Starting development server at http://0.0.0.0:8000/" in the terminal:
- Open your web browser
- Navigate to: http://localhost:8000
- Start simulating!
- Press
Ctrl+Cin the terminal, or - Run:
docker-compose down(ormake down)
This is a Django web application that follows the standard Django project structure with additional organization for memristor simulation functionality. The project is organized as follows:
-
djangoproject/: Main Django project directory containing configuration filessettings.py: Django configuration including database, static files, and app settingsurls.py: URL routing configurationwsgi.py&asgi.py: WSGI and ASGI application entry points
-
memristorsimulation_app/: Main Django application containing all simulation functionalitymodels.py: Django ORM models for data persistenceviews.py: Django views handling HTTP requests and responsesadmin.py: Django admin interface configurationapps.py: Application configurationconstants.py: Enum objects with constants used throughout the projectrepresentations.py: Dataclasses representations used in the project
-
memristorsimulation_app/services/: Business logic services for simulation operationscircuitfileservice.py: Circuit file (.cir) generation with subcircuits dependencies, component instances, analysis commands and control commandssubcircuitfileservice.py: Subcircuit file (.sub) generation containing memristor model parameters, dependencies, sources, and componentsplotterservice.py: Plotting service for I-V and State-Time curves, comparative plots between simulations, and sub-plot figuresdirectoriesmanagementservice.py: Path resolution and folder creation utilitiesngspiceservice.py: NGSpice simulation wrapper with time measurement capabilitiestimemeasureservice.py: Simulation time measurement logicnetworkservice.py: Network topology generation for multi-device simulations
-
memristorsimulation_app/models/: Memristor model definitionspershin.sub: Pershin memristor model subcircuit filevourkas.sub: Vourkas memristor model subcircuit file
-
memristorsimulation_app/templates/: Django HTML templates for web interface- Simulation parameter input forms
- Component-based modular templates for different simulation types
-
memristorsimulation_app/static/: Static web assets- CSS stylesheets for form styling and responsive design
- JavaScript modules for form validation and interaction
-
memristorsimulation_app/serializers/: Django REST Framework serializers- Data serialization for API endpoints and form validation
-
memristorsimulation_app/tests/: Test suite- Unit tests for services, models, and API endpoints
- Integration tests for simulation workflows
-
memristorsimulation_app/simulation_results/: Simulation output storagepershin_simulations/: Results from Pershin model simulationsvourkas_simulations/: Results from Vourkas model simulations- Each simulation creates subdirectories containing:
- CSV data files with simulation results
- Generated plots in various formats
- Simulation logs with NGSpice output and time measurements
manage.py: Django management script for running commandsrequirements.txt: Python dependencies needed to run the applicationdb.sqlite3: SQLite database file (created after first migration)Dockerfile: Docker container configurationdocker-compose.yml: Docker Compose orchestration fileentrypoint.sh: Docker container startup script
For advanced users who prefer not to use Docker, we provide detailed manual installation instructions in a separate guide:
Note: Manual installation is more complex and requires troubleshooting skills. We strongly recommend using Docker for most users.
The Django web interface provides an easy-to-use form for configuring and running memristor simulations:
- Model Configuration: Select memristor model (Pershin or Vourkas). Parameters will depend on the chosen model (Pershin and Vourkas have the same set of params)
- Input Parameters: Source name and connection nodes
- Waveform Configuration: Configure voltage waveforms (SIN, PULSE, PWL)
- Simulation Parameters: Set simulation type, time steps, voltages, and device parameters
- Export Parameters: Folder and file name and magnitudes to export
- Network Configuration: Choose between single device or network topology. Parameters will depend on the chosen network type
- Plotter: Select plot types. Some plots will depend on the chosen network type
- Execute Simulation: Click "Run Simulation" to execute and download results as ZIP
- Simulation execution time scales with complexity of the circuit (amount of devices)
- Results are automatically packaged as ZIP files
- Include CSV data files, generated plots, and simulation logs
- Persistent storage maintains simulation history
This is an open-source educational project, contributions are welcome! Whether you're a student, researcher, or engineer interested in memristor simulation, your input is valuable.
- Bug Reports: Found an issue? Please report it in the Issues section
- Feature Requests: Have ideas for new simulation capabilities? Let us know!
- Documentation: Help improve guides, tutorials or code documentation
- Code Contributions: Submit pull requests for bug fixes or new features
- Educational Content: Share simulation examples, tutorials, or use cases
- Fork the repository
- Create a feature branch (
git checkout -b feature/NewFeature) - Make your changes and add tests if applicable
- Commit your changes (
git commit -m 'Added new feature X') - Push to the branch (
git push origin feature/NewFeature) - Open a Pull Request
For questions or discussions, feel free to reach out to ignaciopineyroo@gmail.com
This project is licensed under the MIT License - see the LICENSE file for details.
- Free to use for academic, educational, and research purposes
- Free to modify and adapt for your specific needs
- Free to distribute and share with others
- Free for commercial use if needed in the future
- Attribution required: Please credit this project when using it in academic work
This permissive license encourages collaboration and knowledge sharing in the academic community while allowing maximum flexibility for researchers and educators.
