Apr. 20th, 2017

ocschwar: (Default)
ess_p = demand_forecast-production_forecast
RTE = 0.8
CAPACITY = 500000
ess_p[ ess_p.rp > CAPACITY] = CAPACITY
ess_p[ ess_p.rp < -CAPACITY] = -CAPACITY
ess_p[ess_p.rp < 0 ] *= RTE
# hard coded initial SOE, needs to be made into something real.
# divided by sixty so we go from minutes to watt hours. 
soe = SOE * 60 -ess_p.cumsum()
soe[soe>CAPACITY*60]= CAPACITY*60
soe[soe<0]=0
ess_pd = -soe.diff()
#RT
ess_pd[ess_pd.rp<0]*=(1/RTE)


10 lines replacing insane amounts of Matlab code.

Profile

ocschwar: (Default)
ocschwar

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819 202122
23242526272829
30      

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 19th, 2017 05:07 pm
Powered by Dreamwidth Studios