LUPA is a Python-based GUI application for simulating and analyzing lumped-parameter cardiovascular circuits. Built with Python and Tkinter, it provides an intuitive interface for designing, analyzing, and solving lumped-parameter models.
Lumped-parameter modeling is a powerful tool for simulating complex dynamic systems, especially in fields like bioengineering and cardiovascular research. However, most existing software tools are either:
- difficult to install or configure,
- lack a user-friendly interface,
- or are tailored for electrical circuits without flexibility for physiological contexts.
LUPA aims to fill this gap by providing an intuitive, open-source application for lumped modeling — combining a visual interface with a robust numerical solver. LUPA is focused on cardiovascular analysis which explains most design choices.
- Interactive Circuit Design: Visual circuit editor with drag-and-drop components
- Component Library: Support for various components:
- Resistors (R)
- Capacitors (C)
- Inductors (L)
- Diodes (D)
- Pressure Sources (P)
- Flow Sources (Q)
- Ground connections (G)
- Advanced Solver: Robust numerical solver for circuit analysis
- Time-Domain Simulation: Support for transient analysis
- Multiple Integration Methods: BDF (Backwards Differentiation Formula) and BDF2
- Export Capabilities: Save and load circuit configurations
- Real-time Visualization: Plot results with matplotlib integration
- Python 3.8 or higher
- pip package manager
pip install numpy scipy matplotlib pandas networkxpip install -e .After installation, you can run LUPA from anywhere using:
lupagit clone https://github.com/maximerenault/LUPA.git
cd LUPA
python main.pyLUPA provides a command line interface with the following options:
# Start the GUI application
lupa
# Show version
lupa --version
# Show help
lupa --help
# Open a specific circuit file on startup
lupa path/to/circuit.json- Start the Application: Run
lupaorpython main.pyto launch the GUI - Design Your Circuit: Use the drawing board to place and connect components
- Set Parameters: Configure component values and simulation settings
- Solve: Run the simulation to analyze your circuit
- View Results: Examine the output plots and data
LUPA/
├── elements/ # Circuit element definitions
├── GUI/ # User interface components
├── core/ # Core algorithms
├── utils/ # Utility functions
├── exceptions/ # Custom exception classes
├── tests/ # Test suite
├── icons/ # Application icons
├── main.py # Main application entry point
└── pyproject.toml # Project configuration
pytest tests/black .Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Maxime Renault
- GitHub: @maximerenault
- Built with Python and Tkinter
- Uses NumPy and SciPy for numerical computations
- Matplotlib for visualization
