# Best Algorithms to Make Solar Power Storage Profitable

## Which algorithms are best at integrating solar arrays with electrical grid storage?

Photo: iStockphoto

By analyzing the kinds of algorithms that control the flow of electricity between solar cells and lithium-ion batteries, scientists have identified the best types of algorithms to govern electrical grid storage of solar power.

A dizzying number of algorithms exist to help manage the flow of electricity between photovoltaic cells and lithium-ion batteries in the most profitable manner. These come in a variety of complexities and have diverse computational power requirements.

"Lithium-ion batteries are expensive components, and photovoltaic plant owners have to pay large amounts of money in order to install lithium-ion batteries on plant," says study lead author Alberto Berrueta, an engineering researcher at the Public University of Navarre's Institute of Smart Cities in Pamplona, Spain. "Management algorithms are of capital importance in order to preserve a long lifetime for the batteries to make the most out of the batteries."

To see which types of these algorithms work best at getting the most out of lithium-ion batteries, researchers developed models based off the amount of power generated over the course of a year from a medium-sized roughly 100-kilowatt solar cell array located in Navarre. They focused on concerns such as the computational requirements needed, the price of electricity, battery life, battery costs, and battery charging and discharging rates.

The researchers looked at three families of algorithms currently used in managing electricity from commercial solar cell arrays: dynamic, quadratic and linear. Dynamic algorithms tackle complex, sequential optimization problems by breaking them down into several simpler sub-problems. Quadratic algorithms each involve at least one squared variable and often find use in calculating areas, computing the profit of a product, and pinpointing the speed and position of an object. Linear algorithms each involve variables that are not squared and have the simplest computational requirements.

The scientists found the dynamic algorithms required far more computational power than the other two families of algorithms; as the number of variables grew, they experienced an exponential increase in problem complexity. A commercial PC that would take about 10 seconds to compute the energy flow between the solar cells and lithium-ion batteries using the linear and quadratic algorithms would take 42 minutes with the dynamic algorithms.

Linear algorithms had the lowest computational requirements but suffered in terms of accuracy. For instance, their simplified models did not account for how electrical current can reduce battery lifetime. All in all, the linear algorithms provided an average of 20 percent lower profits than the maximum achievable.

The researchers concluded that quadratic algorithms provided the best trade-off between accuracy and computational simplicity for solar power applications. Quadratic algorithms had about the same low computational requirements as linear algorithms while achieving revenues similar to dynamic algorithms for all battery sizes.

In the future, scientists can investigate which management algorithms might work best with hybrid energy storage systems, Berrueta says. Future research can also investigate which computer models work best at calculating all the factors affecting the lifetime of lithium-ion batteries, including batteries discarded from electric vehicles that might find a second life working in renewable energy plants, he adds.

The researchers detailed their findings at the IEEE International Conference on Environmental and Electrical Engineering in Genoa, Italy, on June 11.

The Conversation (0)

## How to Prevent Blackouts by Packetizing the Power Grid

### The rules of the Internet can also balance electricity supply and demand

Vertical
Dan Page
DarkBlue1

Bad things happen when demand outstrips supply. We learned that lesson too well at the start of the pandemic, when demand for toilet paper, disinfecting wipes, masks, and ventilators outstripped the available supply. Today, chip shortages continue to disrupt the consumer electronics, automobile, and other sectors. Clearly, balancing the supply and demand of goods is critical for a stable, normal, functional society.

That need for balance is true of electric power grids, too. We got a heartrending reminder of this fact in February 2021, when Texas experienced an unprecedented and deadly winter freeze. Spiking demand for electric heat collided with supply problems created by frozen natural-gas equipment and below-average wind-power production. The resulting imbalance left more than 2 million households without power for days, caused at least 210 deaths, and led to economic losses of up to US \$130 billion.

Similar mismatches in supply and demand contributed to massive cascading blackouts in August 2003 in the northeastern United States and Canada, in July 2012 in India, and in March 2019 in Venezuela.

The situation is unlikely to get better anytime soon, for three reasons. First, as countries everywhere move to decarbonize, the electrification of transportation, heating, and other sectors will cause electricity demand to soar. Second, conventional coal and nuclear plants are being retired for economic and policy reasons, removing stable sources from the grid. And third, while wind and solar-photovoltaic systems are great for the climate and are the fastest-growing sources of electric generation, the variability of their output begets new challenges for balancing the grid.

