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?
| Input | Source | Example |
|---|---|---|
| 96 spot prices | DAM from БНЕБ/OPCOM/HEnEx | [105.2, 98.4, ..., 187.1] EUR/MWh |
| Consumption forecast | ML model based on the site’s history | [12.4, 11.8, ..., 8.2] kWh/15min |
| PV generation forecast | Weather + installation specifics | [0, 0, ..., 9.5, ..., 0] kWh/15min |
| Battery capacity | Fixed by configuration | 50 kWh useable |
| Cycle efficiency | Battery manufacturer | 92% round-trip |
| Current SoC | Real-time from the gateway | 67% |
What constraints do we have?
- SoC always between 10% and 90% (battery protection).
- Cannot simultaneously charge and discharge.
- Power rate ≤ inverter kVA limit.
- Energy flowing to the grid is sold at spot price ~ feed-in tariff (depends on country).
What does one solution look like?
| 15-min | Price (EUR/MWh) | Action | Battery SoC | Net cost (EUR) |
|---|---|---|---|---|
| 02:00 | 78 | Charge 5 kW from grid | 18% → 25% | -0.10 |
| 02:15 | 82 | Charge 5 kW | 25% → 32% | -0.10 |
| … | … | … | … | … |
| 18:00 | 245 | Discharge 5 kW | 87% → 80% | +0.31 |
| 18:15 | 251 | Discharge 5 kW | 80% → 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
| Approach | Speed | Accuracy | Reaction to changes |
|---|---|---|---|
| AiBEX (LP) | 5s | Global optimum | Automatic after every new price |
| Heuristic “charge at night, discharge in evening” | 0s | Often 60-70% of optimum | No |
| Excel-based planning | 30-60 minutes | Depends on experience | No |
| ML / RL approach | 50-500ms | Varies | Possible |
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.