Security analysis

The security analysis module allows to simulate contingencies (the loss of a line or a generator, for example) in a “batch” mode, in AC mode.

Run a security analysis

You can run a security analysis using the following methods:

create_analysis

Creates a security analysis objet, which can be used to run a security analysis on a network

SecurityAnalysis.run_ac

Runs an AC security analysis.

Define contingencies and monitored elements

You can define contingencies to be simulated, as well as network elements to be monitored, with the following methods:

SecurityAnalysis.add_single_element_contingency

Add one N-1 contingency.

SecurityAnalysis.add_multiple_elements_contingency

Add one N-K contingency.

SecurityAnalysis.add_single_element_contingencies

Add multiple N-1 contingencies.

SecurityAnalysis.add_monitored_elements

Add elements to be monitored by the security analysis.

SecurityAnalysis.add_precontingency_monitored_elements

Add elements to be monitored by the security analysis on precontingency state.

SecurityAnalysis.add_postcontingency_monitored_elements

Add elements to be monitored by the security analysis for specific contingencies.

Results

When the security analysis is completed, you can inspect its results:

SecurityAnalysisResult

The result of a security analysis.

SecurityAnalysisResult.limit_violations

All limit violations in a dataframe representation.

SecurityAnalysisResult.pre_contingency_result

Result for the pre-contingency state.

SecurityAnalysisResult.post_contingency_results

Results for the contingencies, as a dictionary contingency ID -> result.

SecurityAnalysisResult.find_post_contingency_result

Result for the specified contingency.

SecurityAnalysisResult.branch_results

Results (P, Q, I) for monitored branches.

SecurityAnalysisResult.bus_results

Bus results (voltage angle and magnitude) for monitored voltage levels.

SecurityAnalysisResult.three_windings_transformer_results

Results (P, Q, I) for monitored three winding transformers.