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.

SecurityAnalysis.run_dc

Runs an DC security analysis.

set_default_provider

Set the default security analysis provider.

get_default_provider

Get the current default security analysis provider.

get_provider_names

Get list of supported provider names

Parameters

The execution of the security analysis can be customized using security analysis parameters.

Parameters

Parameters for a security analysis execution.

IncreasedViolationsParameters

Parameters which define what violations should be considered as "increased" between N and post-contingency situations

get_provider_parameters_names

Get list of parameters for the specified security analysis provider.

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.