IntroductionThe South African electricity supply sector is undergoing structural reform, with balancing and ancillary-service markets likely to increase the need for active portfolio scheduling under supply shortages and grid constraints. This paper formulates a day-ahead virtual-grid optimal power flow problem for a geographically dispersed South African corporate portfolio comprising load, co-generation, renewable energy, battery energy storage and flexible demand.MethodsA mixed-integer linear programming/DC optimal power flow benchmark, a genetic algorithm and gorilla troop optimisation are compared under a common cost-and-voltage-stability objective, with all schedules assessed by AC post-validation and Jacobian singular-value/condition-number metrics. The algorithms are first tested through repeated simulations on a modified IEEE 9-bus system and then transferred to a bespoke 35-bus, 39-branch South African-grid-referenced reduced-order application system constructed from selected 400 kV corridors, a 132 kV renewable independent power producer proxy and 66/22 kV load connection proxies. South African load and generation data are used in the simulations.ResultsThe bespoke application converged in all 24 hourly snapshots. The deterministic benchmark gave the lowest true cost, while the genetic algorithm was faster than gorilla troop optimisation and showed marginally stronger stability metrics in the single bespoke run. Gorilla troop optimisation achieved a marginally lower true cost than the genetic algorithm. A flexible-demand-with-storage use case reduced aggregate residual deficit significantly.DiscussionThe results indicate that the reduced-order grid provides fit-for-purpose OPF transferability and supports comparative assessment of deterministic and metaheuristic scheduling methods for South African virtual-grid applications.