Open and run in Colab (interactive) Edit on Gitlab

Cables

Try this yourself (requires google account)

TOPFARM can use the Electrical Network Design package EDWIN to optimize the carray cabels as well as the substation position at each iteration of the layout optimization

Install TOPFARM if needed

[1]:
# Install TopFarm if needed
import importlib
if not importlib.util.find_spec("topfarm"):
    !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/TopFarm2.git
[2]:
# Install EDWIN if needed
import importlib
if not importlib.util.find_spec("ed_win"):
    !pip install git+https://gitlab.windenergy.dtu.dk/TOPFARM/edwin.git#egg=ed_win[interarray]
DEPRECATION: git+https://gitlab.windenergy.dtu.dk/TOPFARM/edwin.git#egg=ed_win[interarray] contains an egg fragment with a non-PEP 508 name pip 25.0 will enforce this behaviour change. A possible replacement is to use the req @ url syntax, and remove the egg fragment. Discussion can be found at https://github.com/pypa/pip/issues/11617
Collecting ed_win (from ed_win[interarray])
  Cloning https://gitlab.windenergy.dtu.dk/TOPFARM/edwin.git to /tmp/pip-install-xq1gd_3_/ed-win_83a81f82270340228ecd8b7800f6a7ab
  Running command git clone --filter=blob:none --quiet https://gitlab.windenergy.dtu.dk/TOPFARM/edwin.git /tmp/pip-install-xq1gd_3_/ed-win_83a81f82270340228ecd8b7800f6a7ab
  Resolved https://gitlab.windenergy.dtu.dk/TOPFARM/edwin.git to commit 517099b186a093556129aa75c968924861f9b9b1
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... - \ done
Requirement already satisfied: networkx in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ed_win->ed_win[interarray]) (3.4.2)
Requirement already satisfied: matplotlib in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ed_win->ed_win[interarray]) (3.10.0)
Requirement already satisfied: shapely in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ed_win->ed_win[interarray]) (2.0.6)
Requirement already satisfied: numpy in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ed_win->ed_win[interarray]) (2.2.1)
Requirement already satisfied: xarray in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ed_win->ed_win[interarray]) (2024.11.0)
Requirement already satisfied: scipy in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ed_win->ed_win[interarray]) (1.14.1)
Collecting windIO (from ed_win->ed_win[interarray])
  Downloading windIO-1.0-py3-none-any.whl.metadata (533 bytes)
Collecting openpyxl (from ed_win->ed_win[interarray])
  Downloading openpyxl-3.1.5-py2.py3-none-any.whl.metadata (2.5 kB)
Collecting pony (from ed_win->ed_win[interarray])
  Downloading pony-0.7.19-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: pyyaml in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ed_win->ed_win[interarray]) (6.0.2)
Collecting utm (from ed_win->ed_win[interarray])
  Downloading utm-0.8.1-py3-none-any.whl.metadata (5.2 kB)
Collecting pyomo (from ed_win->ed_win[interarray])
  Downloading pyomo-6.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (8.2 kB)
Collecting loguru (from ed_win->ed_win[interarray])
  Downloading loguru-0.7.3-py3-none-any.whl.metadata (22 kB)
Collecting numba (from ed_win->ed_win[interarray])
  Downloading numba-0.61.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.8 kB)
Collecting ortools (from ed_win->ed_win[interarray])
  Downloading ortools-9.12.4544-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (3.3 kB)
Collecting svg.py (from ed_win->ed_win[interarray])
  Downloading svg_py-1.5.0-py3-none-any.whl.metadata (2.1 kB)
Requirement already satisfied: contourpy>=1.0.1 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (4.55.3)
Requirement already satisfied: kiwisolver>=1.3.1 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (1.4.7)
Requirement already satisfied: packaging>=20.0 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (24.2)
Requirement already satisfied: pillow>=8 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (11.0.0)
Requirement already satisfied: pyparsing>=2.3.1 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (3.2.0)
Requirement already satisfied: python-dateutil>=2.7 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from matplotlib->ed_win->ed_win[interarray]) (2.9.0.post0)
Collecting llvmlite<0.45,>=0.44.0dev0 (from numba->ed_win->ed_win[interarray])
  Downloading llvmlite-0.44.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.8 kB)
