While solar and wind power are rapidly becoming cost-competitive with fossil fuels in areas with lots of sun and wind, they still can’t provide the 24/7 power we’ve become used to. At present, that’s not big a problem because the grid still features plenty of fossil fuel plants that can provide constant baseload or ramp up to meet surges in demand.

But there’s broad agreement that we need to dramatically decarbonize our energy supplies if we’re going to avoid irreversible damage to the climate. That will mean getting rid of the bulk of on-demand, carbon-intensive power plants we currently rely on to manage our grid.

Alternatives include expanding transmission infrastructure to shuttle power from areas where the wind is blowing to areas where it isn’t, or managing demand using financial incentive to get people to use less energy during peak hours. But most promising is pairing renewable energy with energy storage to build up reserves for when the sun stops shining.

The approach is less complicated than trying to redesign the grid, say the authors of a new paper in Joule, but also makes it possible to shift much more power around than demand management. A key question that hasn’t been comprehensively dealt with, though, is how cheap energy storage needs to get to make this feasible.

Studies have looked at storage costs to make renewable energy arbitrage (using renewables to charge storage when electricity prices are low and then reselling it when demand and prices are higher) competitive in today’s grid. But none have looked at how cheap it needs to get to maintain a grid powered predominantly by renewables.

Little was known about what costs would actually be competitive and how these costs compare to the storage technologies currently being developed,” senior author Jessika Trancik, an associate professor of energy studies at the Massachusetts Institute of Technology, said in a press release. “So, we decided to address this issue head on.”

The researchers decided to investigate the two leading forms of renewable energy, solar and wind. They looked at how a mix of the two combined with storage technology could be used to fulfill a variety of roles on the grid, including providing baseload, meeting spikes in demand in peak hours, and gradually varying output to meet fluctuating demand.

Unlike previous studies that generally only investigate on timescales of a few years, they looked at what would be required to reliably meet demand over 20 years in 4 locations with different wind and solar resources: Arizona, Iowa, Massachusetts, and Texas.

They found that providing baseload power at a price comparable to a nuclear power station would require energy storage capacity costs to fall below $20 per kilowatt hour (kWh). To match a gas-powered plant designed to meet peak surges would require costs to fall to $5/kWh.

That’s a daunting target. There are some storage technologies that can keep costs below the $20/kWh mark, such as using excess power to pump water up to the top of a hydroelectric dam or compress air that can later be used to run a turbine. But both of these take up a lot of space and require specific geographic features, like mountains or underground caverns, that make them hard to apply broadly.

Despite rapid reductions in costs, today’s leading battery technology—lithium-ion—has only just dipped below $200/kWh, suggesting conventional batteries are still some way from being able to meet this demand. Alternative technologies such as flow batteries could potentially meet the cost demands in the mid-term, the authors say, but they’re still largely experimental.

However, the researchers also investigated the implications of allowing renewables to fail to meet demand just 5 percent of the time over the 20 years, with other technologies filling the gap. In that scenario, renewables plus storage could match the cost-effectiveness of nuclear baseload at just $150/kWh—well within the near-term reach of lithium-ion technology, which is predicted to hit the $100/kWh mark in the middle of the next decade.

Questions remain over whether already-strained lithium-ion supply chains could deal with the demand required to support an entire national grid. The authors also admit their analysis doesn’t consider the cost of meeting the remaining five percent of demand through other means.

Overall, the analysis suggests a grid built primarily around renewables and energy storage could approach the cost of conventional technologies in the medium term. But barring any surprise technological developments, there’s still likely to be a significant gap in cost-effectiveness that could slow adoption.

That gap could be dwarfed by the price of unchecked climate change, though. With that taken into consideration, renewables combined with energy storage could provide a viable route to a sustainable grid.