amplpower — amplpower 0.0.0 documentation

# amplpower

class amplpower.PowerSystem(case_file: str, max_voltage_angle: float = 1.5707963267948966, min_voltage_angle: float = -1.5707963267948966)

  PowerSystem class for solving optimal power flow problems.

  __init__(case_file: str, max_voltage_angle: float = 1.5707963267948966, min_voltage_angle: float = -1.5707963267948966)

    Initialize the power system with a MATPOWER case file.

  compute_bigm_ac()

    Compute Big-M values for active and reactive power flows.

  compute_bigm_dc()

    Compute Big-M values for DC power flow.

  compute_matrices()

    Calculate the admittance matrices (yff, ytf, yft, ytt) for the network.

  compute_voltage_bounds()

    Compute bounds for the real and imaginary parts of voltage.

  initialize(voltages=None, angles=None)

    Initialize the voltage magnitudes, angles, flows, and generation levels.

  load_data()

    Load MATPOWER case data into DataFrames and convert to per unit.

  solve_opf(opf_type='dc', switching='off', connectivity='off', solver='gurobi', options='outlev=1 timelimit=3600')

    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

  summary()

    Print summary of the network.

amplpower.compute(args)