Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ examples/*/logfloris*
*.h5

# Exceptions
!examples/example_inputs/*.csv
!examples/*/inputs/*.csv
examples/lookup-based_wake_steering_florisstandin/inputs/amr_standin_data.csv

Expand Down
2 changes: 2 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ producing:
graphics/wf-power-tracking-plot.png
)

Ramp rate limits are also applied in this example, but can be modified by changing the `ramp_rate_limit` variable in runscript.py or switched off by setting `ramp_rate_limit = None`.

(examples_simplehybrid)=
## simple_hybrid_plant
Example of a wind + solar + battery hybrid power plant using the
Expand Down
Binary file modified docs/graphics/wf-power-tracking-plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8,642 changes: 8,642 additions & 0 deletions examples/example_inputs/noisy_wind_input.csv

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion examples/simple_hybrid_plant/hercules_input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ plant:
interconnect_limit: -1

wind_farm:
component_type: Wind_MesoToPowerPrecomFloris
component_type: WindFarm
wake_method: precomputed
floris_input_file: ../example_inputs/floris_input_10turbine.yaml
wind_input_filename: ../example_inputs/wind_input.csv
turbine_file_name: ../example_inputs/turbine_filter_model.yaml
Expand Down
204 changes: 1 addition & 203 deletions examples/simple_hybrid_plant/plant_power_reference.csv
Original file line number Diff line number Diff line change
@@ -1,205 +1,3 @@
time_utc,plant_power_reference
2018-05-10T12:31:00.000000Z,75000.0
2018-05-10T12:31:10.000000Z,75000.0
2018-05-10T12:32:40.000000Z,75000.0
2018-05-10T12:32:41.000000Z,75000.0
2018-05-10T12:32:43.760000Z,75000.0
2018-05-10T12:32:46.520000Z,75000.0
2018-05-10T12:32:49.280000Z,75000.0
2018-05-10T12:32:52.040000Z,75000.0
2018-05-10T12:32:54.790000Z,75000.0
2018-05-10T12:32:57.550000Z,75000.0
2018-05-10T12:33:00.310000Z,75000.0
2018-05-10T12:33:03.070000Z,75000.0
2018-05-10T12:33:05.830000Z,75000.0
2018-05-10T12:33:08.590000Z,75000.0
2018-05-10T12:33:11.350000Z,75000.0
2018-05-10T12:33:14.110000Z,75000.0
2018-05-10T12:33:16.860000Z,75000.0
2018-05-10T12:33:19.620000Z,75000.0
2018-05-10T12:33:22.380000Z,75000.0
2018-05-10T12:33:25.140000Z,75000.0
2018-05-10T12:33:27.900000Z,75000.0
2018-05-10T12:33:30.660000Z,75000.0
2018-05-10T12:33:33.420000Z,75000.0
2018-05-10T12:33:36.180000Z,75000.0
2018-05-10T12:33:38.930000Z,75000.0
2018-05-10T12:33:41.690000Z,75000.0
2018-05-10T12:33:44.450000Z,75000.0
2018-05-10T12:33:47.210000Z,75000.0
2018-05-10T12:33:49.970000Z,75000.0
2018-05-10T12:33:52.730000Z,75000.0
2018-05-10T12:33:55.490000Z,75000.0
2018-05-10T12:33:58.250000Z,75000.0
2018-05-10T12:34:01.010000Z,75000.0
2018-05-10T12:34:03.760000Z,75000.0
2018-05-10T12:34:06.520000Z,75000.0
2018-05-10T12:34:09.280000Z,75000.0
2018-05-10T12:34:12.040000Z,75000.0
2018-05-10T12:34:14.800000Z,75000.0
2018-05-10T12:34:17.560000Z,75000.0
2018-05-10T12:34:20.320000Z,75000.0
2018-05-10T12:34:23.080000Z,75000.0
2018-05-10T12:34:25.830000Z,75000.0
2018-05-10T12:34:28.590000Z,75000.0
2018-05-10T12:34:31.350000Z,75000.0
2018-05-10T12:34:34.110000Z,75000.0
2018-05-10T12:34:36.870000Z,75000.0
2018-05-10T12:34:39.630000Z,75000.0
2018-05-10T12:34:42.390000Z,75000.0
2018-05-10T12:34:45.150000Z,75000.0
2018-05-10T12:34:47.900000Z,75000.0
2018-05-10T12:34:50.660000Z,75000.0
2018-05-10T12:34:53.420000Z,75000.0
2018-05-10T12:34:56.180000Z,75000.0
2018-05-10T12:34:58.940000Z,75000.0
2018-05-10T12:35:01.700000Z,75000.0
2018-05-10T12:35:04.460000Z,75000.0
2018-05-10T12:35:07.220000Z,75000.0
2018-05-10T12:35:09.970000Z,75000.0
2018-05-10T12:35:12.730000Z,75000.0
2018-05-10T12:35:15.490000Z,75000.0
2018-05-10T12:35:18.250000Z,75000.0
2018-05-10T12:35:21.010000Z,75000.0
2018-05-10T12:35:23.770000Z,75000.0
2018-05-10T12:35:26.530000Z,75000.0
2018-05-10T12:35:29.290000Z,75000.0
2018-05-10T12:35:32.050000Z,75000.0
2018-05-10T12:35:34.800000Z,75000.0
2018-05-10T12:35:37.560000Z,75000.0
2018-05-10T12:35:40.320000Z,75000.0
2018-05-10T12:35:43.080000Z,75000.0
2018-05-10T12:35:45.840000Z,75000.0
2018-05-10T12:35:48.600000Z,75000.0
2018-05-10T12:35:51.360000Z,75000.0
2018-05-10T12:35:54.120000Z,75000.0
2018-05-10T12:35:56.870000Z,75000.0
2018-05-10T12:35:59.630000Z,75000.0
2018-05-10T12:36:02.390000Z,75000.0
2018-05-10T12:36:05.150000Z,75000.0
2018-05-10T12:36:07.910000Z,75000.0
2018-05-10T12:36:10.670000Z,75000.0
2018-05-10T12:36:13.430000Z,75000.0
2018-05-10T12:36:16.190000Z,75000.0
2018-05-10T12:36:18.940000Z,75000.0
2018-05-10T12:36:21.700000Z,75000.0
2018-05-10T12:36:24.460000Z,75000.0
2018-05-10T12:36:27.220000Z,75000.0
2018-05-10T12:36:29.980000Z,75000.0
2018-05-10T12:36:32.740000Z,75000.0
2018-05-10T12:36:35.500000Z,75000.0
2018-05-10T12:36:38.260000Z,75000.0
2018-05-10T12:36:41.020000Z,75000.0
2018-05-10T12:36:43.770000Z,75000.0
2018-05-10T12:36:46.530000Z,75000.0
2018-05-10T12:36:49.290000Z,75000.0
2018-05-10T12:36:52.050000Z,75000.0
2018-05-10T12:36:54.810000Z,75000.0
2018-05-10T12:36:57.570000Z,75000.0
2018-05-10T12:37:00.330000Z,75000.0
2018-05-10T12:37:03.090000Z,75000.0
2018-05-10T12:37:05.840000Z,75000.0
2018-05-10T12:37:08.600000Z,75000.0
2018-05-10T12:37:11.360000Z,75000.0
2018-05-10T12:37:14.120000Z,75000.0
2018-05-10T12:37:16.880000Z,75000.0
2018-05-10T12:37:19.640000Z,75000.0
2018-05-10T12:37:22.400000Z,75000.0
2018-05-10T12:37:25.160000Z,75000.0
2018-05-10T12:37:27.910000Z,75000.0
2018-05-10T12:37:30.670000Z,75000.0
2018-05-10T12:37:33.430000Z,75000.0
2018-05-10T12:37:36.190000Z,75000.0
2018-05-10T12:37:38.950000Z,75000.0
2018-05-10T12:37:41.710000Z,75000.0
2018-05-10T12:37:44.470000Z,75000.0
2018-05-10T12:37:47.230000Z,75000.0
2018-05-10T12:37:49.980000Z,75000.0
2018-05-10T12:37:52.740000Z,75000.0
2018-05-10T12:37:55.500000Z,75000.0
2018-05-10T12:37:58.260000Z,75000.0
2018-05-10T12:38:01.020000Z,75000.0
2018-05-10T12:38:03.780000Z,75000.0
2018-05-10T12:38:06.540000Z,75000.0
2018-05-10T12:38:09.300000Z,75000.0
2018-05-10T12:38:12.060000Z,75000.0
2018-05-10T12:38:14.810000Z,75000.0
2018-05-10T12:38:17.570000Z,75000.0
2018-05-10T12:38:20.330000Z,75000.0
2018-05-10T12:38:23.090000Z,75000.0
2018-05-10T12:38:25.850000Z,75000.0
2018-05-10T12:38:28.610000Z,75000.0
2018-05-10T12:38:31.370000Z,75000.0
2018-05-10T12:38:34.130000Z,75000.0
2018-05-10T12:38:36.880000Z,75000.0
2018-05-10T12:38:39.640000Z,75000.0
2018-05-10T12:38:42.400000Z,75000.0
2018-05-10T12:38:45.160000Z,75000.0
2018-05-10T12:38:47.920000Z,75000.0
2018-05-10T12:38:50.680000Z,75000.0
2018-05-10T12:38:53.440000Z,75000.0
2018-05-10T12:38:56.200000Z,75000.0
2018-05-10T12:38:58.950000Z,75000.0
2018-05-10T12:39:01.710000Z,75000.0
2018-05-10T12:39:04.470000Z,75000.0
2018-05-10T12:39:07.230000Z,75000.0
2018-05-10T12:39:09.990000Z,75000.0
2018-05-10T12:39:12.750000Z,75000.0
2018-05-10T12:39:15.510000Z,75000.0
2018-05-10T12:39:18.270000Z,75000.0
2018-05-10T12:39:21.030000Z,75000.0
2018-05-10T12:39:23.780000Z,75000.0
2018-05-10T12:39:26.540000Z,75000.0
2018-05-10T12:39:29.300000Z,75000.0
2018-05-10T12:39:32.060000Z,75000.0
2018-05-10T12:39:34.820000Z,75000.0
2018-05-10T12:39:37.580000Z,75000.0
2018-05-10T12:39:40.340000Z,75000.0
2018-05-10T12:39:43.100000Z,75000.0
2018-05-10T12:39:45.850000Z,75000.0
2018-05-10T12:39:48.610000Z,75000.0
2018-05-10T12:39:51.370000Z,75000.0
2018-05-10T12:39:54.130000Z,75000.0
2018-05-10T12:39:56.890000Z,75000.0
2018-05-10T12:39:59.650000Z,75000.0
2018-05-10T12:40:02.410000Z,75000.0
2018-05-10T12:40:05.170000Z,75000.0
2018-05-10T12:40:07.920000Z,75000.0
2018-05-10T12:40:10.680000Z,75000.0
2018-05-10T12:40:13.440000Z,75000.0
2018-05-10T12:40:16.200000Z,75000.0
2018-05-10T12:40:18.960000Z,75000.0
2018-05-10T12:40:21.720000Z,75000.0
2018-05-10T12:40:24.480000Z,75000.0
2018-05-10T12:40:27.240000Z,75000.0
2018-05-10T12:40:29.990000Z,75000.0
2018-05-10T12:40:32.750000Z,75000.0
2018-05-10T12:40:35.510000Z,75000.0
2018-05-10T12:40:38.270000Z,75000.0
2018-05-10T12:40:41.030000Z,75000.0
2018-05-10T12:40:43.790000Z,75000.0
2018-05-10T12:40:46.550000Z,75000.0
2018-05-10T12:40:49.310000Z,75000.0
2018-05-10T12:40:52.070000Z,75000.0
2018-05-10T12:40:54.820000Z,75000.0
2018-05-10T12:40:57.580000Z,75000.0
2018-05-10T12:41:00.340000Z,75000.0
2018-05-10T12:41:03.100000Z,75000.0
2018-05-10T12:41:05.860000Z,75000.0
2018-05-10T12:41:08.620000Z,75000.0
2018-05-10T12:41:11.380000Z,75000.0
2018-05-10T12:41:14.140000Z,75000.0
2018-05-10T12:41:16.890000Z,75000.0
2018-05-10T12:41:19.650000Z,75000.0
2018-05-10T12:41:22.410000Z,75000.0
2018-05-10T12:41:25.170000Z,75000.0
2018-05-10T12:41:27.930000Z,75000.0
2018-05-10T12:41:30.690000Z,75000.0
2018-05-10T12:41:33.450000Z,75000.0
2018-05-10T12:41:36.210000Z,75000.0
2018-05-10T12:41:38.960000Z,75000.0
2018-05-10T12:41:41.720000Z,75000.0
2018-05-10T12:41:44.480000Z,75000.0
2018-05-10T12:41:47.240000Z,75000.0
2018-05-10T12:41:50.000000Z,75000.0
2018-05-10T14:41:50.000000Z,75000.0
2018-05-10T14:31:00.000000Z,75000.0
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ plant:
interconnect_limit: 15000

wind_farm:
component_type: Wind_MesoToPowerPrecomFloris
component_type: WindFarm
wake_method: precomputed
floris_input_file: floris_input.yaml
wind_input_filename: noisy_wind_input.csv
wind_input_filename: ../example_inputs/noisy_wind_input.csv
turbine_file_name: ../example_inputs/turbine_filter_model.yaml
log_file_name: outputs/log_wind_sim.log
log_channels:
Expand Down
4 changes: 3 additions & 1 deletion examples/wind_farm_power_tracking/hercules_input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ plant:
interconnect_limit: 10000.0

wind_farm:
component_type: Wind_MesoToPowerPrecomFloris
component_type: WindFarm
wake_method: precomputed
floris_input_file: ../example_inputs/floris_input_2turbine.yaml
wind_input_filename: wind_input.csv
turbine_file_name: ../example_inputs/turbine_filter_model.yaml
log_file_name: outputs/log_wind_sim.log
log_channels:
- power
- turbine_powers
- turbine_power_setpoints
floris_update_time_s: 300.0 # Update wakes every 5 minutes

external_data:
Expand Down
9 changes: 8 additions & 1 deletion examples/wind_farm_power_tracking/plot_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def plot_outputs():
n_turbines = 2
pow_cols = ["wind_farm.turbine_powers.{0:03d}".format(t) for t in range(n_turbines)]
ref_col = "external_signals.wind_power_reference"
mod_ref_cols = [
"wind_farm.turbine_power_setpoints.{0:03d}".format(t) for t in range(n_turbines)
]

# Create plots
fig, ax = plt.subplots(2, 1, sharex=True, sharey=True)
Expand All @@ -23,6 +26,7 @@ def plot_outputs():
time = df["time"].to_numpy()
powers = df[pow_cols].to_numpy()
ref = df[ref_col].to_numpy()
mod_ref = df[mod_ref_cols].to_numpy().sum(axis=1)

# Direction
for t in range(n_turbines):
Expand All @@ -36,7 +40,10 @@ def plot_outputs():
label="T{0:03d} power".format(t),
)
ax[case].plot(time, powers.sum(axis=1), color="black", label="Farm power")
ax[case].plot(time, ref, color="gray", linestyle="dashed", label="Ref. power")
ax[case].plot(time, ref, color="gray", linestyle="dashed", label="Power reference")
ax[case].plot(
time, mod_ref, color="gray", linestyle="dotted", label="Ramp-limited reference"
)

# Plot aesthetics
ax[case].grid()
Expand Down
11 changes: 8 additions & 3 deletions examples/wind_farm_power_tracking/runscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from plot_outputs import plot_outputs

generate_output_plots = True
ramp_rate_limit = 200 # kW/s, set to None for no ramp rate limit

prepare_output_directory()

Expand All @@ -24,7 +25,9 @@

print("Running open-loop controller...")
controller = HybridSupervisoryControllerMultiRef(
wind_controller=WindFarmPowerDistributingController(interface, hmodel.h_dict),
wind_controller=WindFarmPowerDistributingController(
interface, hmodel.h_dict, ramp_rate_limit=ramp_rate_limit
),
interface=interface,
input_dict=hmodel.h_dict,
)
Expand All @@ -41,9 +44,11 @@

interface = HerculesInterface(hmodel.h_dict)

print("Running open-loop controller...")
print("Running closed-loop controller...")
controller = HybridSupervisoryControllerMultiRef(
wind_controller=WindFarmPowerTrackingController(interface, hmodel.h_dict),
wind_controller=WindFarmPowerTrackingController(
interface, hmodel.h_dict, ramp_rate_limit=ramp_rate_limit
),
interface=interface,
input_dict=hmodel.h_dict,
)
Expand Down
Loading