Power System Blocks


The compare-security-analysis-results command is used to compare security-analysis results.
The security analysis results to be compared are read from JSON files, containing a JSON serialization of the results themselves (com.powsybl.security.SecurityAnalysisResult class).

The outcome of the comparison is success if the results are equivalent, fail otherwise.

The security analysis results comparison process compares, for the pre-contingency state and for all the post-contingency states of the two results:

Two security analysis results are considered equivalent IFF all the following conditions are satisfied:

The comparison process, optionally, can output, in a CSV file, all the compared values (pre and post-contingency loadflow computation outcomes, and related constraints violations), with a corresponding comparison result (equivalent,different). See example below.



$> itools compare-security-analysis-results --help
usage: itools [OPTIONS] compare-security-analysis-results [--help] --output-file
       <FILE> --result1-file <FILE> --result2-file <FILE> [--threshold

Available options are:
    --config-name <CONFIG_NAME>   Override configuration file name
    --parallel                    Run command in parallel mode

Available arguments are:
    --help                    display the help and quit
    --output-file <FILE>      output file path, where the comparison results
                              will be stored
    --result1-file <FILE>     security analysis result 1 file path
    --result2-file <FILE>     security analysis result 2 file path
    --threshold <THRESHOLD>   threshold used for results comparison, default is 0.0

Required parameters


Use the --output-file parameter to specify the path of the output file, where the comparison results will be stored.


Use the --result1-file parameter to specify the path of the JSON file containing the first security analysis result.


Use the --result2-file parameter to specify the path of the JSON file containing the second security analysis result.

Optional parameters


Use the --threshold parameter to specify the threshold used for comparing values of the two security analysis results. Default value is 0.


This example shows how to compare two security analysis results and to store the comparison results in the $HOME/comparison_results.csv file:

$> itools compare-security-analysis-results --result1-file $HOME/result1.json --result2-file $HOME/result2.json --output-file $HOME/comparison_results.csv
Comparison result: fail

This example shows how to specify the threshold to be used in the comparison:

$> itools compare-security-analysis-results --result1-file $HOME/result1.json --result2-file $HOME/result2.json --output-file $HOME/comparison_results.csv  --threshold 0.1
Comparison result: success

Learn more

Read the security-analysis tool documentation page to learn how to run a security analysis.