Collecting numpy (from ed_win->ed_win[interarray])
  Downloading numpy-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB)
Collecting et-xmlfile (from openpyxl->ed_win->ed_win[interarray])
  Downloading et_xmlfile-2.0.0-py3-none-any.whl.metadata (2.7 kB)
Collecting absl-py>=2.0.0 (from ortools->ed_win->ed_win[interarray])
  Downloading absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB)
Requirement already satisfied: pandas>=2.0.0 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from ortools->ed_win->ed_win[interarray]) (2.2.3)
Collecting protobuf<5.30,>=5.29.3 (from ortools->ed_win->ed_win[interarray])
  Downloading protobuf-5.29.3-cp38-abi3-manylinux2014_x86_64.whl.metadata (592 bytes)
Collecting immutabledict>=3.0.0 (from ortools->ed_win->ed_win[interarray])
  Downloading immutabledict-4.2.1-py3-none-any.whl.metadata (3.5 kB)
Collecting ply (from pyomo->ed_win->ed_win[interarray])
  Downloading ply-3.11-py2.py3-none-any.whl.metadata (844 bytes)
Requirement already satisfied: jsonschema in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from windIO->ed_win->ed_win[interarray]) (4.23.0)
Requirement already satisfied: pytz>=2020.1 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from pandas>=2.0.0->ortools->ed_win->ed_win[interarray]) (2024.2)
Requirement already satisfied: tzdata>=2022.7 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from pandas>=2.0.0->ortools->ed_win->ed_win[interarray]) (2024.2)
Requirement already satisfied: six>=1.5 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib->ed_win->ed_win[interarray]) (1.17.0)
Requirement already satisfied: attrs>=22.2.0 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from jsonschema->windIO->ed_win->ed_win[interarray]) (24.3.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from jsonschema->windIO->ed_win->ed_win[interarray]) (2024.10.1)
Requirement already satisfied: referencing>=0.28.4 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from jsonschema->windIO->ed_win->ed_win[interarray]) (0.35.1)
Requirement already satisfied: rpds-py>=0.7.1 in /builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages (from jsonschema->windIO->ed_win->ed_win[interarray]) (0.22.3)
Downloading loguru-0.7.3-py3-none-any.whl (61 kB)
Downloading numba-0.61.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 20.2 MB/s eta 0:00:00
Downloading numpy-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.3/16.3 MB 59.2 MB/s eta 0:00:00
Downloading openpyxl-3.1.5-py2.py3-none-any.whl (250 kB)
Downloading ortools-9.12.4544-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (24.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24.9/24.9 MB 67.8 MB/s eta 0:00:00
Downloading pony-0.7.19-py3-none-any.whl (317 kB)
Downloading pyomo-6.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 24.9 MB/s eta 0:00:00
Downloading svg_py-1.5.0-py3-none-any.whl (13 kB)
Downloading utm-0.8.1-py3-none-any.whl (8.6 kB)
Downloading windIO-1.0-py3-none-any.whl (9.9 kB)
Downloading absl_py-2.1.0-py3-none-any.whl (133 kB)
Downloading immutabledict-4.2.1-py3-none-any.whl (4.7 kB)
Downloading llvmlite-0.44.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.4/42.4 MB 57.3 MB/s eta 0:00:00
Downloading protobuf-5.29.3-cp38-abi3-manylinux2014_x86_64.whl (319 kB)
Downloading et_xmlfile-2.0.0-py3-none-any.whl (18 kB)
Downloading ply-3.11-py2.py3-none-any.whl (49 kB)
Building wheels for collected packages: ed_win
  Building wheel for ed_win (setup.py) ... - \ | / done
  Created wheel for ed_win: filename=ed_win-1.1.0-py3-none-any.whl size=265696 sha256=cb369e94e8435ed29e2fea3dc255535ed0844d3821cf8aa29a57c620dd1eaef4
  Stored in directory: /tmp/pip-ephem-wheel-cache-h_7igx6z/wheels/bc/ea/b6/b70d8e62956a2409861bbe10e92ed58cb22b35caaa9ca20551
Successfully built ed_win
Installing collected packages: pony, ply, utm, svg.py, pyomo, protobuf, numpy, loguru, llvmlite, immutabledict, et-xmlfile, absl-py, openpyxl, numba, ortools, windIO, ed_win
  Attempting uninstall: numpy
    Found existing installation: numpy 2.2.1
    Uninstalling numpy-2.2.1:
      Successfully uninstalled numpy-2.2.1
Successfully installed absl-py-2.1.0 ed_win-1.1.0 et-xmlfile-2.0.0 immutabledict-4.2.1 llvmlite-0.44.0 loguru-0.7.3 numba-0.61.0 numpy-2.1.3 openpyxl-3.1.5 ortools-9.12.4544 ply-3.11 pony-0.7.19 protobuf-5.29.3 pyomo-6.9.1 svg.py-1.5.0 utm-0.8.1 windIO-1.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

Import

[3]:
import numpy as np
from scipy.interpolate import RegularGridInterpolator
import matplotlib.pyplot as plt

from topfarm.constraint_components.spacing import SpacingConstraint
from topfarm.constraint_components.boundary import XYBoundaryConstraint
from topfarm.easy_drivers import EasyScipyOptimizeDriver
from topfarm.cost_models.cost_model_wrappers import CostModelComponent
from topfarm._topfarm import TopFarmProblem, TopFarmGroup
from topfarm.cost_models.py_wake_wrapper import PyWakeAEPCostModelComponent
from topfarm.plotting import XYPlotComp
from topfarm.utils import plot_list_recorder
from topfarm.cost_models.economic_models.dtu_wind_cm_main import economic_evaluation

from py_wake.examples.data.iea37._iea37 import IEA37_WindTurbines
from py_wake import BastankhahGaussian
from py_wake.examples.data.hornsrev1 import Hornsrev1Site

from ed_win.wind_farm_network import WindFarmNetwork

Site

[4]:
n_wt = 30
initial = np.asarray([np.random.random(30)*6000, np.random.random(30)*-10000]).T
x_init = initial[:,0]
y_init = initial[:,1]
boundary = np.array([(0, 0), (6000, 0), (6000, -10000), (0, -10000)])  # turbine boundaries
drivers = [EasyScipyOptimizeDriver(maxiter=10)]
windTurbines = IEA37_WindTurbines()
site = Hornsrev1Site()
wfm = BastankhahGaussian(site, windTurbines)

/builds/TOPFARM/TopFarm2/.pixi/envs/default/lib/python3.11/site-packages/py_wake/deficit_models/gaussian.py:124: UserWarning: The BastankhahGaussian model is not representative of the setup used in the literature. For this, use py_wake.literature.gaussian_models.Bastankhah_PorteAgel_2014 instead
  DeprecatedModel.__init__(self, 'py_wake.literature.gaussian_models.Bastankhah_PorteAgel_2014')

Bathymetry

[5]:
sigma = 3000.0
mu = 0.0

x_peak_1 = 1000
y_peak_1 = -1000
x_peak_2 = 4000
y_peak_2 = -8000
x1, y1 = np.meshgrid(np.linspace(0 - x_peak_1, 6000- x_peak_1, 100), np.linspace(-10000 - y_peak_1, 0 - y_peak_1, 100))
d1 = np.sqrt(x1*x1 + y1*y1)
g1 = np.exp(-((d1 - mu)**2 / (2.0 * sigma**2)))
x2, y2 = np.meshgrid(np.linspace(0 - x_peak_2, 6000- x_peak_2, 100), np.linspace(-10000 - y_peak_2, 0 - y_peak_2, 100))
d2 = np.sqrt(x2*x2 + y2*y2)
g2 = np.exp(-((d2 - mu)**2 / (2.0 * sigma**2)))
g = 5 * g1 - 8 * g2 - 30

plt.imshow(g, extent=(-1000, 7000, -11000, 1000), origin='lower', cmap='viridis')
plt.colorbar()
plt.title('2D Gaussian Function')
plt.show()

x = np.linspace(-1000, 7000, 100)
y = np.linspace(-11000, 1000, 100)

f = RegularGridInterpolator((x, y), g)
../_images/notebooks_cables_11_0.png

Cables

[6]:
x_ss_init = x_init.mean()
y_ss_init = y_init.mean()
turbines_pos=np.asarray([x_init, y_init]).T
substations_pos = np.asarray([[x_ss_init], [y_ss_init]]).T

cables = np.array([[500, 3, 100], [800, 5, 150], [1000, 10, 250]])  # Here you set up cables [<cable cross section>, <number of turbines can be connected>, <price in € per meter>]

wfn = WindFarmNetwork(turbines_pos=turbines_pos, substations_pos=substations_pos, cables=cables)
G = wfn.optimize(turbines_pos)
cable_cost_ref = G.size(weight="cost")  # euro
cable_length_ref = G.size(weight="length")  # m
cost_per_length_ref = cable_cost_ref / cable_length_ref # euro / m

G.plot()
Solving with heuristic(cpew)

[6]:
<Axes: >
../_images/notebooks_cables_13_2.png

Economy

[7]:
Drotor_vector = [windTurbines.diameter()] * n_wt
power_rated_vector = [float(windTurbines.power(20))*1e-6] * n_wt
hub_height_vector = [windTurbines.hub_height()] * n_wt

# add additional cost model inputs for shore distance, energy price, project lifetime, rated rotor speed and water depth
distance_from_shore = 30         # [km]
energy_price = 0.1               # [Euro/kWh] What we get per kWh
project_duration = 25            # [years]
rated_rpm_array = [12] * n_wt    # [rpm]
simres = wfm(x_init, y_init)
aep = simres.aep().values.sum()
CF = aep / (windTurbines.power(20)*1e-9 * 24*365*n_wt)

eco_eval = economic_evaluation(distance_from_shore, energy_price, project_duration)
npv_ref = eco_eval.calculate_npv(rated_rpm_array, Drotor_vector, power_rated_vector, hub_height_vector, 30, aep/n_wt * np.ones(n_wt)*10**6, cabling_cost=cable_cost_ref)

Python Functions

[8]:
# Water Depth
def water_depth_func(x, y, **kwargs):
    xnew, ynew = np.meshgrid(x, y)
    points = np.array([xnew.flatten(), ynew.flatten()]).T
    return - np.diag(f(points).reshape(n_wt, n_wt).T)

# Cables
def cable_func(x, y, x_substation, y_substation, **kwargs):
    G = wfn.optimize(turbines_pos= np.asarray([x, y]).T, substations_pos=np.asarray([[float(x_substation[0])], [float(y_substation[0])]]).T)
    return G.size(weight="cost"), {'cabling_length': G.size(weight="length")}

# Economy
def npv_func(AEP, water_depth, cabling_cost, **kwargs):
    eco_eval.calculate_npv(rated_rpm_array, Drotor_vector, power_rated_vector, hub_height_vector, water_depth, AEP/n_wt * np.ones(n_wt)*10**6, cabling_cost=cabling_cost)
    eco_eval.calculate_irr(rated_rpm_array, Drotor_vector, power_rated_vector, hub_height_vector, water_depth, AEP/n_wt * np.ones(n_wt)*10**6, cabling_cost=cabling_cost)
    CAPEX = eco_eval.project_costs_sums["CAPEX"]
    OPEX = eco_eval.project_costs_sums["OPEX"]
    return eco_eval.NPV, {'irr': eco_eval.IRR,
                          'OPEX': OPEX,
                          'CAPEX': CAPEX,}

Components

[9]:
# Water Depth
water_depth_component = CostModelComponent(input_keys=[('x', x_init),('y', y_init)],
                                          n_wt=n_wt,
                                          cost_function=water_depth_func,
                                          objective=False,
                                          output_keys=[('water_depth', np.zeros(n_wt))])

# Cables
cable_component = CostModelComponent(input_keys=[('x', x_init),('y', y_init), ('x_substation', x_ss_init), ('y_substation', y_ss_init)],
                                     n_wt=n_wt,
                                     cost_function=cable_func,
                                     objective=False,
                                     output_keys=[('cabling_cost', 0)],
                                     additional_output=[('cabling_length', 0)])

# Economy
npv_comp = CostModelComponent(input_keys=[('AEP', 0), ('water_depth', 30*np.ones(n_wt)), ('cabling_cost', 100000)],
                              n_wt=n_wt,
                              cost_function=npv_func,
                              objective=True,
                              maximize=True,
                              output_keys=[('npv', 0)],
                              additional_output=[('irr', 0),
                                                 ('CAPEX', 0),
                                                 ('OPEX', 0)])

# AEP
aep_comp = PyWakeAEPCostModelComponent(wfm, n_wt, objective=False)

Problem Assembly

[10]:
cost_comp = TopFarmGroup([PyWakeAEPCostModelComponent(wfm, n_wt, objective=False), water_depth_component, cable_component, npv_comp])


tf = TopFarmProblem(
    design_vars=dict(zip('xy', initial.T), x_substation=x_ss_init, y_substation=y_ss_init),
    cost_comp=cost_comp,
    constraints=[XYBoundaryConstraint(boundary),
                 SpacingConstraint(500)
                 ],
    driver=drivers[0],
    plot_comp=XYPlotComp()
)

INFO: checking out_of_order...
INFO:     out_of_order check complete (0.000586 sec).
INFO: checking system...
INFO:     system check complete (0.000024 sec).
INFO: checking solvers...
INFO:     solvers check complete (0.000179 sec).
INFO: checking dup_inputs...
INFO:     dup_inputs check complete (0.000046 sec).
INFO: checking missing_recorders...
INFO:     missing_recorders check complete (0.000004 sec).
INFO: checking unserializable_options...
INFO:     unserializable_options check complete (0.000173 sec).
INFO: checking comp_has_no_outputs...
INFO:     comp_has_no_outputs check complete (0.000047 sec).
INFO: checking auto_ivc_warnings...
INFO:     auto_ivc_warnings check complete (0.000004 sec).

Optimize

[11]:
cost, _, recorder = tf.optimize()

INFO: checking out_of_order...
INFO:     out_of_order check complete (0.000235 sec).
INFO: checking system...
INFO:     system check complete (0.000019 sec).
INFO: checking solvers...
INFO:     solvers check complete (0.000152 sec).
INFO: checking dup_inputs...
INFO:     dup_inputs check complete (0.000041 sec).
INFO: checking missing_recorders...
INFO:     missing_recorders check complete (0.000005 sec).
INFO: checking unserializable_options...
INFO:     unserializable_options check complete (0.000153 sec).
INFO: checking comp_has_no_outputs...
INFO:     comp_has_no_outputs check complete (0.000044 sec).
INFO: checking auto_ivc_warnings...
INFO:     auto_ivc_warnings check complete (0.000003 sec).
Solving with heuristic(cpew)

Ignoring fixed x limits to fulfill fixed data aspect with adjustable data limits.
Ignoring fixed x limits to fulfill fixed data aspect with adjustable data limits.
../_images/notebooks_cables_23_2.png
Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Solving with heuristic(cpew)

Ignoring fixed x limits to fulfill fixed data aspect with adjustable data limits.
Ignoring fixed x limits to fulfill fixed data aspect with adjustable data limits.
Iteration limit reached    (Exit mode 9)
            Current function value: -146791506.4463278
            Iterations: 10
            Function evaluations: 17
            Gradient evaluations: 10
Optimization FAILED.
Iteration limit reached
-----------------------------------
../_images/notebooks_cables_23_6.png

Plot

[12]:
plot_list_recorder(recorder)
/builds/TOPFARM/TopFarm2/topfarm/utils.py:602: UserWarning: The figure layout has changed to tight
  plt.tight_layout()
../_images/notebooks_cables_25_1.png
[13]:
x_opt = recorder['x'][-1]
y_opt = recorder['y'][-1]
x_sub_opt = recorder['x_substation'][-1]
y_sub_opt = recorder['y_substation'][-1]
G = wfn.optimize(np.asarray([x_opt, y_opt]).T,
                 substations_pos=np.asarray([[float(x_sub_opt)], [float(y_sub_opt)]]).T,
                 )
G.plot()

Solving with heuristic(cpew)

[13]:
<Axes: >
../_images/notebooks_cables_26_2.png
[ ]: