Overview
The Security Analysis module performs N-1 security analysis to identify violations that occur after contingencies (outages of network elements). It evaluates the network’s ability to withstand single or multiple element failures while maintaining operational constraints.Creating Security Analysis
create_analysis
Create a security analysis instance.A new security analysis instance
SecurityAnalysis Class
TheSecurityAnalysis class allows you to configure and run security analysis on a network.
Adding Contingencies
add_single_element_contingency
Add a contingency involving a single network element.Unique identifier for the contingency
ID of the network element to trip (line, transformer, generator, etc.)
add_multiple_elements_contingency
Add a contingency involving multiple network elements.Unique identifier for the contingency
List of network element IDs to trip simultaneously
Adding Monitored Elements
add_monitored_elements
Add elements to be monitored by the security analysis.When to monitor the elements:
ALL: Monitor for all contingenciesNONE: Monitor only in N situation (pre-contingency)SPECIFIC: Monitor for specific contingencies
List of contingency IDs for which to monitor (used with SPECIFIC context)
List of branch IDs to monitor
List of voltage level IDs to monitor
List of three-winding transformer IDs to monitor
Running Analysis
run_ac
Run an AC security analysis.Network on which to run the security analysis
Security analysis parameters
Security analysis implementation provider. If empty, uses default
Reporter for execution reports
Security analysis result containing violations and monitored elements information
run_dc
Run a DC security analysis.run_ac. DC security analysis uses simplified DC power flow for faster computation.
Parameters
Parameters Class
Configure security analysis execution.Load flow parameters used for security analysis calculations. See Load Flow Parameters
Define what violations should be considered increased between N and post-contingency situations
Provider-specific parameters as key-value pairs
IncreasedViolationsParameters
Define thresholds for identifying increased violations.Proportional threshold for flow violations (default 10%)
Proportional threshold for low voltage violations
Absolute threshold for low voltage violations (in kV)
Proportional threshold for high voltage violations
Absolute threshold for high voltage violations (in kV)
Results
SecurityAnalysisResult
Contains the complete results of a security analysis.Results for the N situation (no contingency)
List of results for each contingency
DataFrame of all limit violations across all contingencies
DataFrame with power flow results for monitored branches
DataFrame with voltage results for monitored buses
PostContingencyResult
Results for a single contingency.ID of the contingency
Computation status:
CONVERGED: Load flow convergedMAX_ITERATION_REACHED: Maximum iterations reachedFAILED: Computation failed
DataFrame of limit violations for this contingency
Provider Management
get_provider_names
Get the list of available security analysis providers.List of available provider names
get_default_provider
Get the current default security analysis provider.Name of the default provider
set_default_provider
Set the default security analysis provider.Name of the provider to set as default
Enumerations
ContingencyContextType
ALL: Apply to all contingenciesNONE: Apply to N situation only (pre-contingency)SPECIFIC: Apply to specific contingencies
ComputationStatus
CONVERGED: Computation converged successfullyMAX_ITERATION_REACHED: Maximum iterations reachedFAILED: Computation failed
ConditionType
Types of conditions for contingencies:TRUE_CONDITIONANY_VIOLATION_CONDITIONAT_LEAST_ONE_VIOLATION_CONDITION
ContingencyContainer
Base class providing contingency management methods (inherited by SecurityAnalysis).get_contingencies
Get the list of defined contingencies.DataFrame containing all defined contingencies with their elements
See Also
- Load Flow - Power flow calculations
- Sensitivity Analysis - Sensitivity factors