So how can grid operators keep supply and demand balanced, even as they shut down old, dirty power plants, ramp up variable generation, and add new electric loads? There are a few possibilities. One is to do a modernized version of what we have done in the past: Build giant, centralized infrastructure. That would mean installing vast amounts of energy storage, such as grid-scale batteries and pumped-hydro facilities, to hold the excess renewable power being generated, and interconnecting that storage with high-voltage transmission lines, so that supply can meet demand across the grid. China is a leader in this approach, but it’s incredibly expensive and requires an enormous amount of political will.

Packetized energy management (PEM) allows the power grid to flexibly handle a varying supply of renewable energy. In a simulation, the aggregated load from 1,000 electric water heaters [solid orange line] almost exactly matches renewable energy supply [dashed gold line] after packetized control is switched on [vertical dotted line]. The brown line shows the uncoordinated load from 1,000 electric water heaters for reference. The black-and-white images show patterns of off and on for a set of 10 water heaters controlled by conventional thermostats and by PEM-enabled thermostats.

We think there’s a better way. Instead of drastically scaling up power-grid infrastructure, our work at the University of Vermont has focused on how to coordinate demand in real time to match the increasingly variable supply. Our technology takes two ideas that make the Internet fundamentally scalable—packetization and randomization—and uses them to create a system that can coordinate distributed energy. Those two data-communication concepts allow millions of users and billions of devices to connect to the Internet without any centralized scheduling or control. The same basic ideas could work on the electrical grid, too. Using low-bandwidth connectivity and small controllers running simple algorithms, millions of electrical devices could be used to balance the flow of electricity in the local grid. Here’s how.

Electricity demand on the grid comes from billions of electrical loads. These can be grouped into two broad categories: commercial and industrial loads, and residential loads. Of the two, residential loads are far more dispersed. In the United States alone, there are over 120 million households, which collectively account for about 40 percent of annual electricity consumption. But residential customers generally don’t think about optimizing their own electricity loads as they go about their day. For simplicity’s sake, let’s call these residential loads “devices,” which can range from lights and televisions to water heaters and air conditioners.

The latter devices, along with electric-vehicle chargers and pool pumps, are not only large electric loads (that is, greater than a 1-kilowatt rating), but they’re also flexible. Unlike lighting or a TV, which you want to go on the instant you throw the switch, a flexible device can defer consumption and operate whenever—as long as there’s hot water for your shower, your pool is clean, your EV has enough charge, and the indoor temperature is comfortable.

Collectively, there is a lot of flexibility in residential electricity loads that could be used to help balance variable supply. For example, if every household in California and New York had just one device that could consume power flexibly, at any time, the power grid would have the equivalent of around 15 gigawatts of additional capacity, which is more than 10 times the amount currently available from utility-scale battery storage in these states.

Here’s what flexibility means when it comes to operating, say, a residential electric water heater. While heating water, a typical unit draws about 4.5 kilowatts. Over the course of a normal day, the appliance is on about a tenth of the time, using about 10.8 kilowatt-hours. To the homeowner, the daily cost of operating the water heater is less than US \$2 (assuming a rate of about 15¢ per kWh). But to the utility, the cost of electricity is highly variable, from a nominal 4¢ per kWh to over \$100 per kWh during annual peak periods. Sometimes, the cost is even negative: When there is too much power available from wind or solar plants, grid operators effectively pay utilities to consume the excess.

Electricity supply and demand can sometimes diverge in dramatic ways. Packetization and randomization of flexible electricity loads allow demand to match the available supply.

University of Vermont

To reduce demand during peak periods, utilities have long offered demand-response programs that allow them to turn off customers’ water heaters, air conditioners, and other loads on a fixed schedule—say, 4 p.m. to 9 p.m. during the summer, when usage is historically high. If all we want to do is reduce load at such times, that approach works reasonably well.

However, if our objective is to balance the grid in real time, as renewable generation ebbs and flows unpredictably with the wind and sun, then operating devices according to a fixed schedule that’s based on past behavior won’t suffice. We need a more responsive approach, one that goes beyond just reducing peak demand and provides additional benefits that improve grid reliability, such as price responsiveness, renewable smoothing, and frequency regulation.

How can grid operators coordinate many distributed, flexible kilowatt-scale devices, each with its own specific needs and requirements, to deliver an aggregate gigawatt-scale grid resource that is responsive to a highly variable supply? In pondering this question, we found inspiration in another domain: digital communication systems.

