Quantum Solar Optimization

Background primer

Solar + storage, explained

How residential solar panels and battery systems work, and why optimizing them is hard.

Fundamentals

How solar panels work

Solar panels convert sunlight into electricity through the photovoltaic effect.

01

Sunlight hits the panel

Each particle of light carries a bit of energy into the silicon.

02

Electrons get excited

That energy knocks electrons loose from their atoms.

03

Electricity flows

Loose electrons all pushed one way are an electric current.

04

Power your home

An inverter converts the panel’s direct current into the alternating current a house runs on.

A panel does not choose when to work. Its output is set by where the sun is, so it traces the same arch every clear day: nothing before dawn, a peak around noon, nothing after dusk. You cannot ask it for more power at six in the evening. It produces what the sky gives it.

A typical home installation is a few kilowatts of panels. The one I model is 5 kW, which in Colorado makes roughly 20 to 30 kWh on a clear summer day and much less in winter, when the days are shorter and the sun sits lower. My program does not guess at any of this. It uses hourly output from PVWatts, a tool of the National Laboratory of the Rockies (a U.S. Department of Energy lab), which models the panels from years of measured weather at that spot.

The catch

Solar panels only generate power when the sun is shining, and a house is usually at its emptiest right when the sun is at its highest. That gap between when power arrives and when it is wanted is the whole reason batteries are interesting.

Storage

Why we need batteries

Panels generate the most power at noon, but a home often needs the most electricity at 7 PM, the timing mismatch problem. A battery is a water tank for electricity: solar fills it, the home drains it, and you choose when to do each.

That choice is what makes this a real problem. Storing power is not free. Some is lost every time it goes in and comes back out, batteries wear with each cycle, and a battery that is full at noon cannot take any more, so spare sun is given away. Every decision to charge now is a decision not to have that room later. The key specs:

Capacity
How much energy it holds. Home packs run 10–15 kWh.
Power
How fast it can fill or empty, around 5 kW for a home unit.
Efficiency
How much of what goes in comes back out, 85–95%.
Lifespan
How many charge cycles it survives, rated at 5,000–10,000.

The hard part

Why this is hard for computers

Hour by hour, the system decides whether to use, store, sell, or buy power. The factors stack up fast.

01

Time-of-use pricing

Typical shape: a peak price in the evening, a lower price overnight, sometimes negative prices in strong solar hours. The tariff this project models has one peak window, 5–9 PM, and one flat off-peak price.

02

Weather uncertainty

Tomorrow’s output depends on tomorrow’s sky, which is a forecast, not a fact.

03

Usage patterns

The evening peak is what the battery has to cover, and its exact timing shifts day to day.

04

Battery constraints

Can't charge/discharge too fast or exceed capacity.

05

Efficiency losses

Every time you store energy, you lose some.

Total possible schedules

Over 10¹⁰

(10 billion) combinations for a single day

Ten billion is what makes this more than arithmetic. You cannot try every plan, and greedy rules do not work either. Charging whenever the sun is out sounds sensible, but it leaves the battery full at four in the afternoon with the expensive hours still ahead. The right move at noon depends on what the evening will cost, so the choices have to be made together, not one at a time.

The size matters for a second reason. Ten billion is large enough to be a real optimization problem and small enough that an ordinary computer can still find the provably best answer. That is why I picked it: anything else I try, including a quantum computer, can be graded against an answer already known to be correct.

Why it matters

Why anyone cares beyond one house

For a single home, getting this right is worth a few hundred dollars a year. On my data it is $456, which is real money but not a revolution.

People work on it because of what happens when there are millions. Home batteries all charging at the same cheap hour create a new spike exactly where the grid was trying to avoid one. Coordinated instead, the same fleet can absorb midday solar that would be wasted and cover the evening peak that gas plants are fired up for. The problem I am solving for one house is the small version of the one that decides whether that works.

It is also a good test case for optimization generally. The battery problem has a shape that shows up everywhere: decisions linked across time, with limits on what you can store. Shipping, manufacturing and network routing all share it.

Now you know the basics

See how I am tackling it