LAUSANNE, SWITZERLAND // It is a high-wire balancing act.
To modulate the flow of energy generated by a combination of solar farms, wind turbines and power plants to match a community's demand, you need to assess economic and environmental benefits on the world's most slippery abacus, power grids that have become more complex and less predictable.
At the moment, the companies that run power systems rely mainly on algorithms to work out how to route power. But responding to a wide array of conditions while guaranteeing uninterrupted supply at all times, without limiting how much people can consume, has proven challenging and even ineffective.
In Al Hamra village of Ras al Khaimah, for instance, the energy from some half a dozen generators is distributed in a fixed and automatic way. That makes the system vulnerable to breakdowns and blackouts, repeatedly forcing families from their homes in the hot summer months.
Now a group of Swiss researchers plans to implement for the first time a smart power grid on a chip that they say will manage supply and demand thousands of times faster than any comparable system.
Using a single, cheap microchip - it costs about the same as a latte - the technology will dramatically speed up the response to sudden power failures, and even anticipate them before they happen.
Maher Kayal, a professor of electrical engineering and analog circuits who works in the Electronics Laboratory at Ecole Polytechnique Fédérale de Lausanne (EPFL), has already managed to develop hardware for managing a network 1,000 times more quickly than existing technology.
His team's latest chip, which will be tested on a large scale in Ras al Khaimah, can compute 10,000 times faster than real-time, allowing it to play out thousands of scenarios and calculate which is more likely. It emulates the power system and its behaviour in its mapped circuitry, working out the interplay between the currents and voltages from the various generators, the losses and resistances of the transmission lines and the power loads.
"As soon as you mismatch supply and demand, the whole system collapses, and this is why you see these blackouts," said Prof Kayal.
"But if we are faster than the real time, if we can create something on the silicon that is dedicated to the details of the grid, so that every single failure scenario or behaviour is pre-defined and anticipated, we have an answer for every disturbance and it is solved before it has even happened. Computers now are not able to solve such problems."
It was an inability of the grid to adjust quickly to an unexpected event - the sagging and then shutdown of a single high-voltage power line -that lay at the root of the 2003 blackout across much of north-eastern North America.
The Al Hamra pilot project is among several being run in Ras al Khaimah by EPFL, which has launched a new post-graduate programme in the emirate. Officials see the area as a clean slate for case studies and experimental research of energy systems, energy management and sustainable urban design.
This is the sort of long-term thinking that many in the Northern Emirates, including members of the FNC have called for amid recurring blackouts in Sharjah and Fujairah, particularly when demand peaks in summer.
In Al Hamra village, Prof Kayal's team will install plugs in homes to monitor the amount of energy being drawn from every socket in every room in every home.
That data will be fed to a website that will be open to the public. As well as providing a clearer picture of how power is distributed to different areas at different times, the project could also embarrass people into being more energy-conscious, he said.
"The future is about communicating energy - that is part of what makes energy smart," he said.
"If done right, we could generate less pollution, successfully introduce more and more green energy to the system, and at the end of the day spend less money after using the same amount of energy."
The chip could also be programmed to draw more power from renewable energy sources when they are more readily available, depending on climatic conditions.
The plugs could eventually allow users to control power when they are away from home, remotely switch electronics or air conditioning off and on. Temperatures for air or hot water could be adjusted by just a couple of degrees when the grid needs to be balanced.
"When you have top-down control and can optimise consumption minute-to-minute, and swap the percentage drawn from a source based on, say, how costly it is at a given time, you can dispatch in such a way to save money," Prof Kayal said.
Currently, systems that measure power demand typically have a 10-minute time lag, while plans for some wide-scale power management systems in other parts of the world would cut that to as little as two minutes. Still, that leaves a gap.
"We are blind in that time," said Theo Kyriakidis, a student who will be working on the project. "Any fault, such as a thunderbolt or equipment malfunction, could happen to the grid, but if we have already emulated thousands of these sort of scenarios we can actually predict the future."
The lightning risk, for example, is greater than one might expect. In 1999, a lightning strike sparked what at the time was the world's biggest blackout, with power lost to tens of millions of people in southern Brazil.
The chip, which Prof Kayal said would cost only a few dollars, could be reconfigured and programmed according to town or district by matching its tiny architecture to each detail of the power system.
But it is a way off yet. Although the Swiss-Swedish power company ABB, which is partly funding the project, has filed for a patent, work on the Ras al Khaimah pilot will not begin in earnest until next year, and it is likely to be five years before the system is commercially available.