Digital systems represent your voice, an email, or a video clip as a sequence of bits. When this data is sent across a channel, it’s broken into packets. Then each packet is independently routed through the network to the intended destination. Once all of the packets have arrived, the data is reconstructed into its original form.

How is this analogous to our problem? Millions of people and billions of devices use the Internet every day. Users have their individual devices, needs, and usage patterns—which we can think of as demand—while the network itself has dynamics associated with its bandwidth—its supply, in other words. Yet, demand and supply on the Internet are matched in real time without any centralized scheduler. Likewise, billions of electrical devices, each with its own dynamics, are connecting to the power grid, whose supply is becoming, as we noted, increasingly variable.

Recognizing this similarity, we developed a technology called packetized energy management (PEM) to coordinate the energy usage of flexible devices. Coauthor Hines has a longstanding interest in power-system reliability and had been researching how transmission-line failures can lead to cascading outages and systemic blackouts. Meanwhile, Frolik, whose background is in communication systems, had been working on algorithms to dynamically coordinate data communications from wireless sensors in a way that used very little energy. Through a chance discussion, we realized our intersecting interests and began working to see how these algorithms might be applied to the problem of EV charging.

### A Packetized Grid for the Developing World

Packetized energy management (PEM) is a way to balance the power grid and make it more reliable while also maximizing the use of renewable energy and avoiding the installation of massive amounts of energy storage or other expensive infrastructure.

In industrialized parts of the world, PEM assumes that an electrical device such as a water heater or electric-vehicle charger will determine its own need for energy, then use this need to determine if it should request an energy packet from a cloud-based coordinator. When a packet of energy is requested, the coordinator responds based on grid or market conditions by either accepting or denying the request. This approach clearly requires an active, bidirectional communication link, which can be readily accomplished through a homeowner’s Wi-Fi network, a cellular link, or more advanced communication solutions, such as LoRa (long-range, low-power) technologies.

In many parts of the world, though, such bidirectional links are unavailable, and yet coordinating electricity loads is still critical, to prevent power outages caused by unmanaged overloading. Take crop irrigation in developing countries. Ideally, you’d want farms in these areas to use greener, grid-connected electric pumps rather than diesel ones. But the power grid may not always be robust enough to handle these large and highly distributed loads, which can exceed 10 kilowatts.

How could these loads be coordinated using the PEM concept? Over the course of perhaps several days, a pump typically runs for a certain number of hours rather than continuously. Even if bidirectional communication is unavailable, we can still implement load coordination by having the pump’s controller randomly “listen” for a broadcast signal from a coordinator. The coordinator would be monitoring grid conditions and possibly the water flow in irrigation canals and then broadcasting over low-frequency AM bands a traffic-light–like signal indicating a simple “yes” or “no”—“yes” indicates it’s okay to turn on the pump and consume electricity, “no” means do not turn on, do not consume electricity. The pump controller would wake up at its own regular random interval, determine its need for energy, and listen to the broadcast. If the broadcast is a “yes,” the pump operates for an appropriate duration. If a “no” is received, the pump does not turn on, and the process repeats at the next wake-up interval.

If all the pumps in a particular region operate using PEM rules, then the available electricity and water resources would be shared fairly. Furthermore, the randomization in electricity usage would prevent every pump from turning on or off simultaneously, as would occur using traditional demand-response broadcasts.

By coordinating these large but flexible loads, PEM would also help ensure the availability of electricity for lighting and other nonflexible loads, thus improving the quality of life for people in these regions.

M.A., J.F. & P.H.

Shortly thereafter, Almassalkhi joined our department and recognized that what we were working on had greater potential. In 2015, he wrote a winning proposal to ARPA-E’s NODES program—that’s the U.S. Department of Energy’s Advanced Research Projects Agency–Energy’s Network Optimized Distributed Energy Systems program. The funding allowed us to further develop the PEM approach.

Let’s return to the electric water heater. Under conventional operation, the water heater is controlled by its thermostat. The unit turns on when the water temperature hits a lower limit and operates continuously (at 4.5 kW) for 20 to 30 minutes, until the water temperature reaches an upper limit. The pair of black-and-white graphs at the bottom of “Matching Electricity Demand to Supply” shows the on and off patterns of 10 heaters—black for off and white for on.

Under PEM, each load operates independently and according to simple rules. Instead of heating only when the water temperature reaches its lower limit, a water heater will periodically request to consume a “packet” of energy, where a packet is defined as consuming power for just a short period of time—say, 5 minutes. The coordinator (in our case, a cloud-based platform) approves or denies such packet requests based on a target signal that reflects grid conditions, such as the availability of renewable energy, the price of electricity, and so on. The top graph in “Matching Electricity Demand to Supply” shows how PEM consumption closely follows a target signal based on the supply of renewable energy.

