diff --git a/examples/simple_hybrid_plant/hercules_input.yaml b/examples/simple_hybrid_plant/hercules_input.yaml index 7eaedaf4..56a07e0e 100644 --- a/examples/simple_hybrid_plant/hercules_input.yaml +++ b/examples/simple_hybrid_plant/hercules_input.yaml @@ -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 diff --git a/examples/simple_hybrid_plant/plant_power_reference.csv b/examples/simple_hybrid_plant/plant_power_reference.csv index 6c52591d..2415cf6a 100644 --- a/examples/simple_hybrid_plant/plant_power_reference.csv +++ b/examples/simple_hybrid_plant/plant_power_reference.csv @@ -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 diff --git a/examples/single_turbine_flexible_interconnect/hercules_input.yaml b/examples/single_turbine_flexible_interconnect/hercules_input.yaml index c07f9012..0da35075 100644 --- a/examples/single_turbine_flexible_interconnect/hercules_input.yaml +++ b/examples/single_turbine_flexible_interconnect/hercules_input.yaml @@ -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: noisy_wind_input.csv turbine_file_name: ../example_inputs/turbine_filter_model.yaml log_file_name: outputs/log_wind_sim.log log_channels: diff --git a/examples/wind_farm_power_tracking/hercules_input.yaml b/examples/wind_farm_power_tracking/hercules_input.yaml index a3fe662b..fc92e640 100644 --- a/examples/wind_farm_power_tracking/hercules_input.yaml +++ b/examples/wind_farm_power_tracking/hercules_input.yaml @@ -13,7 +13,8 @@ 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 diff --git a/examples/wind_farm_power_tracking/plot_outputs.py b/examples/wind_farm_power_tracking/plot_outputs.py index 1227773b..4c9d527d 100644 --- a/examples/wind_farm_power_tracking/plot_outputs.py +++ b/examples/wind_farm_power_tracking/plot_outputs.py @@ -44,7 +44,7 @@ def plot_outputs(): ax[case].set_ylabel("Power [kW]") ax[0].set_xlim([time[0], time[-1]]) ax[0].legend(loc="lower left") - ax[1].set_xlabel("Time [s]") + ax[1].set_xlabel("Time [mins]") return fig diff --git a/hycon/controllers/wind_farm_power_tracking_controller.py b/hycon/controllers/wind_farm_power_tracking_controller.py index 1a1d0fe8..23210ab9 100644 --- a/hycon/controllers/wind_farm_power_tracking_controller.py +++ b/hycon/controllers/wind_farm_power_tracking_controller.py @@ -115,14 +115,6 @@ def turbine_power_references( farm_current_power = np.sum(turbine_powers) farm_current_error = farm_power_reference - farm_current_power - # Apply ramp rate limit - if self.ramp_rate_limit is not None: - farm_current_error = np.clip( - farm_current_error, - farm_current_power - self.ramp_rate_limit * self.dt, - farm_current_power + self.ramp_rate_limit * self.dt, - ) - self.n_saturated = 0 # TODO: determine whether to use gain scheduling if self.n_saturated < self.n_turbines: # with self.n_saturated = 0, gain_adjustment = 1 @@ -144,6 +136,14 @@ def turbine_power_references( u = u_p # + u_i delta_P_ref = u + + # Apply ramp rate limit + if self.ramp_rate_limit is not None: + delta_P_ref = np.clip( + delta_P_ref, + - self.ramp_rate_limit * self.dt, + self.ramp_rate_limit * self.dt, + ) turbine_power_setpoints = np.array(turbine_powers) + delta_P_ref