def lifetimeReq(sims_, key='RBM'):
    #wohler = Config.Config.wohler[key]
    wohler = {'RBMf': 10, 'RBMe': 10, 'RBMt': 10, 'MBt': 4, 'MBy': 4}
    # Probability of each wind speed occuring
    P = wsp_probs()
    Y = 0
    for sim in sims_:
        wsp = sim.wsp
        Y += float(sim.data[key]**wohler[key] * P[wsp])

    Req_l = Y**(1 / wohler[key])

    return Req_l
Beispiel #2
0
def run(nothing, SAVE=False):


    P = wsp_probs()
    X, Y = zip(*P.items())
    x = np.linspace(0, 30, 1000)
    k = 2
    A = 10/math.gamma(1+1/k)
    y = k/A*(x/A)**(k-1)*np.exp(-(x/A)**k)

    plt.figure(figsize=(5, 4))
    plt.bar(X, Y, width=2, alpha=0.5, label='Discrete')
    plt.plot(x, y, 'k', label='Continuous')
    plt.legend(title='Wind Speed Distributions')
    plt.xlabel('Wind Speed [m/s]')
    plt.ylabel('Probability [-]')
    plt.xlim(0, 27)
    plt.xticks(range(0, 27, 2))
    if SAVE:
        plt.savefig(SAVE, dpi=200, bbox_inches='tight')
    plt.show(); print()