To ensure that devices with a greater need for energy are more likely to have their requests approved, each device adjusts the rate of its requests based on its needs. When the water is less hot, a water heater requests more often. When the water is hotter, it requests less often. The system thus dynamically prioritizes devices in a fully decentralized way, as the probabilities of making packet requests are proportional to the devices’ need for energy. The PEM coordinator can then focus on managing incoming packet requests to actively shape the total load from many packetized devices, without the need to centrally optimize the behavior of each device. From the customer’s perspective, nothing about the water heater has changed, as these requests occur entirely in the background.

These same concepts can be applied to a wide range of energy-hungry devices. For example, an EV charger or a residential battery system can compare the battery’s current state of charge to its desired value—equivalent to its need for energy—translate this into a request probability, and then send a request to the PEM coordinator, which either accepts or denies the request based on real-time grid or market conditions. Depending on those conditions, it might take somewhat longer for a battery to fully charge, but the customer shouldn’t be inconvenienced.

In this way, flexible energy devices communicate using the common, simple language of energy-packet requests. As a result, the coordinator is agnostic to the type of device making the request. This device-agnostic coordination is similar to net neutrality in data communications. In general, the Internet doesn’t care if your packet carries voice, video, or text data. Similarly, PEM doesn’t care if the device requesting a packet is a water heater, a pool pump, or an EV charger, so it can readily coordinate a heterogeneous mix of kilowatt-scale devices.

This controller connects to a residential electric water heater and uses simple algorithms to request “packets” of energy from a cloud-based coordinator to maintain a suitable temperature.

Packetized Energy Technologies

Right now, bottom-up, device-driven technologies like PEM are not widely deployed. Instead, most of today’s demand-response technologies take a top-down approach, in which the coordinator broadcasts a control signal to all devices, telling them what to do. But if every device is told to do the same thing at the same time, things can go wrong very quickly, as the power consumption of the devices becomes synchronized. Imagine the effect of millions of air conditioners, water heaters, and EV chargers turning on (or off) at once. That would represent gigawatt spikes—as if a large nuclear power plant were turning on or off with the flip of a switch. A spike that large could cause the grid to become unstable, which could trigger a cascading blackout. That’s why most utilities today split devices into groups to limit spikes to the order of tens of megawatts. However, actively managing these different groups beyond a few annual peak events is a challenge for top-down approaches.

But if each device works to meet its own unique need for energy, then packet requests (and resulting power use) are inherently randomized, and as a result, synchronization becomes much less of a concern.

The top-down approach also makes it difficult to take into account customer preferences for hot water, charged cars, and cool homes on hot days. If we are going to coordinate energy devices to make the grid work better, we need to make sure that we do it in a way that is essentially unnoticeable and automatic for the consumer.

Now, consider how PEM accounts for an individual customer’s preferences in the case of the water heater. If the water temperature drops below its lower limit and the heater isn’t already consuming a packet of energy, it can temporarily “opt out” of the PEM scheme and turn on until the temperature recovers. The water heater will inform the PEM coordinator of this change in its operating mode, and the coordinator will simply update its accounting of the aggregate demand. The impact of this single load on the total is small, but for the customer, having the guarantee of hot water when needed builds trust and ensures ongoing participation.

PEM’s device-driven approach also makes things easier for the coordinator because it doesn’t need to centrally monitor or model each device to develop an optimized schedule. The coordinator only needs to monitor grid and market conditions, reply to the live stream of incoming packet requests, and keep a record of the “opted out” devices—the coordinator manages just three set of numbers, in other words.

To increase the impact of our work, we decided to commercialize PEM in parallel with our research and founded Packetized Energy in 2016. The company has deployed its cloud-based energy coordination platform in several utility-sponsored pilot projects in the United States and Canada. These projects each started by retrofitting existing electric water heaters with a smart thermostat that we designed, developed, and had UL-certified. We have also demonstrated PEM with EV chargers, residential batteries, and thermostats. Our first customer was our hometown Vermont utility, Burlington Electric Department. In 2018, BED began the nation’s first 100 percent renewable-powered water heater program, which has now expanded to include EV chargers.

On 6 December 2021 over the course of more than 2 hours, a load of 208 residential water heaters was rapidly coordinated from 25 kilowatts to 80 kW—from about half the baseline load to about twice that load.

