2.4 KiB
2.4 KiB
Transformer Optimizer Web App
A Flask-based web application for optimizing transformer designs and running manual simulations.
Pages
1. Optimizer (http://localhost:5000/)
Automatically finds the best tap configuration and input voltage to maximize efficiency.
2. Manual Simulation (http://localhost:5000/manual)
Directly specify tap settings and input voltage to see performance results.
Features
Optimizer Page
-
Interactive Sliders for all parameters:
- Load resistance (5Ω to 10kΩ)
- Target power output (1W to 100W)
- Operating frequency (100Hz to 50kHz)
- Core loss (0W to 5W)
- Maximum flux density (0.05T to 0.5T)
- Maximum secondary voltage (10V to 500V)
- Input voltage range (min/max)
-
Real-time Optimization using the transformer optimizer
Manual Simulation Page
- Tap Selection: Choose primary and secondary taps from dropdowns
- Input Parameters: Set input voltage and frequency with sliders
- Load Conditions: Configure load resistance and core loss
Both Pages Display:
- Efficiency (color-coded: green >90%, yellow >80%, red <80%)
- Tap selections with turn counts
- All voltages and currents
- Separate copper losses for primary and secondary
- Flux density and turns ratio
- Input and output power
Installation
- Install dependencies:
pip install -r requirements.txt
Running the App
python app.py
Then open your browser to: http://localhost:5000
Configuration
Edit app.py and modify the get_default_transformer() function to match your transformer specifications:
- Tap positions
- Core area
- Turn counts
- Resistance per turn for each segment
API Endpoints
GET /- Optimizer pageGET /manual- Manual simulation pagePOST /api/optimize- Run optimization with parametersPOST /api/simulate- Run manual simulationGET /api/transformer_info- Get transformer configuration
Usage
Optimizer Mode
- Adjust sliders to set your desired operating conditions
- Click "⚡ Optimize Transformer"
- View the optimized configuration and performance metrics
- The optimizer will find the best tap combination and input voltage to maximize efficiency while meeting your constraints
Manual Simulation Mode
- Select primary and secondary taps from dropdowns
- Adjust input voltage, frequency, load, and core loss with sliders
- Click "▶️ Run Simulation"
- View the performance results for your specified configuration