Skip to main content

TopFarm Logo

pipeline status coverage report DOI PyPi License Binder

TOPFARM

TOPFARM is a plant-level wind farm optimization framework developed by DTU Wind and Energy Systems. It is built on top of OpenMDAO and integrates with PyWake for aerodynamic wake modelling and OptiWindNet for electrical cable network optimisation.

Features

  • Layout optimization - optimize turbine x/y positions subject to boundary and spacing constraints
  • Type optimization - select turbine types to maximize AEP or economic objectives
  • Hub height optimization - jointly optimize layout and hub heights
  • Nested optimization - chain multiple optimization problems
  • Smart Start - data-driven initialization to avoid poor local optima
  • Multiple drivers - gradient-based (SLSQP, IPOPT), genetic algorithms, stochastic gradient descent
  • Recorders - save and replay full optimization trajectories

Quick Start

import numpy as np
from topfarm import TopFarmProblem
from topfarm.cost_models.cost_model_wrappers import CostModelComponent
from topfarm.easy_drivers import EasyScipyOptimizeDriver
from topfarm.constraint_components.spacing import SpacingConstraint
from topfarm.constraint_components.boundary import XYBoundaryConstraint

n_wt = 4
boundary = [(0, 0), (1000, 0), (1000, 1000), (0, 1000)]

def aep_func(x, y, **kwargs):
    # Replace with a wake model, e.g. PyWake.
    return 4e6 - np.sum((x - 500)**2 + (y - 500)**2)

problem = TopFarmProblem(
    design_vars={'x': (np.zeros(n_wt), 0, 1000), 'y': (np.zeros(n_wt), 0, 1000)},
    cost_comp=CostModelComponent(['x', 'y'], n_wt, aep_func, maximize=True),
    constraints=[SpacingConstraint(200), XYBoundaryConstraint(boundary)],
    driver=EasyScipyOptimizeDriver(),
)
cost, state, recorder = problem.optimize()

Installation

pip install topfarm

For the latest development version:

pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/TopFarm2.git

See the Installation Guide for Conda environments, developer setup, and troubleshooting.

Source Code

The source code and issue tracker are hosted on GitLab (mirror: GitHub).

Documentation

Full documentation, notebooks, and examples are at: https://topfarm.pages.windenergy.dtu.dk/TopFarm2 (mirror: Read the Docs)

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.

Citation

If you use TOPFARM in your research, please cite:

Mads M. Pedersen, Mikkel Friis-Møller, Pierre-Elouan Réthoré, Ernestas Simutis, Riccardo Riva, Julian Quick, Nikolay Krasimirov Dimitrov, Jenni Rinker, & Katherine Dykes. (2025). DTUWindEnergy/TopFarm2: Release of v2.6.1 (Version v2.6.1) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.17540961

You can also cite all versions using the concept DOI 10.5281/zenodo.3247031, which always resolves to the latest release.

Metadata

Release files for topfarm 2.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for topfarm 2.7.1
File Size Uploaded Provenance Actions
topfarm-2.7.1.tar.gz 10.3 MB Without provenance Details for topfarm-2.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for topfarm 2.7.1
File Interpreter ABI Platform Actions
topfarm-2.7.1-py3-none-any.whl Python 3 none any Details for topfarm-2.7.1-py3-none-any.whl

Total release size: 20.0 MB

Release files / topfarm-2.7.1.tar.gz

Download URL topfarm-2.7.1.tar.gz
Size 10.3 MB
Tags Source
SHA-256 checksum
How to use checksums
8419e72052c3f1c54ddf4d0418723edc98edaf80b4bc95cee4d63750f9b976d1
BLAKE2b-256 checksum
How to use checksums
cc458cfbc3d5e33bfa674843939ee595104e03bb74082d9cd7d506c1afc82580
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1

Release files / topfarm-2.7.1-py3-none-any.whl

Download URL topfarm-2.7.1-py3-none-any.whl
Size 9.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e011ca356a8df709c44a3eeb68ba85e1e9360925c8fbcb1ae319fdedcf86a675
BLAKE2b-256 checksum
How to use checksums
a5ff9e3ac605cbf50637ea5b8a233c2b4a47f41ff7b5ad8b9731ae6f4adf6a39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1

Security for topfarm 2.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.7.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page