Skip to main content

Progressive flow system optimization in Python - start simple, scale to complex.

Project description

FlixOpt: Progressive Flow System Optimization

Flexible  •  Low-entry  •  Investment  •  X-sector  •  OPTimization

Model more than costs · Easy to prototype · Based on dispatch · Sector coupling · Mathematical 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. Create and solve
optimization = fx.Optimization("MyModel", flow_system)
optimization.solve(fx.solvers.HighsSolver())

# 3. Analyze results
optimization.results.solution

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.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 - Optimization, SegmentedOptimization, or ClusteredOptimization (using TSAM). → Optimization 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

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flixopt-4.3.5b0.tar.gz (213.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flixopt-4.3.5b0-py3-none-any.whl (200.9 kB view details)

Uploaded Python 3

File details

Details for the file flixopt-4.3.5b0.tar.gz.

File metadata

  • Download URL: flixopt-4.3.5b0.tar.gz
  • Upload date:
  • Size: 213.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flixopt-4.3.5b0.tar.gz
Algorithm Hash digest
SHA256 22c07c3a258d07081372b389e28abfc5c2b514286f5ebad883f4a975b5b51d4e
MD5 eb560b35802f8bc61b6a98a6cb13793f
BLAKE2b-256 22a28e05fcd77ff80c20e2e85fb6a02160876c30d8ac056f845dc2156af0baa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for flixopt-4.3.5b0.tar.gz:

Publisher: release.yaml on flixOpt/flixopt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flixopt-4.3.5b0-py3-none-any.whl.

File metadata

  • Download URL: flixopt-4.3.5b0-py3-none-any.whl
  • Upload date:
  • Size: 200.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flixopt-4.3.5b0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2f0440c660e9ce49dc5baca56236d6445328c7e6a878ab73b0d4661c4ebd0d6
MD5 89a492f58f7ec5a6fdf40ca1b33b83de
BLAKE2b-256 871b575e61e7fe39e2e5882075dde5823e3b1b2ef201c273f5c42ed70d1e04e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for flixopt-4.3.5b0-py3-none-any.whl:

Publisher: release.yaml on flixOpt/flixopt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page