amplpower
- class amplpower.PowerSystem(case_file: str)[source]
PowerSystem class for solving optimal power flow problems.
- compute_initial_bigm_ac()[source]
Compute Big-M values for AC the different lines and return them in a DataFrame.
- compute_initial_bigm_dc()[source]
Compute Big-M values for DC the different lines and return them in a DataFrame.
- initialize(voltages=None, angles=None)[source]
Initialize the voltage magnitudes, angles, flows, and generation levels.
- solve_opf(opf_type='dc', switching='off', connectivity='off', solver='gurobi', options='outlev=1 timelimit=3600')[source]
Solve the optimal power flow problem using AMPL. Parameters: opf_type (str): Type of optimal power flow (‘dc’, ‘acrect’, ‘acjabr’) switching (str): Switching strategy (‘off’, ‘nl’, ‘bigm’) connectivity (str): Connectivity for topology solutions (‘off’, ‘on’) solver (str): Solver to use (‘gurobi’, ‘cplex’, ‘cbc’) options (str): Options for the solver Returns: dict: Results of the optimal power flow problem