flixOpt
Python-based optimization framework designed to tackle energy and material flow problems using mixed-integer linear programming (MILP) and provides a powerful platform for both dispatch and investment optimization challenges.
https://github.com/flixopt/flixopt
Category: Energy Systems
Sub Category: Energy System Modeling Frameworks
Keywords
climate-change energy energy-system energy-system-modeling energy-systems linear-programming mathematical-modelling milp mixed-integer-linear-programming modeling optimisation optimization python renewables
Keywords from Contributors
profile animations stress-test atoms geocoder domain-modeling contributing feature-toggle
Last synced: about 17 hours ago
JSON representation
Repository metadata
Vector based Energy Optimization Framework
- Host: GitHub
- URL: https://github.com/flixopt/flixopt
- Owner: flixOpt
- License: mit
- Created: 2022-09-23T09:58:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-12-16T21:55:24.000Z (8 days ago)
- Last Synced: 2025-12-16T21:58:51.687Z (8 days ago)
- Topics: climate-change, energy, energy-system, energy-system-modeling, energy-systems, linear-programming, mathematical-modelling, milp, mixed-integer-linear-programming, modeling, optimisation, optimization, python, renewables
- Language: Python
- Homepage: https://flixopt.github.io/flixopt/
- Size: 49.2 MB
- Stars: 14
- Watchers: 2
- Forks: 9
- Open Issues: 63
- Releases: 39
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.cff
- Roadmap: docs/roadmap.md
README.md
FlixOpt: Energy and Material Flow Optimization Framework
FlixOpt is a Python framework for optimizing energy and material flow systems - from district heating networks to industrial production lines, from renewable energy portfolios to supply chain logistics.
Start simple, scale complex: Build a working optimization model in minutes, then progressively add detail - multi-period investments, stochastic scenarios, custom constraints - without rewriting your code.
🚀 Quick Start
pip install flixopt
That's it! FlixOpt comes with the HiGHS solver included. You're ready to optimize.
The basic workflow:
import flixopt as fx
# 1. Define your system structure
flow_system = fx.FlowSystem(timesteps)
flow_system.add_elements(buses, components, effects)
# 2. Create and solve
calculation = fx.FullCalculation("MyModel", flow_system)
calculation.solve()
# 3. Analyze results
calculation.results.solution
Get started with real examples:
- 📚 Full Documentation
- 💡 Examples Gallery - Complete working examples from simple to complex
- 🔧 API Reference
🌟 Why FlixOpt?
Progressive Enhancement - Your Model Grows With You
Start simple:
# Basic single-period model
flow_system = fx.FlowSystem(timesteps)
boiler = fx.Boiler("Boiler", eta=0.9, ...)
Add complexity incrementally:
- Investment decisions → Add
InvestParametersto components - Multi-period planning → Add
periodsdimension to FlowSystem - Uncertainty modeling → Add
scenariosdimension with probabilities - Custom constraints → Extend with native linopy syntax
No refactoring required. Your component definitions stay the same - periods, scenarios, and features are added as dimensions and parameters.
→ Learn more about multi-period and stochastic modeling
For Everyone
- Beginners: High-level components that "just work"
- Experts: Full access to modify models with linopy
- Researchers: Quick prototyping with customization options
- Engineers: Reliable, tested components without black boxes
- Students: Clear, Pythonic interfaces for learning optimization
Key Features
Multi-criteria optimization: Model costs, emissions, resource use - any custom metric. Optimize single objectives or use weighted combinations and ε-constraints.
→ Effects documentation
Performance at any scale: Choose calculation modes without changing your model - Full, Segmented, or Aggregated (using TSAM).
→ Calculation modes
Built for reproducibility: Self-contained NetCDF result files with complete model information. Load results months later - everything is preserved.
→ Results documentation
Flexible data operations: Transform FlowSystems with xarray-style operations (sel(), resample()) for multi-stage optimization.
🎯 What is FlixOpt?
A General-Purpose Flow Optimization Framework
FlixOpt models any system involving flows and conversions:
- Energy systems: District heating/cooling, microgrids, renewable portfolios, sector coupling
- Material flows: Supply chains, production lines, chemical processes
- Integrated systems: Water-energy nexus, industrial symbiosis
While energy systems are our primary focus, the same foundation applies universally. This enables coupling different system types within integrated models.
Modern Foundations
Built on linopy and xarray, FlixOpt delivers performance and transparency. Full access to variables, constraints, and model structure. Extend anything with native linopy syntax.
Our Position
We bridge the gap between high-level strategic models (like FINE) and low-level dispatch tools - similar to PyPSA. FlixOpt is the sweet spot for detailed operational planning and long-term investment analysis in the same framework.
Academic Roots
Originally developed at TU Dresden for the SMARTBIOGRID project (funded by the German Federal Ministry for Economic Affairs and Energy, FKZ: 03KB159B). FlixOpt evolved from the MATLAB-based flixOptMat framework while incorporating best practices from oemof/solph.
🛣️ Roadmap
FlixOpt aims to be the most accessible, flexible, and universal Python framework for energy and material flow optimization. We believe optimization modeling should be approachable for beginners yet powerful for experts, minimizing context switching between different planning horizons.
Current focus:
- Enhanced component library (sector coupling, hydrogen, thermal networks)
- Examples showcasing multi-period and stochastic modeling
- Advanced result analysis and visualization
Future vision:
- Modeling to generate alternatives (MGA) for robust decision-making
- Advanced stochastic optimization (two-stage, CVaR)
- Community ecosystem of user-contributed components
🛠️ Installation
Basic Installation
pip install flixopt
Includes the HiGHS solver - you're ready to optimize immediately.
Full Installation
For additional features (interactive network visualization, time series aggregation):
pip install "flixopt[full]"
Solver Support
FlixOpt supports many solvers via linopy: HiGHS (included), Gurobi, CPLEX, CBC, GLPK, and more.
🤝 Contributing
FlixOpt thrives on community input. Whether you're fixing bugs, adding components, improving docs, or sharing use cases - we welcome your contributions.
📖 Citation
If FlixOpt supports your research or project, please cite:
- Main Citation: DOI:10.18086/eurosun.2022.04.07
- Short Overview: DOI:10.13140/RG.2.2.14948.24969
📄 License
MIT License - See LICENSE for details.
GitHub Events
Total
- Create event: 156
- Issues event: 55
- Release event: 21
- Delete event: 117
- Issue comment event: 209
- Push event: 592
- Pull request review event: 148
- Pull request event: 215
- Pull request review comment event: 195
- Fork event: 2
Last Year
- Create event: 156
- Issues event: 55
- Release event: 21
- Delete event: 117
- Issue comment event: 209
- Push event: 592
- Pull request review event: 148
- Pull request event: 215
- Pull request review comment event: 195
- Fork event: 2
Committers metadata
Last synced: about 2 months ago
Total Commits: 1,946
Total Committers: 7
Avg Commits per committer: 278.0
Development Distribution Score (DDS): 0.123
Commits in past year: 954
Committers in past year: 5
Avg Commits per committer in past year: 190.8
Development Distribution Score (DDS) in past year: 0.05
| Name | Commits | |
|---|---|---|
| FBumann | 1****n | 1706 |
| fpanitz | F****z@t****e | 127 |
| baumbude | b****e@g****m | 62 |
| renovate[bot] | 2****] | 18 |
| PStange | 6****e | 16 |
| fel15133 | f****z@i****e | 11 |
| Felix Panitz | f****z@t****e | 6 |
Committer domains:
Issue and Pull Request metadata
Last synced: about 2 months ago
Total issues: 124
Total pull requests: 405
Average time to close issues: 2 months
Average time to close pull requests: 7 days
Total issue authors: 8
Total pull request authors: 6
Average comments per issue: 1.45
Average comments per pull request: 0.96
Merged pull request: 265
Bot issues: 3
Bot pull requests: 20
Past year issues: 96
Past year pull requests: 364
Past year average time to close issues: 26 days
Past year average time to close pull requests: 8 days
Past year issue authors: 8
Past year pull request authors: 6
Past year average comments per issue: 1.35
Past year average comments per pull request: 1.06
Past year merged pull request: 241
Past year bot issues: 3
Past year bot pull requests: 20
Top Issue Authors
- FBumann (104)
- baumbude (7)
- PStange (5)
- renovate[bot] (3)
- PRse4 (2)
- JonaGL (1)
- dizont (1)
- brokenwings01 (1)
Top Pull Request Authors
- FBumann (360)
- baumbude (21)
- renovate[bot] (17)
- PStange (3)
- coderabbitai[bot] (3)
- lucysbrokenwings (1)
Top Issue Labels
- New functionality (25)
- bug (13)
- improvement (10)
- enhancement (9)
- change (8)
- Improvement (8)
- Not in Focus (6)
- documentation (4)
- discuss (3)
- dependencies (3)
- help wanted (1)
- Bugfix (1)
- wontfix (1)
Top Pull Request Labels
- New functionality (12)
- dependencies (12)
- bug (9)
- Not in Focus (9)
- enhancement (7)
- improvement (5)
- documentation (2)
- revisit (2)
- Bugfix (1)
Package metadata
- Total packages: 3
-
Total downloads:
- pypi: 1,267 last-month
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 0 (may contain duplicates)
- Total versions: 102
- Total maintainers: 1
proxy.golang.org: github.com/flixOpt/flixOpt
- Homepage:
- Documentation: https://pkg.go.dev/github.com/flixOpt/flixOpt#section-documentation
- Licenses: mit
- Latest release: v3.2.1+incompatible (published about 2 months ago)
- Last Synced: 2025-10-29T20:21:03.442Z (about 2 months ago)
- Versions: 38
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
proxy.golang.org: github.com/flixopt/flixopt
- Homepage:
- Documentation: https://pkg.go.dev/github.com/flixopt/flixopt#section-documentation
- Licenses: mit
- Latest release: v3.2.1+incompatible (published about 2 months ago)
- Last Synced: 2025-10-29T20:21:10.416Z (about 2 months ago)
- Versions: 38
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
pypi.org: flixopt
Vector based energy and material flow optimization framework in Python.
- Homepage:
- Documentation: https://flixopt.readthedocs.io/
- Licenses: mit
- Latest release: 3.2.1 (published about 2 months ago)
- Last Synced: 2025-10-29T20:20:59.514Z (about 2 months ago)
- Versions: 26
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 1,267 Last month
-
Rankings:
- Dependent packages count: 9.463%
- Average: 31.377%
- Dependent repos count: 53.292%
- Maintainers (1)
Score: 13.434911705906169