Sequential AC power flow using PowerModels.jl

I am trying to run repeated AC power flow calculations for a large grid using PowerModels.jl. Digging through the code revealed that there is some way to efficiently run successive power flow solves, but I couldn’t really figure out in the documentation what the most efficient way of doing this is.

Basically, I have a grid topology with buses, branches, loads, and generators fixed, but with varying setpoints for loads and generators for each timestep. After creating the initial data dictionary that describes the model, what is the best way to (1) run a power flow, (2) extract the loading factors of the branches (probably calc_branch_flow_ac), (3) update the setpoints for all loads/generators and restart with (1)?

This documentation provides a discussion of the tradeoffs of different Power Flow methods in PowerModels,

I suggest starting there. Most likely, switching from solve_pf to compute_ac_pf will give you the bulk of the runtime benefits for fast solving AC Power Flows. Going deeper into memory allocation savings in compute_ac_pf, as per the code you reference, I expect is no more than a 2x runtime improvement over the basic implementation that is provided.