Our projects have yielded some promising results. “A Real-Time Demo of Load Coordination” shows how PEM coordinated the load from 208 residential water heaters in Vermont and South Carolina over a typical 2-hour period. The heaters [orange line] followed a rapidly changing target [black line] that ranged from about half the nominal load to about twice that load [red line].

As systems scale to thousands of packetized devices, the asynchronous packet requests will appear as a continuous signal. Our simulations show that at this scale, any gaps between the target and the actual will disappear. The aggregate load is at least as responsive as the reaction times of a modern natural-gas power plant—and you don’t have the expense of building, operating, and maintaining the physical plant.

Falling costs for sensors and microcontrollers are leading to the rapid growth of the Internet of Things. Combined with smart home technology, IoT makes it possible to imagine a world in which all energy devices—loads, energy storage, and generators—are actively coordinated to keep the grid stable and take full advantage of renewable energy. But challenges do lie ahead.

First, there are few standards today to guide manufacturers interested in device-level coordination and no real incentives for them to adopt any particular approach. This has resulted in a proliferation of proprietary technologies that address the same fundamental problem. Here, again, we can draw inspiration from the Internet: Proprietary solutions are unlikely to scale up to the point of addressing the energy problems at hand. New initiatives driven by industry such as EcoPort (formerly CTA 2045) and Matter (formerly Connected Home over IP) hold promise for secure, low-latency communications with devices made by different manufacturers. IEEE technical committees, working groups, and task forces are also playing supporting roles, such as the IEEE Power and Energy Society’s Smart Buildings, Loads, and Customer Systems technical committee. We hope that in the future these efforts will seamlessly support the device-driven “packetization” concepts described here, and not just serve traditional top-down communication and control architectures.

What’s also needed are incentives for electricity customers to shift their energy usage. Right now, the daily cost of electricity for a residential water heater is about the same, regardless of when the heater turns on. There’s no financial benefit to the homeowner to run the water heater when renewable energy supply is high or the wholesale electricity price is low. Regulators, utilities, and others will need to rethink and redesign incentives and flexible-demand programs to ensure that the contributions and rewards are fair and equitable across all customers. They will also need to educate consumers about how the program works.

There is plenty of precedent for solving such technical and policy challenges. A public system that is fair, responsive, accessible, reliable, resilient, and scalable sounds a lot like the Internet. Packetized energy management, with its core design modeled on the Internet’s data communications, would deliver those same important benefits. As we transition to a new kind of grid, based on distributed and renewable generation, we’ll need new technology and new paradigms. Fortunately, we have a time-tested model that is showing us the way.

This article appears in the February 2022 print issue as “Packetizing the Power Grid.”

## To Probe Further

For a deeper dive into packetized energy management, see the authors’ scholarly work:

Pooya Rezaei, Jeff Frolik, and Paul Hines, “Packetized Plug-in Electric Vehicle Charge Management,” IEEE Transactions on Smart Grid, Vol. 5, no. 2, March 2014.

Mads Almassalkhi et al., “Asynchronous Coordination of Distributed Energy Resources With Packetized Energy Management,” Energy Markets and Responsive Grids: Modeling, Control, and Optimization (Springer-Verlag, 2018).

Luis A. Duffaut Espinosa, Adil Khurram, and Mads Almassalkhi, “Reference-Tracking Control Policies for Packetized Coordination of Heterogeneous DER Populations,” IEEE Transactions on Control Systems Technology, Vol. 29, no. 6, November 2021.

The authors’ patents on the technology include:

“Systems and methods for random access charge management,” U.S. Patent No. 11,171,484, Jeff Frolik and Paul Hines, 2021.

“Packetized energy management control systems and methods of using the same,” U.S. Patent No. 11,150,618, Jeff Frolik, Paul Hines, and Mads Almassalkhi, 2021.

Other concepts for packetizing energy can be found in Bowen Zhang and John Baillieul’s “A Packetized Direct Load Control Mechanism for Demand Side Management,” 2012 IEEE 51st IEEE Conference on Decision and Control; Pedro H.J. Nardelli et al.’s “Energy Internet via Packetized Management: Enabling Technologies and Deployment Challenges,” IEEE Access, Vol. 7, 2019; and Giuseppe Graber et al.’s “Two-Stage Stochastic Sizing and Packetized Energy Scheduling of Bev Charging Stations With Quality of Service Constraints,” Applied Energy, February 2020.