Overview
The voltage initializer module provides an AC Optimal Power Flow (ACOPF) solution to initialize voltage magnitudes and phase angles in a power network. It’s useful for obtaining a feasible starting point for power flow calculations when the initial network state is not well-defined.Main Functions
run
Run voltage initializer on a network.Network on which voltage initializer will run
Parameters to customize the run
If True, the temporary directory of the voltage initializer run will not be erased (default: False)
Main Classes
VoltageInitializerParameters
Parameters for voltage initializer execution.Configuration Methods
Indicate that given shunt compensators have variable susceptance.Parameters:
shunt_id_list(List[str]): List of shunt compensator IDs
Indicate that given generators have constant target reactive power.Parameters:
generator_id_list(List[str]): List of generator IDs
Indicate that given 2-winding transformers have variable ratio.Parameters:
transformer_id_list(List[str]): List of transformer IDs
Override network low voltage limits.Parameters:
low_limits(List[Tuple[str, bool, float]]): List of (voltage_level_id, is_relative, limit_value)
Override network high voltage limits.Parameters:
high_limits(List[Tuple[str, bool, float]]): List of (voltage_level_id, is_relative, limit_value)
Override network voltage limits (both low and high).Parameters:
limits(Dict[str, Tuple[float, float]]): Dictionary where keys are voltage level IDs, values are (lower_limit, upper_limit) as relative values
Objective Function
Set the objective function for voltage initializer.Parameters:
objective(VoltageInitializerObjective): Objective function type
VoltageInitializerObjective.MIN_GENERATION: Minimize generationVoltageInitializerObjective.BETWEEN_HIGH_AND_LOW_VOLTAGE_LIMIT: Target specific distance between limits (requires set_objective_distance)VoltageInitializerObjective.SPECIFIC_VOLTAGE_PROFILE: Target specific voltage profile
Set objective distance for BETWEEN_HIGH_AND_LOW_VOLTAGE_LIMIT objective.Parameters:
distance(float): Distance in percentage (0-100)- 0%: Target lower voltage limit
- 50%: Target middle of voltage range
- 100%: Target upper voltage limit
Logging Configuration
Set log level for AMPL printings.Parameters:
log_level_ampl(VoltageInitializerLogLevelAmpl): Log level
VoltageInitializerLogLevelAmpl.DEBUGVoltageInitializerLogLevelAmpl.INFOVoltageInitializerLogLevelAmpl.WARNINGVoltageInitializerLogLevelAmpl.ERROR
Set log level for non-linear optimization solver printings.Parameters:
log_level_solver(VoltageInitializerLogLevelSolver): Log level
VoltageInitializerLogLevelSolver.NOTHINGVoltageInitializerLogLevelSolver.ONLY_RESULTSVoltageInitializerLogLevelSolver.EVERYTHING
Advanced Parameters
Set reactive slack buses mode.Parameters:
reactive_slack_buses_mode(VoltageInitializerReactiveSlackBusesMode): Mode for reactive slack buses
Set minimal plausible value for low voltage limits in ACOPF solving.Parameters:
min_plausible_low_voltage_level(float): Value in p.u. (>= 0)
Set maximal plausible value for high voltage limits in ACOPF solving.Parameters:
max_plausible_high_voltage_limit(float): Value in p.u. (> 0)
Set weight to favor minimization of active power produced by generators.Parameters:
active_power_variation_rate(float): Rate between 0 and 1- 0: Minimize sum of generations
- 1: Minimize sum of squared differences between target and value
Set threshold of active and reactive power considered as null.Parameters:
min_plausible_active_power_threshold(float): Threshold (>= 0)
Set threshold of impedance considered as null.Parameters:
low_impedance_threshold(float): Threshold (>= 0)
Set threshold for ignoring voltage levels with low nominal voltage.Parameters:
min_nominal_voltage_ignored_bus(float): Voltage in kV (>= 0)
Set threshold for replacing voltage limits of low voltage levels.Parameters:
min_nominal_voltage_ignored_voltage_bounds(float): Voltage in kV (>= 0)
Scaling Factors
Set scaling of all variables (except reactive slacks and transformer ratios).Parameters:
default_variable_scaling_factor(float): Scaling factor (> 0)
Set scaling factor applied to all constraints.Parameters:
default_constraint_scaling_factor(float): Scaling factor (>= 0)
Set scaling factor for reactive slack variables.Parameters:
reactive_slack_variable_scaling_factor(float): Scaling factor (> 0)
Set scaling factor for transformer ratio variables.Parameters:
twt_ratio_variable_scaling_factor(float): Scaling factor (> 0)
VoltageInitializerResults
Results of a voltage initializer run.Properties
Status of the optimization.Enum Values:
VoltageInitializerStatus.OK: Optimization succeededVoltageInitializerStatus.NOT_OK: Optimization failed
Indicators from the optimization as a dictionary.Useful for debugging when optimization fails.Example:
Methods
Apply all modifications found by voltage initializer to the network.Parameters:
network(Network): Network on which to apply modifications
Complete Example
Troubleshooting Example
Notes
- Voltage initializer uses AMPL and a non-linear solver (typically IPOPT)
- It’s particularly useful when network voltages are not properly initialized
- The optimization may fail due to infeasibility; use specific voltage limits to resolve
- Debug mode keeps temporary files for troubleshooting
- Variable shunts, transformers, and generators give the optimizer more flexibility
- Results must be explicitly applied to the network using
apply_all_modifications()
