コード例 #1
0
def loadData(dir_res):
    channels = {
        't': 1,  #time [s]
        'TD1': 49,  #Tip deflection - blade 1 [m]
        'IPCDem1': 99,  #IPC pitch demand - blade 1 [rad]
    }

    # get files with the filename form 'pitchstep_xx' where xx is the wind speed
    # of the simulation.
    resFiles = [x[:-4] for x in os.listdir(dir_res) if x.endswith('.sel')]
    resFiles = [x for x in resFiles if x.startswith('pitchstep_lin')]

    wsps = [int(x.split('_')[2]) for x in resFiles]
    print('Result files found:')
    [print(wsp, x) for wsp, x in zip(wsps, resFiles)]

    # Load results for each windspeed
    resData = []
    for file in resFiles:
        resData.append(readHawc2Res(dir_res + file, channels))

    # extract just the input and output timeseries, and remove first 110 seconds

    PDs = {}
    for data, wsp in zip(resData, wsps):
        PDs[wsp] = pd.DataFrame({
            't': data.t,
            'x': -data.IPCDem1,  # POSSIBLE SOURCE OF SIGN ERROR
            'y': data.TD1
        })

        PDs[wsp] = PDs[wsp][PDs[wsp].t > 110]
        PDs[wsp].t -= 110
        #PDs[wsp].x -= PDs[wsp].x.values[0]
        #PDs[wsp].y -= PDs[wsp].y.mean()

    return PDs
コード例 #2
0
 def loadFromSel(self, channels=None):
     return readHawc2Res(self.resFolder + self.filename, channels=channels)
def estimateDeformation2(M, y, offset = 0):
    # estimate blade deformation based tip deflection [m] measurement only

    y = y + offset
    u = mode1*y

    return u

def estimateDeformation3(M, y, offset=-2200000):
    # estimate blade deformation based RBM [Nm] measurement only
    M = M + offset
    u = mode1*M/(EI*curve1)
    return u


data2 = readHawc2Res('C:/JL0004/res/fullspandeflectionsensors',  channels).as_matrix()
data = readHawc2Res('C:/JL0004/res/fullspandeflectionsensors',  channels2)


def plotDeformation(i):
    RBM = -data.RBM1[i]*1000
    TD = data.TD1[i] - prebend[-1]
    est1 = estimateDeformation(RBM, TD) + prebend
    est2 = estimateDeformation2(RBM, TD) + prebend
    est3 = estimateDeformation3(RBM, TD) + prebend

    plt.figure()
    plt.ylim(-0.5, 5)
    plt.title('{:2.2f}'.format(data.Azim[i]))
    plt.plot(Z, est2 )
    plt.plot(Z, est3)
import numpy as np
import matplotlib.pyplot as plt
from JaimesThesisModule.Misc import readHawc2Res
import time

channels = {
    't': 1,  #time [s]
    'Azim': 2,  #rotor azimuth angle [deg]
    'TD1': 49,  #Tip deflection - blade 1 [m]
    'TD2': 52,
    'TD3': 55,
    'TowerTip': 118
}

data = readHawc2Res(
    'C:/Dropbox/Uni/Masters/4 Thesis/HAWC2-Python-Simulation/DTU10MW_Turbine/res/template/tracking_nocontrol',
    channels)

data2 = readHawc2Res(
    'C:/Dropbox/Uni/Masters/4 Thesis/HAWC2-Python-Simulation/DTU10MW_Turbine/res/template/tracking_0',
    channels)

data3 = readHawc2Res(
    'C:/Dropbox/Uni/Masters/4 Thesis/HAWC2-Python-Simulation/DTU10MW_Turbine/res/template/tracking_3',
    channels)

# load tip deflection time series from each sim and subtract mean
td = data[['TD1', 'TD2', 'TD3']].as_matrix()
td2 = data2[['TD1', 'TD2', 'TD3']].as_matrix()
td3 = data3[['TD1', 'TD2', 'TD3']].as_matrix()
コード例 #5
0
# get files with the filename form 'pitchstep_xx' where xx is the wind speed
# of the simulation.
resFiles = [x[:-4] for x in os.listdir(dir_res) if x.endswith('.sel')]
resFiles = [x for x in resFiles if x.startswith('pitchstep_lin')]

#resFiles = ['pitchstep_04', 'pitchstep_06']
#resFiles = ['pitchstep_06']

wsps = [int(x.split('_')[2]) for x in resFiles]
print('Result files found:')
[print(wsp, x) for wsp, x in zip(wsps, resFiles)]

# Load results for each windspeed
resData = []
for file in resFiles:
    resData.append(readHawc2Res(dir_res + file, channels))

# extract just the input and output timeseries, and remove forst 110 seconds
t, x, y = [], [], []

for data in resData:
    t.append(np.array(data.t))
    x.append(np.array(data.IPCDem1)[t[-1] > 110])
    y.append(np.array(data.TD1)[t[-1] > 110])
    #y2.append(np.array(data.TD2)[t[-1] > 110])
    t[-1] = t[-1][t[-1] > 110]

tpeak, tpeak2 = [], []  #indices of the overshoot to test linearity
ypeak, ypeak2 = [], []
for i in range(len(x)):
    x[i] = x[0] - x[0][0]