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 10 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: 2026-03-18T09:48:00.000Z (18 days ago)
- Last Synced: 2026-03-19T00:50:50.916Z (17 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: 120 MB
- Stars: 17
- Watchers: 2
- Forks: 9
- Open Issues: 65
- Releases: 81
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.cff
- Roadmap: docs/roadmap.md
README.md
FlixOpt: Progressive Flow System Optimization
FlixOpt is a Python framework for progressive flow system optimization - from district heating networks to industrial production lines, from renewable energy portfolios to supply chain logistics.
Build simple models quickly, then incrementally add investment decision, multi-period planning, stochastic scenarios, and custom constraints without refactoring.
🚀 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. Optimize
flow_system.optimize(fx.solvers.HighsSolver())
# 3. Analyze results
flow_system.solution # Raw xarray Dataset
flow_system.stats # Convenient analysis accessor
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.linear_converters.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 optimization modes without changing your model - full optimization, rolling horizon, or clustering (using TSAM).
→ Scaling notebooks
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
To pinpoint which version you used in your work, please reference one of these doi's here:
📄 License
MIT License - See LICENSE for details.
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below and consider citing the related publication."
type: software
title: "flixopt"
version: 6.1.0
date-released: 2026-03-17
url: "https://github.com/flixOpt/flixopt"
repository-code: "https://github.com/flixOpt/flixopt"
license: MIT
abstract: "FlixOpt (Flexible, Low-entry, Investment, X-sector OPTimization) is a comprehensive framework for modeling and optimizing energy and material flow systems in Python. It enables optimization of diverse applications including district heating networks, industrial production lines, renewable energy portfolios, and supply chain logistics. Built on modern scientific Python stack (linopy and xarray), it provides a progressive enhancement approach allowing users to start with simple models and incrementally add complexity such as multi-period investments, stochastic scenarios, and custom constraints. The framework simplifies the creation of global constraints and switching objectives through its 'effect' concept. The framework is designed for researchers and engineers in energy systems, industrial process optimization, and operations research."
keywords:
- optimization
- energy systems
- energy flow modeling
- linear programming
- mixed-integer programming
- MILP
- operations research
- python
- district heating
- renewable energy
- multi-period optimization
- investment optimization
- capacity planning
- energy modeling
- sector coupling
- energy transition
- industrial processes
- stochastic optimization
- linopy
- xarray
authors:
- family-names: Bumann
given-names: Felix
email: felixbumann387@gmail.com
affiliation: "SachsenEnergie AG"
orcid: "https://orcid.org/0009-0006-0765-4789"
- family-names: Panitz
given-names: Felix
email: baumbude@googlemail.com
affiliation: "Fraunhofer Research Institution for Energy Infrastructures and Geotechnologies IEG"
orcid: "https://orcid.org/0009-0007-7030-6987"
- family-names: Stange
given-names: Peter
email: peter.stange@tu-dresden.de
affiliation: "Chair of Building Energy Systems and Heat Supply, TU Dresden"
orcid: "https://orcid.org/0009-0001-6407-1495"
identifiers:
- type: doi
value: "10.18086/eurosun.2022.04.07"
description: "Software-supported Investment Optimization for District Heating Supply Systems"
- type: url
value: "https://flixopt.github.io/flixopt/latest/"
description: "Documentation"
- type: url
value: "https://pypi.org/project/flixopt/"
description: "PyPI package"
references:
- type: conference-paper
authors:
- family-names: Panitz
given-names: Felix
- family-names: Behrends
given-names: Tim
- family-names: Stange
given-names: Peter
title: "Software-supported Investment Optimization for District Heating Supply Systems"
year: 2022
conference:
name: "EuroSun 2022"
doi: "10.18086/eurosun.2022.04.07"
GitHub Events
Total
- Release event: 32
- Delete event: 164
- Pull request event: 305
- Fork event: 3
- Issues event: 60
- Issue comment event: 289
- Push event: 1188
- Pull request review event: 254
- Pull request review comment event: 293
- Create event: 236
Last Year
- Release event: 26
- Delete event: 155
- Pull request event: 282
- Fork event: 3
- Issues event: 58
- Issue comment event: 270
- Push event: 1103
- Pull request review event: 239
- Pull request review comment event: 284
- Create event: 215
Committers metadata
Last synced: 13 days ago
Total Commits: 2,259
Total Committers: 8
Avg Commits per committer: 282.375
Development Distribution Score (DDS): 0.134
Commits in past year: 534
Committers in past year: 6
Avg Commits per committer in past year: 89.0
Development Distribution Score (DDS) in past year: 0.157
| Name | Commits | |
|---|---|---|
| FBumann | 1****n | 1957 |
| fpanitz | F****z@t****e | 127 |
| baumbude | b****e@g****m | 62 |
| renovate[bot] | 2****] | 47 |
| github-actions[bot] | 4****] | 33 |
| 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: 15 days ago
Total issues: 124
Total pull requests: 448
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: 1.05
Merged pull request: 286
Bot issues: 3
Bot pull requests: 35
Past year issues: 52
Past year pull requests: 262
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 11 days
Past year issue authors: 7
Past year pull request authors: 6
Past year average comments per issue: 1.17
Past year average comments per pull request: 1.23
Past year merged pull request: 146
Past year bot issues: 3
Past year bot pull requests: 35
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 (387)
- renovate[bot] (32)
- baumbude (21)
- PStange (3)
- coderabbitai[bot] (3)
- lucysbrokenwings (2)
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
- dependencies (27)
- New functionality (12)
- Not in Focus (10)
- bug (9)
- enhancement (7)
- improvement (5)
- documentation (2)
- revisit (2)
- Bugfix (1)
- breaking-change-risk (1)
- calver (1)
Package metadata
- Total packages: 3
-
Total downloads:
- pypi: 848 last-month
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 0 (may contain duplicates)
- Total versions: 208
- 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: v6.1.0+incompatible (published 19 days ago)
- Last Synced: 2026-03-23T19:02:29.573Z (13 days ago)
- Versions: 68
- 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: v6.1.0+incompatible (published 19 days ago)
- Last Synced: 2026-03-23T19:02:31.918Z (13 days ago)
- Versions: 69
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
pypi.org: flixopt
Progressive flow system optimization in Python - start simple, scale to complex.
- Homepage:
- Documentation: https://flixopt.readthedocs.io/
- Licenses: MIT
- Latest release: 6.1.0 (published 19 days ago)
- Last Synced: 2026-03-23T19:02:29.585Z (13 days ago)
- Versions: 71
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 848 Last month
-
Rankings:
- Dependent packages count: 9.463%
- Average: 31.377%
- Dependent repos count: 53.292%
- Maintainers (1)
Score: 13.230219975255437