Skip to content

Commit

Permalink
Plot peak shaving values
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Oct 1, 2019
1 parent 685a37c commit 40aef78
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions examples/example_09.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# example_09.py
# Include peak shaving
# Plot expected shaved rotor thrust

%##
#%%
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
import os

from WTC_toolbox import controller as wtc_controller
from WTC_toolbox import turbine as wtc_turbine
from WTC_toolbox import sim as wtc_sim
import os


os.chdir('/Users/nabbas/Documents/WindEnergyToolbox/WTC_toolbox/examples')

Expand All @@ -19,13 +20,24 @@

# Fast input file and Cp surface text file
FAST_InputFile = '5MW_Land.fst'
FAST_directory = '/Users/nabbas/Documents/TurbineModels/NREL_5MW/5MW_Land'
FAST_directory = '../Test_Cases/5MW_Land'
txt_filename = 'Cp_Ct_Cq.txt'

drivetrain_inertia = 40469564.444
turbine.load_from_fast(FAST_InputFile,FAST_directory,drivetrain_inertia,dev_branch=True,rot_source='txt', txt_filename=txt_filename)

# Load controller
#%% Load controller
controller.tune_controller(turbine)

turbine.Ct.interp_surface

#%%
fig, axs = plt.subplots(2,1)
axs[0].plot(controller.ps.v, controller.ps.T)
axs[0].plot(controller.ps.v, controller.ps.Tshaved)

axs[1].plot(controller.ps.v, controller.pitch_op)
axs[1].plot(controller.ps.v, controller.ps.pitch_min)

plt.show()

#%%

0 comments on commit 40aef78

Please sign in to comment.