Overview
The Remedial Action Optimization (RAO) module provides advanced optimization capabilities for power system security management. It optimizes the use of remedial actions to ensure network security while minimizing costs.Main Classes
Rao
Main class for running remedial action optimization.Methods
Run a remedial action optimization.Parameters:
crac(Crac): CRAC (Contingency list, Remedial Actions and additional Constraints)network(Network): Network to optimizeparameters(Parameters, optional): RAO parametersrao_provider(str): RAO provider name (default: “SearchTreeRao”)loop_flow_glsk(Glsk, optional): Loop flow GLSK for loop flow computation
Run voltage monitoring after RAO.Parameters:
crac(Crac): CRAC objectnetwork(Network): Networkrao_result(RaoResult): Result from previous RAO runload_flow_parameters(loadflow.Parameters, optional): Load flow parametersprovider_str(str): Provider stringmonitoring_glsk(Glsk, optional): GLSK for monitoring
Run angle monitoring after RAO.Parameters:
crac(Crac): CRAC objectnetwork(Network): Networkrao_result(RaoResult): Result from previous RAO runload_flow_parameters(loadflow.Parameters, optional): Load flow parametersprovider_str(str): Provider stringmonitoring_glsk(Glsk, optional): GLSK for monitoring
Crac
Represents the CRAC (Contingency list, Remedial Actions and additional Constraints) data.Load CRAC from a file.Parameters:
network(Network): Network objectcrac_file(str or PathLike): Path to CRAC file
Load CRAC from a buffer.Parameters:
network(Network): Network objectcrac_source(BytesIO): CRAC data buffer
Glsk
Represents Generation and Load Shift Keys for sensitivity analysis.Parameters
Comprehensive parameters for RAO execution.Parameters for the objective function.
Parameters for range action optimization (PST, HVDC, injections).
Parameters for topological action optimization.
Parameters for parallel execution.
Parameters for second preventive RAO execution.
Parameters for CNECs that should not be optimized.
Load flow and sensitivity computation parameters.
Provider-specific parameters.
Loading and Saving Parameters
Load parameters from a file.Parameters:
parameters_file(str or PathLike): Path to parameters file
Load parameters from a buffer.Parameters:
parameters_source(BytesIO): Parameters data buffer
Save parameters to a file.Parameters:
output_file(str): Output file path
Serialize parameters to a binary buffer.Returns: BytesIO
Convert parameters to JSON dictionary.Returns: Dict[str, Any]
ObjectiveFunctionParameters
Parameters for the RAO objective function. Attributes:objective_function_type: Type of objective functionunit: Unit for optimization (MW, AMPERE)curative_min_obj_improvement: Minimum improvement required for curative actionsenforce_curative_security: Whether to enforce security in curative perimeter
RangeActionOptimizationParameters
Parameters for optimizing range actions (PST, HVDC, injections). Key Attributes:max_mip_iterations: Maximum iterations for MIP solverpst_ra_min_impact_threshold: Minimum impact threshold for PST actionspst_sensitivity_threshold: Sensitivity threshold for PSTpst_model: PST model typehvdc_ra_min_impact_threshold: Minimum impact threshold for HVDC actionsinjection_ra_min_impact_threshold: Minimum impact threshold for injection actionsra_range_shrinking: Range shrinking strategysolver: Solver to use (e.g., “CBC”, “SCIP”)relative_mip_gap: Relative MIP gap tolerancesolver_specific_parameters: Solver-specific parameters
TopoOptimizationParameters
Parameters for topological action optimization. Key Attributes:max_preventive_search_tree_depth: Maximum depth for preventive search treemax_curative_search_tree_depth: Maximum depth for curative search treepredefined_combinations: Use predefined action combinationsrelative_min_impact_threshold: Relative minimum impact thresholdabsolute_min_impact_threshold: Absolute minimum impact thresholdskip_actions_far_from_most_limiting_element: Skip actions far from constraintsmax_number_of_boundaries_for_skipping_actions: Max boundaries for action skipping
MultithreadingParameters
Parameters for parallel execution. Attributes:available_cpus: Number of CPUs available for parallel computation
RaoResult
Result object returned by RAO execution.Utility Functions
Create a RAO object for running optimization.Returns: RaoExample:
RaoLogFilter
Filter for RAO log messages.Filter log records to show only OpenRAO package logs.Parameters:
record(LogRecord): Log record to filter
Complete Example
Parameter File Example
Notes
- RAO requires a valid CRAC file defining contingencies, CNECs, and remedial actions
- The SearchTreeRao provider is the default and most commonly used
- Parameters can be loaded from JSON files or configured programmatically
- GLSK files are optional but required for loop flow computation
