Ojay.lk

Ojay.lk Contact information, map and directions, contact form, opening hours, services, ratings, photos, videos and announcements from Ojay.lk, Information Technology Company, Colombo.

We built a machine learning model to forecast Sri Lanka's monthly electricity demand. Here's how it works and what drive...
16/04/2026

We built a machine learning model to forecast Sri Lanka's monthly electricity demand. Here's how it works and what drives it. ๐Ÿ‡ฑ๐Ÿ‡ฐโšก

๐Ÿ“‚ DATA SOURCES (all publicly available)

The model runs entirely on open data published by Sri Lankan and international institutions:

๐Ÿ”น CEB / PUCSL โ€” monthly generation by source (solar, wind, hydro, coal, oil)
๐Ÿ”น Central Bank of Sri Lanka โ€” quarterly real GDP, nominal GDP, tariff index, Services PMI, Construction PMI, industrial production index
๐Ÿ”น Open-Meteo โ€” Colombo hourly weather aggregated monthly: mean temp, afternoon peak temp, monthly max daily high, total rainfall, wind speed
๐Ÿ”น NOAA Climate Prediction Center โ€” Oceanic Niรฑo Index (ENSO), current month + 2-month forecast lead
๐Ÿ”น Department of Motor Traffic โ€” EV registrations converted to estimated monthly charging load
๐Ÿ”น Government Gazette โ€” weekday public holiday count per month
๐Ÿ”น SLSEA / CEB โ€” installed rooftop solar capacity (MW)

๐Ÿ”ง HOW THE MODEL WORKS

The model predicts net demand โ€” total generation minus solar โ€” using two components working together.

Component 1: Trend model (Ridge regression)
A regularized linear model trained on the economic and weather factors that drive demand up or down each month:
โ–ช Real GDP at constant 2015 prices โ€” day-weighted monthly share of quarterly GDP
โ–ช Electricity tariff index โ€” price elasticity (lower tariff = higher consumption)
โ–ช Afternoon peak temperature (noonโ€“3pm) โ€” the main air conditioning load driver
โ–ช 24-hour mean temperature โ€” ambient baseline
โ–ช ENSO / ONI โ€” current month and 2-month lead (drought and rainfall outlook)
โ–ช EV charging load โ€” structural new load added from 2025 onward
โ–ช Rooftop solar capacity, NE monsoon flag, wind speed, cloud cover, holidays, COVID lockdown intensity, grid disruption severity

Component 2: GDP-adjusted seasonal index (two-pass)
A naive seasonal index simply averages demand by calendar month across years โ€” but those years had very different GDP levels (pre-crisis 2021 vs. the crash of 2022). That GDP variation leaks into the seasonal multipliers and weakens the model.

The fix: a two-pass GDP-purged seasonal index.

Pass 1 โ€” fit a rough trend model using a raw seasonal index.
Pass 2 โ€” compute the ratio of actual demand to the trend model's full prediction. Because the trend already accounts for GDP, tariffs and all economic drivers, this ratio isolates the pure calendar seasonal pattern, stripped of economic-cycle noise. Average per calendar month and normalize.

Final prediction = trend prediction ร— GDP-adjusted seasonal multiplier

๐Ÿ“ˆ HOW ACCURATE IS IT?

Accuracy is measured using Leave-One-Out (LOO) cross-validation. The model is retrained on all months except the one being predicted, so every forecast is genuinely out-of-sample.

โœ… MAPE (Mean Absolute % Error): 1.87%
โœ… MAE: 0.86 GWh/day
โœ… Rยฒ: 0.880
๐Ÿ“… Trained on 62 months of data (January 2021 โ€“ early 2026)

On a typical day consuming ~46 GWh, the monthly average forecast is within ยฑ0.86 GWh/day โ€” roughly a 3.8% error. That's tight enough for annual generation planning, fuel procurement decisions and detecting grid stress months before they arrive.

The net demand forecast feeds into a full dispatch cascade (solar + wind + mini hydro + major hydro โ†’ coal โ†’ oil), producing monthly grid health flags: grid stress risk, high-cost months and renewable surplus months.

๐Ÿ”ฎ WHAT DO YOU NEED TO PREDICT THE FUTURE?

To generate a forward forecast, you need these inputs โ€” all publicly available:

๐Ÿ”น Quarterly real GDP forecast โ†’ CBSL Economic Projections
๐Ÿ”น Nominal GDP outlook โ†’ CBSL Monetary Policy Reports
๐Ÿ”น Electricity tariff outlook โ†’ PUCSL tariff orders
๐Ÿ”น Seasonal temperature outlook โ†’ NOAA / DMC seasonal forecast
๐Ÿ”น ONI / ENSO forecast (2-month lead) โ†’ NOAA CPC
๐Ÿ”น EV registration growth rate โ†’ Motor Traffic Department
๐Ÿ”น Public holiday calendar โ†’ Government Gazette
๐Ÿ”น Rooftop solar capacity projection โ†’ SLSEA / PUCSL

Services PMI and Construction PMI are published monthly by CBSL in their Monthly Economic Indicators bulletin.

