Esempio n. 1
0
(nevs, ndays, nsteps) = ch_comm_h.shape

# This is to include (or not) the baseload into the EV baseline computation
if baseload:
    loadevs = np.tile(load.values, (nevs, ndays,1)).sum(axis=0)
else:
    loadevs = 0
    
fleet_ch = np.array([ch_company.sum(axis=0) + loadevs, 
                     ch_comm_h.sum(axis=0) + loadevs, 
                     ch_comm_l.sum(axis=0) + loadevs])
fleet_dn = np.array([dn_company[0].sum(axis=0) + loadevs, 
                     dn_comm_h[0].sum(axis=0) + loadevs, 
                     dn_comm_l[0].sum(axis=0) + loadevs])

baseline_enedis = flex_payment_funcs.get_baselines(fleet_ch, bl='Enedis', ndays_bl=45, step=5)
baseline_UKPN_day = flex_payment_funcs.get_baselines(fleet_ch, bl='UKPN', ndays_bl=45, step=5)
baseline_UKPN_evening = np.zeros(baseline_enedis.shape)
baseline_UKPN_evening[:,:,idx_ini:idx_end] = flex_payment_funcs.get_baselines(fleet_ch[:, :, idx_ini:idx_end], bl='UKPN', ndays_bl=45, step=5)
#
#%% All baselines, gros bordel
f, ax = plt.subplots()
c = ['b', 'r', 'g']
labels = ['Company', 'Commuter HP', 'Commuter MP']

x = np.arange(0,24,5/60)

d = int(np.random.randint(0, 45,1))
for i in range(3):
    plt.plot(x, baseline_enedis[i,0,:], color=c[i], linestyle='-', label=labels[i]+ ' panel baseline')
    plt.plot(x, baseline_UKPN_day[i,0,:], color=c[i], linestyle=':', label=labels[i] + ' unique baseline')
Esempio n. 2
0
#                print('EV profiles extracted, t={:.2f} seg'.format(t[-1]-t[-2]))
                
                ##%% Iterate on number of evs per fleet
                stats_VxG = {}
            
                t.append(time.time())
                for nevs_fleet in x:
                #    if nevs_fleet <= 137:
                #        continue
#                    print('Computing fleet with {} EVs'.format(nevs_fleet))
                    tt = [time.time()]    
                    fleet_ch_profs, fleet_dn = fpf.get_fleet_profs(ch_profs_av_w, dn_profs_av_w, 
                                                               nfleets=nfleets, nevs_fleet=int(nevs_fleet))
                    tt.append(time.time())
#                    print('\tFleet profiles, t={:.2f} seg'.format(tt[-1]-tt[-2]))
                    baseline = fpf.get_baselines(fleet_ch_profs, bl='UKPN', ndays_bl=10)
                #    baseline_Enedis = fpf.get_baselines(fleet_ch_profs+baseloads, bl='Enedis', ndays_bl=100)
                    tt.append(time.time())
#                    print('\tBaselines, t={:.2f} seg'.format(tt[-1]-tt[-2]))
                    # Positive flex is power towards the system
                    flex_V1G = fpf.get_flex_wrt_bl(fleet_dn, baseline, V2G=False)
                    flex_V2G = fpf.get_flex_wrt_bl(fleet_dn, baseline, V2G=True)
                #    flex_V1G_Enedis = fpf.get_flex_wrt_bl(fleet_dn, baseline_Enedis, baseload, V2G=False)
                #    flex_V2G_Enedis = fpf.get_flex_wrt_bl(fleet_dn, baseline_Enedis, baseload, V2G=True)  
                    tt.append(time.time())
#                    print('\tFlexibility profs, t={:.2f} seg'.format(tt[-1]-tt[-2]))
                    # Number of activation events
                    for nact in nevents:          
                        for i, f in enumerate(service_time):
                            # Expected payment in €/MWh, considering the same value for availability & utilisation
                            exp_payment = eur_kw / (days_of_service * (a[1]-a[0])/1000 + nact * (f/60) / 1000)
Esempio n. 3
0
cols = [
    j + '_' + k for j in ['Bids', 'Payments', 'UnderDel']
    for k in ['Avg', 'min', 'max', 'perc_h', 'perc_l']
]

for nevs_fleet in x:
    tt = [time.time()]
    fleet_ch_profs, fleet_dn = fpf.get_fleet_profs(ch_profs_av_w,
                                                   dn_profs_av_w,
                                                   nfleets=nfleets,
                                                   nevs_fleet=int(nevs_fleet))
    tt.append(time.time())
    print('\tFleet profiles, t={:.2f} seg'.format(tt[-1] - tt[-2]))
    baseline_UKPN = fpf.get_baselines(fleet_ch_profs + baseloads,
                                      bl='UKPN',
                                      ndays_bl=100)
    baseline_Enedis = fpf.get_baselines(fleet_ch_profs + baseloads,
                                        bl='Enedis',
                                        ndays_bl=100)
    tt.append(time.time())
    print('\tBaselines, t={:.2f} seg'.format(tt[-1] - tt[-2]))
    flex_V1G = fpf.get_flex_wrt_bl(fleet_dn,
                                   baseline_UKPN,
                                   baseload,
                                   V2G=False)
    flex_V2G = fpf.get_flex_wrt_bl(fleet_dn, baseline_UKPN, baseload, V2G=True)
    flex_V1G_Enedis = fpf.get_flex_wrt_bl(fleet_dn,
                                          baseline_Enedis,
                                          baseload,
                                          V2G=False)