Research Article · Open Access
Rolling-horizon optimization of grid-tied PV–BESS for tariff savings, apparent-demand reduction, and critical-load survivability: A Tanzanian university case study
- ¹ Department of Electrical and Power Engineering, Mbeya University of Science and Technology, Mbeya, Tanzania
- ² Department of Geosciences and Mining Technology, Mbeya University of Science and Technology, Mbeya, Tanzania
Abstract
This work presents a measurement-based techno-economic and reliability framework for sizing and dispatching a behind-the-meter photovoltaic and battery energy storage system (PV–BESS) at Mbeya University of Science and Technology (MUST), Tanzania. The analysis uses 26,280 measured, audited, timestamp-synchronized 20-minute active/reactive load data. The PV-generation profile was derived from historical global horizontal irradiance (GHI) time-series data using a validated PV system simulation framework, then synchronized with the measured demand series. Reliability is assessed using a 50-event outage calendar compiled from verified TANESCO interruption records and cross-validated with campus facility logs. Among retained candidates, only one design satisfies both planning constraints: 400 kWp PV, a 100-kWh BESS, and a 50-kW bidirectional converter operated with a 40% reserve state of charge. Relative to the grid-only case, this design reduces grid purchases by 51.96%, annual maximum apparent demand by 14.49%, and the annual tariff bill by 48.25%. It yields an NPV of TZS 150.58 million, an internal rate of return of 9.57%, and a simple payback of 9.13 years. It achieves 99.87% two-hour survivability and supplies 99.49% of modeled critical energy in the outage-calendar replay. Overall, PV delivers most of the energy and tariff benefit, whereas the BESS is retained primarily for outage readiness; this distinction matters when interpreting the constrained optimum.
Keywords PV–BESS, rolling-horizon optimization, kVA demand charge, techno-economic analysis, critical-load resilience.
1. Introduction
This work is based on empirical field data collected over one complete calendar year at Mbeya University of Science and Technology (MUST), Tanzania. Active and reactive load profiles were obtained from the revenue-grade utility meter at the point of common coupling (PCC) at 20-minute resolution. The PV-generation profile was derived from historical global horizontal irradiance (GHI) time-series data using a validated PV system simulation framework. Outage records were drawn from TANESCO interruption logs and cross-checked against campus facilities records, yielding a verifiable empirical basis for reliability assessment.
Campus power demand spans teaching, laboratories, residences, information and communication technology, pumping, workshops, offices, and security. Planning therefore faces two coupled requirements: limiting energy and maximum-demand expenditure during normal grid-connected operation, while sustaining a defined critical-load service during utility interruptions. Campus energy-system design must be judged against both tariff outcomes and outage performance.
PV can reduce daytime grid purchases, but it cannot independently provide firm supply when solar generation is unavailable. A BESS adds dispatchable flexibility for energy shifting, peak management, and outage support, although its capital cost, cycling requirements, and degradation can reduce lifecycle economic value (Darghouth et al., 2020; Hanna et al., 2014; Rezaeimozafar et al., 2024). Consequently, PV and storage should be evaluated jointly against both operating-cost savings and long-term storage requirements rather than on first-year energy savings alone. Achieving resilience requires more than sufficient stored energy: the system must also provide an islanding-capable power-conversion interface, a protected critical-load bus, appropriate grid-forming capability, and coordinated protection and reconnection functions (Cook et al., 2018; Gorman et al., 2023). The present reliability analysis therefore represents energy adequacy during outages rather than a complete assessment of electrical islanding performance.
In Tanzania, apparent power must be represented explicitly for maximum-demand customers. Under the applicable TANESCO T2 tariff, electricity expenditure includes both an energy charge in TZS/kWh and a monthly maximum-demand charge expressed in TZS/kVA (EWURA, 2026). Consequently, reducing active grid import does not necessarily produce an equivalent reduction in billed maximum demand when significant reactive demand remains at the PCC. Recent PV–BESS research has also demonstrated the importance of accounting jointly for active and reactive power when evaluating inverter and storage operation (Polat et al., 2025). The present model therefore retains the measured reactive-power series from the campus revenue meter and computes billed apparent demand directly from realized active and reactive grid power rather than approximating the tariff using kW alone.
The present work provides: 1) a field-validated annual 20-minute model that couples measured active/reactive power, exact monthly kVA billing, BESS energy dynamics, and lifecycle cash flow; 2) a hierarchical solution in which a rolling dispatch LP is embedded in a discrete NPV-based sizing search; 3) joint feasibility criteria for peak reduction and two-hour critical-load survivability evaluated on a site-verified outage calendar; and 4) an empirical comparison that distinguishes the tariff value of PV from the outage-readiness role of storage.
1.1. Related work and research gap
PV–BESS performance is strongly influenced by load shape, tariff structure, forecast accuracy, and dispatch strategy. Foundational studies established that coordinated PV and battery operation can reduce grid purchases and demand charges, while later work showed that rate design can materially alter storage value and optimal size (Darghouth et al., 2020; Hanna et al., 2014). Recent research has extended this approach through rolling-horizon and MPC-based control. Erdinç (2023) demonstrated receding-horizon PV–storage scheduling, while Saleem et al. (2024) incorporated a 24-h MPC horizon, battery degradation, forecasts, and active/reactive-power support. Stevenson et al. (2024) further showed, using a university-campus BESS, that forecast uncertainty can affect practical dispatch performance.
Battery degradation is also increasingly integrated into planning because aging depends on depth of discharge, C-rate, temperature, mean SOC, and cycling history. Recent degradation-aware sizing studies show that these effects can materially alter lifecycle economics (Dolatabadi et al., 2024; Rezaeimozafar et al., 2024). Reliability adds another planning dimension: outage survivability depends on outage timing, duration, PV availability, critical-load magnitude, and stored-energy reserve. Recent work applies Expected Energy Not Served (EENS), Loss of Load Expectation (LOLE), and critical-load survivability to PV–BESS and microgrid planning (Gholami et al., 2023; Gorman et al., 2023; Kajal et al., 2025).
Despite this progress, recent studies rarely combine measured PCC active/reactive power, exact monthly kVA billing, rolling-horizon dispatch, lifecycle sizing, and site-specific outage reliability within one framework. This study addresses that gap for MUST, Tanzania, using measured 20-minute data and verified TANESCO outage records to select the highest-NPV design satisfying peak-reduction and two-hour survivability constraints under local tariff conditions.
2. Materials and Methods
2.1. Case-study site and system description
Mbeya University of Science and Technology (MUST) is in Mbeya, Tanzania. The study boundary is the main-campus PCC, where aggregate measured active power, reactive power, energy purchases, and monthly maximum apparent demand are evaluated. The load data used here were collected over a 12-month measurement campaign, audited by the university’s facilities department, and validated against utility billing records. The behind-the-meter system comprises the utility grid, an AC-connected PV plant, a BESS interfaced through a bidirectional converter, aggregate non-critical campus loads, and a critical-load panel. Figure 1 illustrates the electrical and control boundary represented in the optimization model.
Two operating modes are considered. In grid-connected mode, PV offsets campus active demand; surplus PV may charge the BESS; the grid supplies residual demand; and any unused PV is curtailed. Grid export and grid-to-battery charging are prohibited. In island mode, grid contribution is zero, and available PV and the BESS supply the critical-load block subject to converter limits and the physical SOC constraint. The reliability calculation is an energy-adequacy replay; it does not simulate electromagnetic transients, protection clearing, or inverter switching dynamics.
2.2. Annual load, reactive demand, and PV resource
The model uses measured data from one calendar year at uniform 20-minute resolution, corresponding to intervals and h. The active-load series integrates to 1,011.416 MWh with a maximum of 270 kW. The measured reactive-power series implies a maximum apparent demand of 300 kVA. Power factor varies from 0.85 to 0.95 over the year, with a mean of 0.90; the analysis uses the measured reactive series directly. All data were validated by the campus energy management system and cross-referenced against utility monthly billing statements.
The raw PV shape is aligned timestamp by timestamp with the measured demand series and normalized to an annual specific yield of 1,596 kWh/kWp/year using derived historical global horizontal irradiance (GHI) time-series data. Critical demand is represented as 10% of campus load based on feeder audits. For a candidate PV rating , available PV power is proportional to the normalized per-unit profile. Figure 2 summarizes the temporal structure of the measured 20-minute campus load. Daytime demand concentration favors direct PV self-consumption, whereas the seasonal high-demand band near the end of the year produces the most restrictive kVA condition.
2.3. Tariff, technology, and planning parameters
Tables 1 and 2 summarize the parameters used by the model. The tariff calculation applies an energy charge of 195 TZS/kWh, a monthly maximum-demand charge of 15,004 TZS/kVA, a service charge of 14,233 TZS/month, and taxes and levies equal to 22% of the tariff subtotal. Because the same tax multiplier is applied to both the grid-only baseline and candidate cases, the reported NPV reflects savings in the tax-inclusive bill.
| Annual energy | Active peak | Apparent peak | Time step | PV specific yield | Critical-load fraction |
|---|---|---|---|---|---|
| 1,011.416 MWh/year | 270 kW | 300 kVA | 20 min | 1,596 kWh/kWp/year | 10% |
| Reserve SOC | Peak-reduction floor | 2-h survival floor | Outage events | Mean outage duration | Project life |
| 40% | 13% | 85% | 50 | 3.4 h | 25 years |
|
Value | Parameter | Value |
|---|---|---|---|
|
2,600,000 TZS/kWp | BESS energy cost | 750,000 TZS/kWh |
|
300,000 TZS/kW | Discount rate | 8% |
|
1.5% of PV CAPEX/year | BESS O&M | 1.0% of BESS CAPEX/year |
|
0.5%/year | Tariff escalation | 0%/year |
|
95% | Discharge efficiency | 95% |
|
reserve to 90% | Physical islanded SOC floor | 10% |
|
90% | Battery C-rate | 0.5C |
|
year 15 | Replacement cost | 80% of initial BESS CAPEX |
|
195 TZS/kWh | Demand charge | 15,004 TZS/kVA/month |
|
14,233 TZS/month | Taxes and levies | 22% of tariff subtotal |
2.4. Optimization formulation
2.4.1. Sets, indices, and variables
Throughout the formulation, denotes active power (kW), reactive power (kvar), and apparent power (kVA). Superscripts identify load, grid, PV, and battery quantities; denotes stored energy (kWh). Grid apparent power at interval is , and the billed monthly maximum is . An individual candidate apparent-power cap is denoted by , while the finite cap set at reoptimization instant is denoted by .
Let index the 20-minute intervals. Calendar months are indexed by , project years by , and outage scenarios by . The subset collects the intervals in month , while collects the intervals belonging to outage . A candidate design is
where denotes PV capacity, the BESS energy capacity, the bidirectional converter power, and the protected normal-operation reserve fraction.
At each interval, the decision variables are grid import , PV utilization , PV curtailment , battery charging and discharging powers and , and end-of-interval stored energy . All equations below are written for a fixed design ; the design subscript is omitted when it is unambiguous.
2.4.2. PV utilization and grid-connected power balance
Given the normalized PV profile , the available PV power is
PV utilization and curtailment are related by
The AC active-power balance is enforced as
Export is ruled out via
To reflect the intended power-flow logic, the dispatch also imposes the following source/sink limits:
where . Equation (7) prohibits grid charging, whereas (8) ensures that battery discharge cannot create export. A binary charge/discharge variable is unnecessary: conversion losses, mutually exclusive upper bounds, and the positive throughput tie-break in the objective remove simultaneous charging and discharging in the reported solution.
2.4.3. Battery energy dynamics and SOC constraints
Stored energy evolves according to
with . During grid-connected operation,
The initial stored energy is set to . For each MPC horizon , the terminal safeguard
prevents the optimizer from drawing down terminal energy within its look-ahead window without accounting for replenishment.
2.4.4. Reactive power and exact apparent-demand billing
The model assigns all reactive load to the grid:
The term is the measured reactive power at the campus revenue meter, which provides an empirical basis for the kVA calculation.
Accordingly,
and the billed maximum demand in month is
Because Equation (13) is nonlinear, the implementation retains linear programming by evaluating individual apparent-power caps from the finite set . For each fixed cap, Equation (15) provides a constant bound on active grid import because reactive demand is known.
Seventeen caps are sampled between the physical lower bound, which accounts for the realized monthly peak and the magnitude of reactive demand, and the no-battery horizon peak. After dispatch, the tariff is recomputed using the exact apparent power in Equation (13). The cap search therefore linearizes dispatch while preserving exact reported kVA.
2.4.5. Rolling-horizon dispatch objective
At each reoptimization instant , every feasible cap is tested by solving
subject to Equations (3)–(15). Here stacks all interval variables. The parameters and are the energy and demand tariffs, is the larger of the realized month-to-date peak and the candidate horizon peak, and TZS/kWh serves as a throughput tie-break. Among feasible values, the selected cap is the one that minimizes Equation (16). The constant monthly service charge and common tax multiplier do not affect the minimizing dispatch.
Each horizon contains 72 intervals (24 h). The first three intervals (1 h) are implemented before the next reoptimization. Horizons are truncated at month boundaries so that demand charges accrue to the correct billing month.
This receding-horizon structure is consistent with recent PV–BESS energy-management approaches in which dispatch is repeatedly reoptimized as the operating horizon advances (Erdinç, 2023; Saleem et al., 2024). Related university-campus studies further demonstrate that forecast quality can materially affect the realized performance of storage scheduling (Stevenson et al., 2024). Using measured historical demand and the derived PV profile, this procedure provides a deterministic perfect-foresight benchmark; realized performance under operational forecasts must be evaluated separately.
2.4.6. Tariff and lifecycle economic model
The tax-inclusive monthly tariff cost is
where and is the monthly service charge. For design , the first-year bill saving is
where subscript 0 denotes the grid-only baseline.
Initial capital expenditure is
The first-year benefit is partitioned into PV-dependent and non-PV components. The PV-dependent component is bounded by the tariff value of PV energy used and degrades at per year:
Annual O&M is held constant in the base case. A battery replacement cost equal to 80% of the initial BESS energy CAPEX is incurred in year 15. The incremental project NPV is
IRR and simple payback are computed from the same incremental annual cash-flow sequence.
2.4.7. Islanded critical-load reliability
For outage , the critical active demand is
Each outage is initialized from the BESS energy at the corresponding grid-connected dispatch interval. PV serves the critical load first; the BESS then supplies any remaining demand, subject to and the physical energy floor
Unserved power is defined as
which yields
For a duration , an outage is initiated at every interval . Using circular year-end indexing, the all-start survivability is
where is the numerical energy-balance tolerance.
2.4.8. Constrained design selection and solution method
Annual maximum-demand reduction is
Final design selection is hierarchical:
subject to
and all technical validation checks. The operational subproblems are continuous LPs solved with MATLAB (Optimization Toolbox). This LP formulation is suitable because the time-coupled battery dynamics and power-balance constraints remain linear once the apparent-power cap is fixed; the small, explicit outer cap search then preserves exact kVA reporting. The annual sizing step is implemented as a discrete enumeration rather than a continuous sizing LP, which keeps candidate ranking transparent and reproducible over the declared search set.
2.5. Simulation and comparison design
2.5.1. Input validation and pre-processing
Before optimization, the MATLAB workflow verifies that the load and PV files each contain exactly 26,280 unique chronological timestamps separated by 20 min. These data were measured and audited by the campus facilities department. Active load must be finite and non-negative, reactive load must be present, and the load and PV timestamps must match exactly. Apparent power and power factor are recomputed from the active and reactive columns as an audit check. The measured annual quantities are 1,011.416 MWh, 270 kW, and 300 kVA.
The outage calendar is validated separately for event count, chronological start and restoration times, positive event durations, and timestamp consistency. The reliability calendar contains 50 interruption events occurring during the study year. Each event was retained only where interruption and restoration times could be cross-verified between available TANESCO interruption information and MUST campus facilities records. Event duration was calculated directly from the recorded timestamps, yielding a mean interruption duration of 3.4 h. These verification checks provide a site-specific empirical basis for the subsequent outage-calendar reliability assessment.
2.5.2. Candidate search and retained comparison cases
The sizing search evaluates PV ratings from 0 to 500 kWp in increments of 25 kWp. For each non-zero PV rating, the PV-only design and four BESS energy/power pairs are considered: 100/50, 200/100, 300/150, and 400/200 kWh/kW, fixing storage power at 0.5 times the energy rating. Joint-selection candidates use a 40% normal-operation reserve, yielding a transparent and finite design set. Peak-shaving dispatch is evaluated under a 24-hour perfect-foresight assumption; reported peak-demand savings should therefore be interpreted as an optimistic deterministic benchmark rather than a guaranteed outcome under uncertainty.
From this search space, six cases are retained to separate the effects of PV size, BESS size, and reserve policy:
C0, grid only;
C1, PV only: 200 kWp;
C2, peak-focused PV–BESS: 200 kWp and 100 kWh/50 kW with 10% minimum SOC;
C3, joint-optimal PV–BESS: highest NPV satisfying both Equations (30) and (31);
C4, higher-autonomy PV–BESS: 200 kWp and 200 kWh/100 kW; and
C5, larger system: 300 kWp and 300 kWh/150 kW.
C0 provides the baseline for bill savings, demand reduction, and incremental lifecycle cash flows. C1 separates the tariff value of PV from the incremental value of the BESS. Holding PV at 200 kWp, C2 and C4 isolate the effects of reserve policy and storage capacity, while C5 tests whether a larger system improves reliability at acceptable economic value. Case C3 is not predefined; it is returned by the constrained candidate ranking.
2.5.3. Rolling simulation sequence
For each grid-connected PV–BESS candidate, the simulation follows the steps below:
initialize stored energy at 90% of rated capacity and initialize the realized monthly kVA peak;
construct a 72-interval (24-h) deterministic horizon from the measured historical load and derived PV profile, truncated at the end of the current month;
evaluate 17 feasible apparent-power caps and solve the corresponding dispatch LPs;
select the feasible cap with the minimum combined energy, monthly-demand, and throughput-tie-break cost;
implement the first three intervals, update stored energy and the realized monthly peak, and repeat until year end;
recompute the exact interval kVA and tax-inclusive monthly bills from the realized dispatch; and
evaluate lifecycle economics, technical constraints, outage-calendar reliability, and all-start survivability.
This procedure couples battery energy across intervals while preserving the monthly tariff chronology. Using measured historical demand and the derived PV profile, this procedure provides a deterministic perfect-foresight benchmark; realized performance under operational forecasts must be evaluated separately.
2.5.4. Reliability experiments
Reliability is assessed using two complementary experiments to avoid relying on a single outage representation. First, the site-verified 50-event outage calendar described in Section 2.5.1 is replayed at the recorded start times and durations. Reported output includes critical energy served, EENS, LOLE, and the fraction of events fully supplied. Second, outages of 1, 2, 4, and 8 h are initiated at every one of the 26,280 intervals. This all-start experiment avoids reliance on a favorable subset of outage timestamps and quantifies seasonal and diurnal variation in PV availability and stored energy. Circular indexing is applied at the end of the year so that every interval remains a valid start.
PV-only reliability results are retained as a resource-adequacy benchmark, quantifying how often contemporaneous PV could cover the critical-load block. On their own, however, these results do not establish deployable islanded operation, which would additionally require a grid-forming voltage source and compliant protection.
2.5.5. Performance metrics, sensitivities, and software
Technical metrics include annual grid purchases, PV generation and curtailment, battery charge/discharge energy, annual and monthly kVA peaks, peak reduction, power-balance error, export, and SOC compliance. Economic metrics include the tax-inclusive annual bill, bill-saving percentage, CAPEX, NPV, IRR, and simple payback. Reliability metrics include duration-specific all-start survivability, calendar-replay critical energy served, EENS, and LOLE.
Two sensitivity experiments are retained. The reserve-SOC sweep varies the normal-operation reserve from 10% to 50% for the fixed 200-kWp PV, 100-kWh BESS and 50-kW converter configuration. For C3, the economic sensitivity combines four demand-charge multipliers (0.5, 1.0, 1.5 and 2.0) with nine common cost multipliers (0.6–1.4 in increments of 0.1), giving 36 combinations. The cost multiplier applies jointly to PV, BESS and converter installed costs, while component capacities remain fixed.
The model is implemented in MATLAB using from the Optimization Toolbox. The supplied package includes configuration, data loading and validation, grid-only and PV dispatch, rolling LP dispatch, tariff and economic evaluation, reliability replay, exhaustive survivability, sensitivity analysis, and spreadsheet/figure export routines. The analysis was performed in MATLAB R2024a with Optimization Toolbox version 24.1 on a computer with 32 GB RAM. The search across 100 candidate designs required approximately 12 h.
3. Results
3.1. Constrained design selection
Table 3 compares the six retained cases. C1 has the highest NPV among the retained cases, at TZS 294.087 million, but fails both planning constraints. C2, C4 and C5 satisfy the 85% two-hour survivability requirement but fail the 13% annual maximum-demand-reduction requirement. C3 is the only jointly feasible design among C0–C5, achieving 14.49% peak reduction and 99.87% two-hour survivability. Its selection reflects the joint constraints rather than unconstrained NPV maximization.
|
Name | PV (kWp) |
BESS/conv. (kWh/kW) |
Grid (MWh/y) |
Peak (kVA) |
Peak red. (%) |
Bill saving (%) |
NPV (M TZS) |
IRR (%) |
Payback (y) |
2-h surv. (%) |
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Grid only | 0 | 0/0 | 1011.416 | 300.000 | 0.00 | 0.00 | 0 | – | – | 0.00 |
|
PV only | 200 | 0/0 | 697.760 | 273.422 | 8.86 | 29.35 | 294.087 | 14.26 | 6.68 | 38.79 |
|
Peak-focused | 200 | 100/50 | 694.307 | 273.422 | 8.86 | 29.68 | 187.226 | 11.56 | 7.83 | 85.22 |
|
Joint-optimal | 400 | 100/50 | 485.851 | 256.538 | 14.49 | 48.25 | 150.582 | 9.57 | 9.13 | 99.87 |
|
Higher autonomy | 200 | 200/100 | 693.984 | 273.422 | 8.86 | 29.71 | 71.098 | 9.23 | 9.09 | 100.00 |
|
Larger system | 300 | 300/150 | 554.424 | 264.235 | 11.92 | 42.01 | 27.667 | 8.32 | 9.73 | 100.00 |
This comparison also makes the optimization logic transparent. Storage capacity alone does not guarantee a lower annual kVA peak: C2 and C4 share the same controlling apparent demand as C1 despite different BESS sizes and reserve policies. C3 satisfies the peak constraint primarily because the larger 400-kWp PV array reduces the active component of the high-demand intervals enough to exceed the 13% floor. Storage is included mainly to meet the outage constraint.
3.2. Annual energy balance and dispatch behavior
C3 yields 638.400 MWh of available PV energy. Of this total, 527.234 MWh is used, and 111.166 MWh is curtailed, corresponding to 17.41% of available production. Grid purchases drop from 1,011.416 MWh to 485.851 MWh, a 51.96% reduction. The BESS charges 17.121 MWh and discharges 15.452 MWh; the resulting 90.25% ratio is consistent with the modeled 95% charge and 95% discharge efficiencies.
Figure 3 presents the representative high-demand week selected by the model. PV reduces midday import and provides surplus for charging, whereas discharge is concentrated in shorter morning and evening intervals. Outside the solar window, the grid supplies the residual load. Because BESS power is small relative to the 400-kWp PV profile, annual energy reduction is largely PV-driven.
The battery-active worst-case day in Figure 4 is selected by first retaining days with both BESS charging and discharging, then identifying the day with the largest 20-minute C3 grid import. The selected day is 10 November 2025, with a grid-import peak of 228.20 kW, charging energy of 55.93 kWh and discharging energy of 33.61 kWh. SOC ranges from 40% to 90%. This conditional selection differs from the annual maximum-apparent-demand event.
Figure 5 extends this interpretation across the year. Charging clusters around the solar-surplus window, whereas discharge occurs mainly in the early morning and late afternoon/evening. The irregular seasonal bands indicate that the optimizer responds to both campus load and PV availability rather than following a fixed time-of-use rule. Because the heatmap is continuously interpolated for presentation, it supports temporal interpretation; however, the underlying workbook remains authoritative for interval maxima.
3.3. Maximum-demand and tariff effects
Annual maximum apparent demand drops from 300.000 kVA to 256.538 kVA, a 14.49% reduction. As Figure 6 shows, this annual metric masks larger reductions in most billing months. November remains the binding month because both residual active and reactive demands are high. At the C3 annual maximum demand interval (24 November, 17:00), grid import is 230.037 kW, reactive demand is 113.556 kvar, available PV contribution is 4.426 kW, and BESS discharge is zero. This indicates that the binding annual peak is reduced primarily by PV rather than battery dispatch.
Table 4 separates the annual tariff components. The energy-charge saving is TZS 102.485 million, and the demand-charge saving is TZS 14.059 million. Including the associated TZS 25.640 million reduction in taxes and levies, the total annual saving is TZS 142.184 million (48.25%). The 31.85% reduction in the sum of monthly demand charges is notably larger than the 14.49% annual maximum reduction because demand billing is based on twelve monthly peaks.
|
C0 | C3 | Saving |
|---|---|---|---|
|
197.226 | 94.741 | 102.485 |
|
44.145 | 30.086 | 14.059 |
|
0.171 | 0.171 | 0.000 |
|
53.139 | 27.499 | 25.640 |
|
294.681 | 152.497 | 142.184 |
Figure 7 shows bill reductions in every month under C3. Savings vary because each month combines different energy consumption, PV coincidence, and residual kVA peaks. This pattern aligns with the literature’s emphasis on load and tariff structure when valuing commercial storage (Darghouth et al., 2020; Kajal et al., 2025); direct numerical comparisons to other studies are avoided because tariffs, load shapes, and reliability definitions differ.
3.4. Lifecycle economics and design trade-off
C3 requires TZS 1.130 billion of initial CAPEX: TZS 1.040 billion for PV, TZS 75 million for BESS energy capacity, and TZS 15 million for the converter. Under the 25-year and 8% discount-rate assumptions, the project yields an NPV of TZS 150.58 million, an IRR of 9.57%, and a simple payback of 9.13 years. The positive NPV indicates economic feasibility under the model.
The retained cases separate financial return from joint technical feasibility. C1 avoids BESS and converter investment and has the highest retained-case NPV, TZS 294.087 million, but achieves only 8.86% peak reduction and 38.79% two-hour survivability. Adding a 100-kWh BESS with a 50-kW converter in C2 raises survivability to 85.22%, while peak reduction remains 8.86% and NPV falls to TZS 187.226 million. C3 combines a larger 400-kWp PV array with protected storage reserve, attaining 14.49% peak reduction and 99.87% two-hour survivability at an NPV of TZS 150.582 million. Thus, in these cases, storage supports outage energy adequacy, while sufficient coincidence between PV generation and campus demand is required to meet the peak constraint. C4 and C5 provide 100.00% two-hour survivability but fail the 13% peak-reduction requirement, so additional storage alone does not establish joint feasibility.
Figure 8 presents the evaluated sizing candidates, whereas Table 3 summarizes the six retained comparison cases. C1 has the highest NPV among the retained cases. C3 is selected by NPV ranking among the evaluated designs satisfying both the 13% annual maximum-demand-reduction requirement in Equation (30) and the 85% two-hour survivability requirement in Equation (31).
Figure 9 presents the NPV sensitivity of C3 to demand-charge levels and combined PV, BESS and converter installed costs. The analysis evaluates 36 combinations, comprising four demand-charge multipliers and nine common component-cost multipliers. Component capacities remain fixed, allowing the effects of tariff and investment-cost assumptions to be examined for the selected design.
3.5. Critical-load survivability and reserve trade-off
Table 5 reports both exhaustive all-start survivability and outage-calendar replay. C3 fully serves the 10% critical-load block for every one-hour start and for 99.87% of two-hour starts. As outage duration increases, survivability falls to 96.37% for 4 h and 82.20% for 8 h as stored energy becomes limiting. In the 50-event site-verified outage calendar, C3 serves 99.49% of required critical energy, with 10.76 kWh EENS and 1.33 h LOLE. In that calendar, C4 and C5 eliminate EENS, but their lower NPV and failure of the 13% peak constraint prevent selection.
|
Name | 1-h surv. (%) |
2-h surv. (%) |
4-h surv. (%) |
8-h surv. (%) |
Critical served (%) |
EENS (kWh) |
LOLE (h) |
|---|---|---|---|---|---|---|---|---|
|
Grid only | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 2107.529 | 170.00 |
|
PV only | 42.96 | 38.79 | 30.46 | 13.79 | 76.32 | 499.102 | 75.67 |
|
Peak-focused | 96.91 | 85.22 | 66.94 | 59.77 | 93.65 | 133.757 | 24.67 |
|
Joint-optimal | 100.00 | 99.87 | 96.37 | 82.20 | 99.49 | 10.759 | 1.33 |
|
Higher autonomy | 100.00 | 100.00 | 100.00 | 96.07 | 100.00 | 0.000 | 0.00 |
|
Larger system | 100.00 | 100.00 | 100.00 | 100.00 | 100.00 | 0.000 | 0.00 |
Figure 10 makes the duration explicit. PV-only survivability drops quickly as outage duration increases because supply depends on daylight and no stored energy is available. The curve should be read as a resource adequacy result rather than a deployable islanding claim. C3 tracks C4 closely for short outages but diverges at 8 h, indicating that short-duration reliability is largely a reserve/power issue, whereas extended autonomy increasingly hinges on energy capacity. This behavior matches the broader dependence of resilience on outage duration, critical load, and storage energy reported by Gholami et al. (2023), Gorman et al. (2023), and Nassif et al. (2022).
For C2 configuration, the reserve-SOC sensitivity in Figure 11 shows the economic–resilience trade-off associated with withholding battery energy from normal grid-connected operation. Raising the reserve from 10% to 40% increases two-hour survivability from 85.22% to 100%, while NPV declines from TZS 187.23 million to TZS 185.26 million and bill savings decline from 29.68% to 29.62%. Peak reduction remains 8.86% throughout because, in this configuration, the battery does not set the annual apparent-demand event. The reserve thus buys outage readiness at modest economic cost, but it cannot compensate for insufficient PV coincidence at the binding peak.
4. Discussion
4.1. Interpretation of the main findings
Because the analysis is anchored in empirical field data (measured load, reactive power, and outage records), the results reflect actual campus conditions. The joint-feasibility outcome separates the roles of PV and storage: the larger PV array drives most of the reduction in annual grid energy and in the active-power component of billed apparent demand, whereas the BESS is retained primarily to lift two-hour critical-load survivability above the planning floor. C1 has the highest NPV among the retained cases, while C3 satisfies both technical constraints. The finding aligns with earlier evidence that demand-charge value depends strongly on load–solar coincidence and tariff design (Darghouth et al., 2020; Hanna et al., 2014), and it extends that literature by retaining measured reactive demand in the monthly kVA calculation.
Positive NPV and bill reduction indicate feasibility under the stated assumptions. The sensitivity analysis evaluates the economic performance of C3 under joint variation of demand charges and PV, BESS and converter installed costs. Its conclusions apply to the tested multiplier ranges and the fixed selected configuration. Likewise, the high two-hour survivability is a modeled energy adequacy result; deployment still requires an islanding-capable converter, a protected critical-load bus, and coordinated protection (Cook et al., 2018; Nassif et al., 2022).
4.2. Operational deployment at MUST
Deployment can build on the measured data profiles and validated system model, provided the electrical architecture in Figure 1 is implemented explicitly. Critical circuits must be separated from non-critical campus feeders, and the bidirectional converter must provide grid-forming voltage and frequency control during islanded operation. At the PCC, the scheme must include anti-islanding detection, a controllable intertie breaker, synchronization for reconnection, and protection coordination for both grid-connected and islanded fault levels. Requirements such as earthing, black-start logic, transfer time, inrush current, harmonics, battery fire protection, ventilation, manual bypass, and emergency shutdown require engineering studies beyond the energy model (Cook et al., 2018).
Grid-connected control requires synchronized measurements or forecasts of active load, reactive load, available PV power, BESS SOC, and the current monthly maximum kVA. The present model, validated on one year of measured data, provides a basis for supervisory control. In practice, worst-case computation time should be benchmarked on the selected hardware, and a deterministic fallback rule should be defined for communication or solver failure.
Set-points and status signals should be exchanged with the PV inverter, BESS power-conversion system, PCC meter, and protection/transfer scheme through interfaces supported by the selected equipment. Because the model does not specify a communications protocol, protocol selection and cybersecurity requirements should be addressed during detailed design rather than inferred from the optimization results.
4.3. Data and commissioning requirements
A bankable design based on measured data can draw on one complete year of quality-controlled interval measurements at revenue-meter resolution, including kW, kvar, kVA, voltage, power factor, timestamp quality, and monthly demand-register behavior. This study uses measured reactive power rather than an assumed constant power factor. A critical-load audit identified feeder membership, power and energy requirements, starting currents, acceptable interruption duration, load-shedding priority, and operating schedule. Outage records capture start and restoration times, affected feeders, cause, and concurrent generator operation.
Commissioning should proceed in stages: measurement verification; grid-connected PV operation; constrained BESS charging/discharging; monthly-peak tracking; intentional-islanding tests on a controlled critical bus; black-start and reconnection tests; and, finally, closed-loop operation under forecast uncertainty. Hardware-in-the-loop testing is appropriate before energizing campus critical loads because the annual model does not reproduce converter or protection transients.
4.4. Computational scalability
Under the current single-BESS architecture, the number of dispatch variables and equality constraints grows linearly with the 72-interval horizon, while the outer cap loop remains fixed at 17 points. Enlarging the annual discrete design set therefore increases runtime approximately in proportion to the number of candidates, and the formulation remains tractable across additional PV and storage sizes. Introducing unit commitment, multiple storage technologies, discrete generator states, minimum up/down times, feeder switching, or mutually exclusive market transactions would add binary variables and require a mixed-integer formulation. Such an extension could be formulated using convex or second-order cone representations where appropriate, avoiding the present finite apparent-power cap search while allowing PV/BESS inverter reactive-power support to participate directly in PCC kVA reduction.
4.5. Limitations and boundaries of generalization
These findings hold within several modeling and operational boundaries. The rolling horizon uses historical load and PV data as a deterministic reference; practical performance will depend on forecast accuracy. Critical demand is represented as 10% of campus load based on feeder audits, while outage survivability is evaluated using one year of 50 verified events averaging 3.4 h. The islanding assessment addresses energy adequacy but excludes transient stability, inverter grid-forming capability, protection operation, and transfer delays. Battery behavior is represented using fixed efficiencies and a scheduled year-15 replacement, without detailed thermal or cycle-dependent degradation. Economic results reflect current EWURA tariffs, taxes, and campus billing, but they exclude financing conditions and resilience value. Grid charging and export are prohibited. PCC-level modeling omits internal losses, voltage limits, phase imbalance, transformer loading, and harmonics. Applying the framework elsewhere therefore requires local measurements of load, reactive power, tariff, outages, costs, and critical-load demand.
5. Conclusion
This work developed a hierarchical PV–BESS planning framework for MUST that integrates discrete capacity selection, 20-minute rolling-horizon linear-programming dispatch, exact monthly kVA billing, lifecycle economics, and critical-load survivability. Designs are ranked by NPV only after meeting minimum thresholds of 13% annual maximum demand reduction and 85% two-hour survivability.
Among the six retained cases, only C3 satisfies both planning constraints: 400 kWp PV, a 100-kWh BESS and a 50-kW bidirectional converter operated with a 40% normal-operation reserve. Relative to the grid-only baseline, it reduces annual grid purchases by 51.96%, maximum apparent demand by 14.49%, and the tax-inclusive electricity bill by 48.25%, yielding TZS 142.18 million in annual savings. The design yields an NPV of TZS 150.58 million, an IRR of 9.57%, and a simple payback of 9.13 years. It also achieves 99.87% two-hour survivability and supplies 99.49% of critical energy under the audited 10% critical-load definition and verified outage calendar.
Overall, PV delivers most of the energy-cost and peak-demand benefits, whereas the BESS is retained primarily for outage resilience. The selected system is thus a reliability-constrained economic optimum rather than the unconstrained maximum-NPV alternative, which avoids misattributing resilience costs to peak shaving.
Future work should examine forecast-driven or stochastic MPC, inverter reactive-power support, battery degradation with temperature effects, continuous sizing, and coordinated PV–BESS–diesel operation. These extensions should continue to use the validated PCC measurements, critical-load audit, and outage records. Hardware-in-the-loop testing of islanding, black start, protection, and solver fallback remains necessary before procurement and campus deployment.
Declaration of Ethical Standards
As the authors of this study, we declare that we comply with all ethical standards.
Credit Authorship Contribution Statement
R. P. Lyanda: Conceptualization, Formal analysis, Writing – Original Draft, Visualization.
A. M. Omari: Methodology, Formal analysis, Writing – Review & Editing, Supervision.
R. Iddphonce: Investigation, Writing – Review & Editing, Supervision.
Declaration of Competing Interest
The authors declare no competing interests.
Acknowledgements
Not applicable.
Funding
This research received no funding.
Data Availability
The data that support the findings of this study are available from the authors upon reasonable request.
References
Cook, J. J., Volpi, C. M., Nobler, E. M., & Flanegin, R. K. (2018). Check the stack: An enabling framework for resilient microgrids. National Renewable Energy Laboratory. https://doi.org/10.2172/1483066
Darghouth, N. R., Barbose, G., Zuboy, J., Gagnon, P. J., Mills, A. D., & Bird, L. (2020). Demand charge savings from solar PV and energy storage. Energy Policy, 146, 111766. https://doi.org/10.1016/j.enpol.2020.111766
Dolatabadi, M., Seyednouri, S., Hasselström, A., Safari, A., & Farrokhifar, M. (2024). Energy storage device sizing and energy management in building-applied photovoltaic systems considering battery degradation. IET Renewable Power Generation, 18(1), 30–47. https://doi.org/10.1049/rpg2.12894
Erdinç, F. G. (2023). Rolling horizon optimization based real-time energy management of a residential neighborhood considering PV and ESS usage fairness. Applied Energy, 344, 121275. https://doi.org/10.1016/j.apenergy.2023.121275
EWURA. (2026). The electricity sub-sector regulatory performance updates – March 2026. Energy and Water Utilities Regulatory Authority. https://www.ewura.go.tz/uploads/documents/en-1778237703-The%20Electricity%20Sub-Sector%20Regulatory%20Performance%20Updates%20%E2%80%93%20March%202026.pdf
Gholami, M., Muyeen, S. M., & Mousavi, S. A. (2023). Development of new reliability metrics for microgrids: Integrating renewable energy sources and battery energy storage system. Energy Reports, 10, 2251–2259. https://doi.org/10.1016/j.egyr.2023.09.047
Gorman, W., Barbose, G., Carvallo, J. P., Baik, S., Miller, C. A., White, P., & Praprost, M. (2023). County-level assessment of behind-the-meter solar and storage to mitigate long duration power interruptions for residential customers. Applied Energy, 342, 121166. https://doi.org/10.1016/j.apenergy.2023.121166
Hanna, R., Kleissl, J., Nottrott, A., & Ferry, M. (2014). Energy dispatch schedule optimization for demand charge reduction using a photovoltaic-battery storage system with solar forecasting. Solar Energy, 103, 269–287. https://doi.org/10.1016/j.solener.2014.02.020
Kajal, M. K. H., Hossain, R., Hassan, M., Dev, S., Islam, M. R., Hasan, M. M., & Islam, J. (2025). Techno-economic and resilience optimization of a university microgrid: A dual-tool approach. Energy Reports, 14, 3369–3389. https://doi.org/10.1016/j.egyr.2025.10.034
Nassif, A. B., Ericson, S., Abbey, C., Jeffers, R., Hotchkiss, E., & Bahramirad, S. (2022). Valuing resilience benefits of microgrids for an interconnected island distribution system. Electronics, 11(24), 4206. https://doi.org/10.3390/electronics11244206
Polat, S., Biyik, E., & Şekerci Öztura, H. (2025). Optimal active and reactive power scheduling for inverter-integrated PV and BESS under inverter current constraints. Electric Power Systems Research, 245, 111629. https://doi.org/10.1016/j.epsr.2025.111629
Rezaeimozafar, M., Barrett, E., Monaghan, R. F. D., & Duffy, M. (2024). A stochastic method for behind-the-meter PV-battery energy storage systems sizing with degradation minimization by limiting battery cycling. Journal of Energy Storage, 86, 111199. https://doi.org/10.1016/j.est.2024.111199
Saleem, M. I., Saha, S., Izhar, U., & Ang, L. (2024). Bi-layer model predictive control strategy for techno-economic operation of grid-connected microgrids. Renewable Energy, 236, 121441. https://doi.org/10.1016/j.renene.2024.121441
Stevenson, A., Riggs, H., & Sarwat, A. (2024). Data-driven scheduling of a grid-connected university campus battery energy storage system considering variable weather and energy pricing. Energy Reports, 12, 5116–5132. https://doi.org/10.1016/j.egyr.2024.10.063