def cost_config(pos_,Qnet,Pnet,cycleCounts_): pri_wind=pos_[0]*WINDS_PRICE_DEVICE pri_pv=pos_[1]*PV_PRICE_BAT1 #cycclecont:1bat,2ele,3tank,4fc cycleCounts_.append(max(int(abs(max(Pnet)/(BAT_CAP*BAT_CHARGE_*BAT_VOL/1000.0))),int(abs(min(Pnet)/(BAT_CAP*BAT_DISCHARGE_*BAT_VOL/1000.0))))) cycleCounts_.append(int(max(Pnet)/recyclemodule.RATIO_POWER2GAS)) print 'max pnet :%f'%max(Pnet) #print 'Qmin:%f '%Qmin max_tank_Volumn=recyclemodule.tank_svgas(recyclemodule.ele_mkgas(max(Qnet))) print 'maxVol :%f'%max_tank_Volumn # 30:氢气的压缩率 cycleCounts_.append(max_tank_Volumn/(100)) #3kw bat power q=(max(Qnet)/3)*BAT_PRICE_DEVICE if abs(q)>ELE_PRICE_DEVICE+TANK_PRICE_DEVICE+FC_PRICE_DEVICE: cycleCounts_.append(int(max(Pnet)/RATED_FC)) pri_cycle=ELE_PRICE_DEVICE*cycleCounts_[1]+TANK_PRICE_DEVICE*cycleCounts_[2]+FC_PRICE_DEVICE*cycleCounts_[3] #print 'cycle price :%f'%p_cycle #print 'bat price :%f'%p_bat else: cycleCounts_.append(0.0) pri_cycle=0 #print 'cycle not use' #print q print 'bat: %d ele : %d tank : %d fc : %d'%(cycleCounts_[0],cycleCounts_[1],cycleCounts_[2],cycleCounts_[3]) pri_bat=cycleCounts_[3]*BAT_PRICE_DEVICE return pri_wind+pri_pv+pri_bat+pri_cycle
def cost_config(pos_,Qnet,Pnet,counts): p_wind=pos_[0]*WINDS_PRICE_DEVICE p_pv=pos_[1]*PV_PRICE_BAT1 counts.append(int(max(Pnet))) counts.append(abs(int(min(Pnet)))) Qmin=min(Qnet) print 'Qmin:%f '%Qmin Qmax=max(max(Qnet),abs(min(Qnet))) Pmax=max(max(Pnet),abs(min(Pnet))) maxVol=recyclemodule.tank_svgas(recyclemodule.ele_mkgas(Qmax)) max_tank_Volumn.append(abs(maxVol)) print 'maxVol :%f'%maxVol counts.append(abs(maxVol/100.0)) q=(Qmax/BAT_POWER)*BAT_PRICE_DEVICE if abs(q)>ELE_PRICE_DEVICE+TANK_PRICE_DEVICE+FC_PRICE_DEVICE: p_cycle=ELE_PRICE_DEVICE*counts[0]+TANK_PRICE_DEVICE*counts[2]+FC_PRICE_DEVICE*counts[1] counts.append(round(Pmax)) p_bat=(Pmax)/BAT_POWER*BAT_PRICE_DEVICE #print 'cycle price :%f'%p_cycle #print 'bat price :%f'%p_bat else: counts.append(0.0) p_bat=q p_cycle=0 #print 'cycle not use' #print q print 'ele: %d fc : %d tank : %d bat : %d'%(counts[0],counts[1],counts[2],counts[3]) return p_wind+p_pv+p_bat+p_cycle