Model built with open-source Python (scikit-learn, pandas). All source data is publicly available from the institutions listed above.

๐Ÿงฉ KEY DEMAND DRIVERS

(within-year correlations with net electricity demand, 2021โ€“2026)

NE monsoon season โ†’ r = โˆ’0.45 (cooler months, lower AC load)
Grid disruption severity โ†’ r = โˆ’0.31 (forced demand suppression)
Afternoon peak temperature โ†’ r = +0.26 (AC load driver)
COVID lockdown intensity โ†’ r = โˆ’0.18 (restricted economic activity)
Real GDP index โ†’ r = +0.16 (economic activity level)
Electricity tariff index โ†’ r = โˆ’0.14 (higher price = lower consumption)
Weekday public holidays โ†’ r = โˆ’0.13 (fewer commercial operating hours)
ENSO / ONI index โ†’ r = +0.11 (El Niรฑo = drier conditions = tighter supply)
Rooftop solar capacity โ†’ r = โˆ’0.08 (self-consumption reduces grid draw)

14/04/2026
42,000 EVs on Sri Lanka's roads. How much does that actually cost the grid?We ran the numbers. The answer might surprise...
10/04/2026

42,000 EVs on Sri Lanka's roads. How much does that actually cost the grid?

We ran the numbers. The answer might surprise you โ€” in both directions.

The assumptions (so you can judge for yourself)

Using actual 2025 DMT registration data. Key modelling choices:

EV cars assumed to do 2,000 km/month (conservative urban commuter). Bikes and three-wheelers 5,000 km/month โ€” higher because most are used commercially. Efficiency: 0.18 kWh/km for cars (think BYD Dolphin class), 0.04 for e-bikes, 0.08 for e-tuks. Worst-case charging window: all vehicles plug in simultaneously between 7โ€“10 PM. Diesel peaking cost calculated at LKR 277/litre, 35% generation efficiency. Change any of these and the numbers shift proportionally โ€” the methodology is open.

The baseline impact: almost nothing

Running the full 2025 fleet against those assumptions:

โ†’ EV electricity demand in December 2025: 0.32 GWh/day
โ†’ Share of the national grid: 0.66%
โ†’ Full-year EV consumption: 116 GWh out of ~17,700 GWh total

To put that in perspective โ€” the 2022 economic crisis knocked 3.0 GWh/day off demand overnight. El Niรฑo cuts hydro by ~2.4 GWh/day when it hits. The LPG cooking switch after the crisis permanently added ~0.4 GWh/day to base load. EVs today are 9ร— smaller than the crisis impact and roughly comparable to the cooking switch โ€” except the cooking switch happened in months, while the EV fleet took years to build.

At current scale, EVs are genuinely a rounding error.

The worst-case scenario: a different story

What if every EV owner plugs in at 7 PM? They will. That's when people get home.

Using actual 15-minute CEB generation data, Sri Lanka's evening peak hits 2,492 MW at 19:15 local time on a typical December 2025 day โ€” solar already at zero, demand still climbing.

Compress all EV charging into that 3-hour window:

โ†’ Instantaneous EV load: 108 MW
โ†’ Share of the evening peak: 4.3%
โ†’ If that load is covered by diesel peaking plant: LKR 25.6 million per day

108 MW is not trivial. That is the output of a small peaking unit running flat out โ€” just for EVs. And this is at 42,000 vehicles. The fleet is doubling roughly every 18 months.

The real risk isn't today โ€” it's the trajectory

42,000 EVs is 0.66% of grid demand. Fine.
420,000 EVs is 6.6%. Needs active management.
Beyond that, evening peak architecture changes completely.

The grid investment cycle is 5โ€“10 years. Smart charging infrastructure, time-of-use tariffs, and demand-response frameworks need to be in place before the numbers become critical โ€” not after.

The good news: EVs charged against midday solar โ€” rooftop or utility โ€” flip from liability to asset. They absorb excess generation that would otherwise be curtailed. The physics works in our favour. The policy doesn't exist yet.

If you are working on EV charging policy, grid integration, or demand-side management in Sri Lanka, this is the moment to act.

Sri Lanka spent 11 years building a gas cooking culture. The 2022 crisis dismantled part of it in months.Here is what th...
10/04/2026

Sri Lanka spent 11 years building a gas cooking culture. The 2022 crisis dismantled part of it in months.

Here is what the data shows โ€” and what it means for the grid.

The growth story first

In 2012, just 18.5% of Sri Lankan households cooked on LPG. By 2023, that number had reached 42.4% โ€” nearly 2.6 million homes out of 6.1 million total. That is roughly 146,000 households switching to gas every year, consistently, for over a decade.

LPG wasn't just convenient. It was a sign of a household moving up. The infrastructure, the dealer networks, the cylinder distribution โ€” all of it built steadily on the back of that adoption curve.

Then in 2022, the forex crisis cut LPG imports. Cylinders disappeared from shelves. Households were forced to find alternatives almost overnight.

What we modelled

Using actual LPG import data (2014-2026), census household figures, and a pre-crisis demand trend as the counterfactual, we estimated the displacement effect year by year.

