Simple implementation of a fuzzy microgrid controller.
Inputs "power balance" and "battery state of charge" are fuzzified into 5 triangular fuzzy sets each and combined to produce a fuzzy "battery power output", which is then transformed into a crisp value using the centroid point.
Inspired by this paper.