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 15 hours ago
JSON representation

Repository metadata

Vector based Energy Optimization Framework

README.md

FlixOpt: Progressive Flow System Optimization

Documentation
Build Status
PyPI version
PyPI status
Python Versions
License: MIT
PyPI downloads
GitHub last commit
GitHub issues
Ruff
Powered by linopy
Powered by xarray
DOI
DOI
GitHub stars


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:


🌟 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 InvestParameters to components
  • Multi-period planning → Add periods dimension to FlowSystem
  • Uncertainty modeling → Add scenarios dimension 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

Full roadmap and vision


🛠️ 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.

Installation guide


🤝 Contributing

FlixOpt thrives on community input. Whether you're fixing bugs, adding components, improving docs, or sharing use cases - we welcome your contributions.

Contribution guide


📖 Citation

If FlixOpt supports your research or project, please cite:

To pinpoint which version you used in your work, please reference one of these doi's here:

  • DOI

📄 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
Last Year

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 Email 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

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/flixopt/flixopt

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

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