The household calibration: 2.6 million LPG households consuming ~12.5 thousand barrels/day works out to roughly 0.66 kg per household per day โ€” about 1.6 cylinders per month. That is the baseline from which we measure the drop.

At the 2022 crisis peak, LPG demand fell 2.07 kbd below trend. That maps to approximately 432,000 households displaced โ€” about 1 in 6 LPG-using families.

By 2025, around 355,000 remain displaced. Some recovered access to LPG but kept their rice cooker. Some fully switched. Most did something in between.

The grid impact โ€” two scenarios

Not everyone switched the same way. Most households bought a rice cooker and an electric kettle but kept the gas stove for curries and frying. Some installed induction hobs and stopped buying cylinders entirely.

Partial switch (rice cooker + kettle, gas kept): 0.32 GWh/day added to the grid in 2025.
Full switch (induction replaces gas entirely): 0.80 GWh/day.

Reality sits somewhere in between. Cross-checking with a GDP-gap model โ€” what demand should be if it only tracked economic growth โ€” gives an independent estimate in the same range.

The part that surprised us

Here is what the numbers revealed that we did not expect going in.

60% of displaced households kept a gas cylinder at home. Not because they switched back. Because Sri Lanka has load shedding, and a household that depends entirely on electricity for cooking is genuinely vulnerable during a power cut.

This behaviour has an accidental grid planning implication: during extended load shedding, up to 0.21โ€“0.53 GWh/day of electric cooking load drops off the grid automatically as these households revert to their backup cylinder. No demand response programme. No smart meter. No utility instruction. It just happens.

The 2022 crisis accidentally created one of the most effective demand response buffers in Sri Lanka's grid history โ€” and nobody designed it.

The catch

As grid reliability improves and LPG prices rise relative to electricity, households will stop renewing backup cylinders. The buffer quietly disappears. The load becomes permanently embedded. Another invisible structural shift โ€” and another reason why cross-sector data visibility matters for grid planning.

The same pattern will play out with EVs, with rooftop solar, with any future fuel transition. The grid does not exist in isolation from the decisions being made in transport, housing, and trade policy.

Sri Lanka's electricity data tells a story that every renewable advocate needs to understand.We mapped five years of act...
09/04/2026

Sri Lanka's electricity data tells a story that every renewable advocate needs to understand.

We mapped five years of actual grid data โ€” demand, hydro, solar, wind, coal, oil โ€” against climate cycles, economic shocks, and EV uptake. Here's what stands out:

The grid is more climate-dependent than most people realise.
El Niรฑo years cut major hydro output by ~17% compared to La Niรฑa years. When reservoirs run low, coal fills the gap โ€” automatically, by design. The 2023-24 El Niรฑo (strongest in decades) is clearly visible in the data as sustained hydro suppression pushing up coal dispatch. A single climate cycle can undo months of renewable progress.

This is exactly why variable renewable capacity needs storage and grid intelligence behind it โ€” not just more panels and turbines. The grid already knows how to absorb renewable generation. What it struggles with is unpredictable renewable generation during the months it needs it most.

Rooftop solar is quietly reshaping demand in ways the official data doesn't capture.
Behind-the-meter generation never reaches the grid โ€” so it shows up as falling demand, not rising generation. The real renewable pe*******on in Sri Lanka is almost certainly higher than published figures suggest. We just don't have good visibility into it yet.

On EVs โ€” the opportunity window is open, but narrow.
42,000 EVs registered in 2025, mostly bikes. Grid impact today: negligible (

Built a cascaded ML model to forecast Sri Lanka's electricity demand and generation mix โ€” using only public data.Demand ...
09/04/2026

Built a cascaded ML model to forecast Sri Lanka's electricity demand and generation mix โ€” using only public data.

Demand MAPE: 2.4%. Rยฒ: 0.80 โ€” the remaining 20% is largely unobserved variables we don't have public data for yet (EV fleet size, real-time tariff response, informal rooftop solar capacity).

The interesting modelling challenge wasn't the forecasting itself. It was feature engineering across siloed sectors.

The 2022 crisis is a good example. When LPG supply collapsed, residential load profiles shifted โ€” electric cooking load created a measurable, persistent step-change in base demand that looks like an anomaly if you don't know to look for LPG availability as a feature. It's not a weather event, not a tariff change โ€” it's a forex crisis propagating through the energy system across ministry boundaries.

Same problem in reverse with rooftop solar: behind-the-meter generation suppresses metered demand, so the grid sees a load reduction with no corresponding generation record. If you model demand against historical patterns without accounting for installed rooftop capacity, you're systematically chasing a phantom.

Climate also plays a measurable role. El Niรฑo years reduce major hydro output by ~17% compared to La Niรฑa years โ€” directly pushing more load onto coal. The 2023-24 El Niรฑo (ONI peaked at 2.1, strongest in decades) is clearly visible in the generation data.

On EVs โ€” 42,000 vehicles registered in 2025, and the curve is accelerating. Monthly registrations nearly tripled from January to July alone. Right now the grid impact is small (

Address

Colombo
10400

Website

Alerts

Be the first to know and let us send you an email when Ojay.lk posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Share