forked from WISDEM/WEIS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,34 @@ | ||
# Example_02 | ||
# Load controller parameter file, make some changes and save as new file | ||
# Example_04 | ||
# Load a turbine model from saved pickle, make a quick cp plot | ||
|
||
|
||
from WTC_toolbox import turbine as wtc_turbine | ||
from WTC_toolbox import controller as wtc_controller | ||
from WTC_toolbox import sim as wtc_sim | ||
from WTC_toolbox import sim as wtc_sim | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
# Initialiize a turbine class | ||
turbine = wtc_turbine.Turbine() | ||
|
||
# Load quick from python | ||
turbine.load('saved_turbine.p') | ||
|
||
# Sweep TSR and fix pitch in two positions | ||
fixed_rpm = 10. # RPM | ||
fixed_pitch = 0. | ||
|
||
tsr = np.arange(1,15,0.1) | ||
|
||
|
||
cp_0 = np.array([turbine.cp_interp(t,0) for t in tsr]) | ||
cp_3 = np.array([turbine.cp_interp(t,3) for t in tsr]) | ||
|
||
fig, ax = plt.subplots() | ||
ax.plot(tsr,cp_0,label='Pitch=0') | ||
ax.plot(tsr,cp_3,label='Pitch=3') | ||
ax.set_xlabel('TSR') | ||
ax.set_ylabel('Cp') | ||
ax.grid(True) | ||
ax.legend() | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Example_03 | ||
# Load controller parameter file, make some changes and save as new file | ||
|
||
|
||
from WTC_toolbox import turbine as wtc_turbine | ||
from WTC_toolbox import controller as wtc_controller | ||
from WTC_toolbox import sim as wtc_sim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Example_04 | ||
# Load a turbine model and use to tune the controller | ||
|
||
|
||
from WTC_toolbox import turbine as wtc_turbine | ||
from WTC_toolbox import controller as wtc_controller | ||
from WTC_toolbox import sim as wtc_sim | ||
|
||
# Initialiize a turbine class | ||
turbine = wtc_turbine.Turbine() | ||
|
||
# Load quick from python | ||
turbine.load('saved_turbine.p') |