Skip to content

Commit

Permalink
Add ws est plot; update ws3 to 0.5m/s above ws2.
Browse files Browse the repository at this point in the history
  • Loading branch information
misi9170 committed Nov 19, 2024
1 parent f08063b commit 36e8fca
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,32 @@
"ax.set_ylabel(\"Error [kW]\")\n",
"ax.set_title(\"Error vs Measured Power\")\n",
"ax.grid(True)\n",
"plt.show()"
"plt.show()\n",
"\n",
"# Plot estimated vs real wind speed\n",
"fig = plt.figure()\n",
"gs = fig.add_gridspec(2, 1, height_ratios=[2, 1])\n",
"\n",
"ax = fig.add_subplot(gs[0])\n",
"ax.plot(wind_speeds, wind_speeds, color=\"black\", linestyle=\"--\", label=\"Truth\")\n",
"sns.scatterplot(x=wind_speeds, y=df_scada.ws_000, ax=ax, label=\"Original WS\", s=100)\n",
"sns.scatterplot(x=wind_speeds, y=df_scada.ws_est_000, ax=ax, label=\"Estimated WS\")\n",
"ax.grid(True)\n",
"ax.set_ylabel(\"Meas.and Est. Wind Speed [m/s]\")\n",
"\n",
"ax = fig.add_subplot(gs[1])\n",
"ax.plot(wind_speeds, df_scada.ws_est_gain_000, color=\"black\")\n",
"ax.set_xlabel(\"True Wind Speed [m/s]\")\n",
"ax.set_ylabel(\"Est. gain [-]\")\n",
"ax.grid(True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions flasc/utilities/floris_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,11 @@ def estimate_ws_with_floris(
ws0 = 0
ws1 = float(np.interp(rated_power * 0.1, pow_pc, ws_pc))
ws2 = float(np.interp(rated_power * 0.9, pow_pc, ws_pc))
ws3 = ws2 + 1.0
ws3 = ws2 + 0.5

# For starters make simple gain schedule
ws_est_gain_x = [ws0, ws1, ws2, ws3]
ws_est_gain_y = [0, 1, 1, -1]
ws_est_gain_y = [0, 1, 1, 0]

ws_est_gain = np.interp(df_scada["ws_{:03d}".format(ti)], ws_est_gain_x, ws_est_gain_y)
ws_est_gain = np.clip(ws_est_gain, 0, 1)
Expand Down

0 comments on commit 36e8fca

Please sign in to comment.