AiBEX
← Learn

How does AiBEX's optimization work?

Linear optimization (LP), 96 intervals, battery arbitrage — explained without mathematical jargon.

Updated: 2026-05-10

What does the optimizer actually do?

AiBEX (B2B energy management platform, aibex.bg) uses linear optimization (Linear Programming, LP) to solve one simple problem:

For each of the 96 intervals of the next day, what should the battery do — charge, discharge, or idle?

The goal is one: minimize the customer’s total daily bill.

What inputs do we receive?

InputSourceExample
96 spot pricesDAM from БНЕБ/OPCOM/HEnEx[105.2, 98.4, ..., 187.1] EUR/MWh
Consumption forecastML model based on the site’s history[12.4, 11.8, ..., 8.2] kWh/15min
PV generation forecastWeather + installation specifics[0, 0, ..., 9.5, ..., 0] kWh/15min
Battery capacityFixed by configuration50 kWh useable
Cycle efficiencyBattery manufacturer92% round-trip
Current SoCReal-time from the gateway67%

What constraints do we have?

  1. SoC always between 10% and 90% (battery protection).
  2. Cannot simultaneously charge and discharge.
  3. Power rate ≤ inverter kVA limit.
  4. Energy flowing to the grid is sold at spot price ~ feed-in tariff (depends on country).

What does one solution look like?

15-minPrice (EUR/MWh)ActionBattery SoCNet cost (EUR)
02:0078Charge 5 kW from grid18% → 25%-0.10
02:1582Charge 5 kW25% → 32%-0.10
18:00245Discharge 5 kW87% → 80%+0.31
18:15251Discharge 5 kW80% → 73%+0.31

The spread between ~80 EUR/MWh (night) and ~250 EUR/MWh (evening peak) is significant — 3x. That’s the currency AiBEX trades in.

Why linear optimization?

Because the problem is perfectly linear:

  • Fixed battery capacity
  • Constant cycle efficiency
  • Known prices for the next 24 hours
  • Linear objective function (minimize total cost)

Linear problems can be solved quickly and accurately. AiBEX uses HiGHS — an open-source LP solver that solves a typical 96-interval problem in ~5 seconds.

AiBEX vs alternatives

ApproachSpeedAccuracyReaction to changes
AiBEX (LP)5sGlobal optimumAutomatic after every new price
Heuristic “charge at night, discharge in evening”0sOften 60-70% of optimumNo
Excel-based planning30-60 minutesDepends on experienceNo
ML / RL approach50-500msVariesPossible

Why not ML?

Because linear problems with known prices don’t benefit from ML. ML is strong when there are non-linearities, hidden patterns, or uncertain inputs. We have none of those here. LP is the right tool.

And the consumption forecast — do we use ML there?

Yes. The consumption forecast is a stochastic problem (depends on people’s behavior, weather, day of week) and there our ML model adapts to the profile of the specific site. After ~30 days of observation, the model becomes personalized.