Disclaimer: I'm the author.<p>I was torn whether to share my own post, but I figured the HN crowd might include a few others who will also really geek out about this topic and appreciate it. It's mathematical optimization and forecasting used to guide giant batteries hooked up to the electrical grid, after all.<p>There is some accompanying code I got to share publicly, too, if you want to run this yourself [1]. While I'm at it, I'll also mention some papers for anyone who wants a true deep dive [2, 3].<p>[1] <a href="https://gist.github.com/lukemerrick/4e1f9921a19ec97f7b94990953c2e799" rel="nofollow">https://gist.github.com/lukemerrick/4e1f9921a19ec97f7b949909...</a><p>[2] Linear Programming for battery optimization -- <a href="https://www.osti.gov/servlets/purl/1244909" rel="nofollow">https://www.osti.gov/servlets/purl/1244909</a><p>[3] Mixed-Integer Linear Programming for battery optimization [PDF] -- <a href="https://www.sandia.gov/ess-ssl/wp-content/uploads/2018/08/2017_EESAT_Proceeding_Tong.pdf" rel="nofollow">https://www.sandia.gov/ess-ssl/wp-content/uploads/2018/08/20...</a>