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 a 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.

Define operator strategies and remedial actions#

You can define operator strategies and remedial actions with the following methods:

SecurityAnalysis.add_load_active_power_action

Add a load action, modifying the load active power

SecurityAnalysis.add_load_reactive_power_action

Add a load action, modifying the load reactive power

SecurityAnalysis.add_generator_active_power_action

Add a generator action, modifying the generator active power

SecurityAnalysis.add_switch_action

Add a switch action, modifying the switch open/close status

SecurityAnalysis.add_operator_strategy

Add an operator strategy to the specified contingency

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.operator_strategy_results

Results for the operator strategies, as a dictionary operator strategy ID -> result.

SecurityAnalysisResult.find_post_contingency_result

Result for the specified contingency.

SecurityAnalysisResult.find_operator_strategy_results

Result for the specified operator strategy

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.