Skip to content

Resilient Design Executable

Russell Bent edited this page Mar 19, 2019 · 48 revisions

Resilient Design Executable Installation

  1. Download and install the java 7 or later run time environment. RDT is designed to be compatible with java 7.0.0.0 and later. It has been tested under the following java versions.
Windows 7 Windows 10 Debian Weeezy Ubuntu 18.04
JAVA version oracle build 1.8.0_121-b13 oracle build 1.8.0_121-b13 openJDK build 1.7.0_111-2.6.7-2~deb8u1 OpenJDK version 1.8.0_121
  1. Install a git command line tool
  • Linux
    sudo apt-get install git
    
  1. Install cplex, SCIP, and/or Coin-or (see the README)

  2. Get the RDT jar file

    git clone https://github.com/lanl-ansi/micot-application-rdt.git
    

or download it direction from https://github.com/lanl-ansi/micot/blob/master/target/micot-rdt.jar

Resilient Design Executable Usage

RDT can be tested using the examples included in the git repository checked out during the installation. For example:

```
java -jar micot-rdt.jar -c lpnorm/example.json -e out.json
```
required arguments:
  -c               file name for the RDT input file
  -e               file name for the output of the results

optional arguments:
  -bs              filename for bus results in shapefile format
  -gs              filename for generator results in shapefile format
  -ls              filename for load results in shapefile format
  -brs             filename for branch results in shapefile format
  -bj              filename for bus results in geoJSON format
  -gj              filename for generator results in geoJSON format
  -lj              filename for load results in geoJSON format
  -brj             filename for branch results in geoJSON format

Input Format

The input for the RDT software is JSON based. The top level configuration parameters include


critical_load_met         This is a number between 0 and 1 that is used in resilience 
                          modeling. This parameter is used to determine the minimum 
                          amount of critical load that must be met in each damage 
                          scenario. The parameter is optional and the default value 
                          is .98 
total_load_met            This is a number between 0 and 1 that is used in resilience 
                          modeling. This parameter is used to determine the minimum 
                          amount of total load that must be met in each damage 
                          scenario. The parameter is optional and the default value 
                          is .5
fidelity                  This is a high level RDT configuration parameter that is
                          used to control RDT model fidelity vs. computational time
                          for running RDT. It is a number between 1 and 5.  1 has
                          the lowest fidelity but is the fastest running.  5 has
                          the highest fidelity but could require significant 
                          computation time. The default is 1.
algorithm                 This is a parameter to tell RDT which optimization 
                          algorithm to use. The setting "heuristic" is used 
                          to denote a heuristic approach. The setting "miqp"
                          is used to denote posing the problem as a mixed
                          integer quadratic program (miqp). The setting "sbd" is 
                          used to denote a specialized "scenario based 
                          decomposition" algorithm to solve the miqp.
                          This is an advanced setting that can be controlled by
                          the "fidelity" parameter ,  When "fidelity=1,2,3" the
                          default for this parameter is "heuristic".  "sbd" is used
                          when "fidelity=4,5"
power_flow                This is a parameter to tell RDT which model of power
                          flow physics to use. The setting "network_flow" is
                          used to denote a transportation model. The setting
                          "lindist_flow" is used to denote a lindist flow.
                          This is an advanced setting that can be controlled by
                          the "fidelity" parameter,  When "fidelity=1,2" the
                          default for this parameter is "network_flow".  
                          "lindist_flow" is used when "fidelity=3,4,5".
cycle_model               This is a parameter to tell RDT which model of cycle
                          constraints to use. The setting "none" is used if
                          networks are all allowed operate with loops.  The
                          setting "enumeration" is used if the optimization
                          model enumerates all possible cycles and posts 
                          explicit constraints eliminating each constraint.
                          This is the best model to use, but the it requires
                          a potentially exponential number of constraints.
                          The setting "flow" is used to to enforce cycle 
                          constraints through a network flow representation.
                          It does not require an exponential number of 
                          constraints but is less efficient for optimization
                          solvers. This is an advanced setting that can be 
                          controlled by the "fidelity" parameter,  When 
                          "fidelity=1,2,3,4" the default for this parameter 
                          is "none".  "flow" is used when "fidelity=5"
is_discrete               This is a parameter to tell RDT whether to model
                          design variables as discrete choices or continuous
                          choices. False indicates continuous and true indicates
                          discrete. This is an advanced setting that can be 
                          controlled by the "fidelity" parameter,  When 
                          "fidelity=1" the default for this parameter 
                          is false.  true is used when "fidelity=2,3,4,5"
solver                    This parameter controls which optimization solver
                          is used by the RDT algorithms. "cplex" is used
                          for cplex.  "scip" is used for the scip solver.
                          "bonmin" is used for the bonmin solver. The default
                          is "scip".
solver_iteration_timeout  This is parameter is used to determine how long the
                          algorithm is allowed to spend per iteration. It loosely
                          controls how much computation time RDT is allowed to 
                          use.  The default is no time out.
phase_variation           This is a parameter that controls how imbalanced the 
                          power flows can be at transformers. It is a number 
                          between 0 and 1. The default is 0.15.

The buses (nodes) are defined with the following parameters


id                        A string that uniquely identifies the bus
min_voltage               The minimum voltage level at the bus in p.u.
max_voltage               The maximum voltage level at the bus in p.u.
ref_voltage               The reference voltage level at the bus in p.u.
has_phase                 An array of whether or not a bus has a phase

The loads (power consumption points) are defined with the following parameters


id                        A string that uniquely identifies the load
node_id                   The id of the node (bus) the load is connected to
has_phase                 An array of whether or not a load has a phase
max_real_phase            An array of the desired active load in each phase
max_reactive_phase        An array of the desired reactive load in each phase
is_critical               Boolean for whether or not the load is critical

The generators (power consumption points) are defined with the following parameters


id                        A string that uniquely identifies the generator
node_id                   The id of the node (bus) the generator is connected to
has_phase                 An array of whether or not a generator has a phase
max_real_phase            An array of the maximum active generation in each phase
max_reactive_phase        An array of the maximum reactive generation in each phase
microgrid_cost            The cost for building the generator
is_new                    Boolean to indicate whether or not this generator has to
                          be built.

The lines are defined with the following parameters


id                        A string that uniquely identifies the line
node1_id                  The id of one node (bus) the line is connected to
node2_id                  The id of one node (bus) the line is connected to
has_phase                 An array of whether or not a line carries a phase
capacity                  per unit capacity (rating) of the line 
length                    per unit length of the line 
num_phases                The number of phases the line carries
is_transformer            Whether or the line is a transformer
line_code                 Id of the line code for the line
construction_cost         The construction cost for building this line
harden_cost               The hardening cost for the line
switch_cost               The cost for building a switch at the line
is_new                    Boolean for indicating if the line needs to be built
can_harden                Boolean for indicating if the line can be hardened
can_add_switch            Boolean for indicating if a switch can be added
has_switch                Boolean for if a switch is already on the line

The line codes are defined with the following parameters


line code                    A string that uniquely identifies the line code
num_phases                   Number of phases for the line code
rmatrix                      An array of the resistance terms for the line 
                             (per length, per unit). 
xmatrix                      An array of the reactance terms for the line 
                             (per length, per unit). 

The scenarios are defined with the following parameters


id                             A string that uniquely identifies the scenario
hardened_disabled_lines        An array of power lines that are damaged after being
                               hardened
disabled_communication_lines   An array of communication lines that are damaged
disabled_lines                 An array of power lines that are damaged

JSON Input Format

The more formal input format is as follows

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "title": "Resilient Design Tool (RDT) JSON schema",
  "description": "These schema describes the fields for the JSON schema used by the RDT Tool",
  "properties": {
    "critical_load_met": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "This is a number between 0 and 1 indicates the percentage of critical load that must be met in each damage scenario",
      "default": 0.98
    },
    "total_load_met": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "This is a number between 0 and 1 indicates the percentage of non-critical load that must be met in each damage scenario",
      "default": 0.5
    },
    "fidelity": {
      "type": "number",
      "minimum": 1,
      "maximum": 5,
      "description": "Meta argument for the algorithm and modeling choices that controls high vs. low fidelity and computation requirements. 1 is the fastest approach, but lowest fidelity",
      "default": 1
    },
    "algorithm": {
      "type": "string",
      "description": "Choice of algorithm to run. miqp=full mixed integer model. sbd=scenario based decomposition. vns=variable neighborhood search",
      "enum": ["miqp", "sbd", "heuristic"],
      "default": "heuristic if fidelity = 1-3. sbd otherwise"
    },
    "power_flow": {
      "type": "string",
      "description": "Choice of power flow to use. network_flow=network flow model. lindist_flow=linearized dist flow",
      "enum": ["network_flow", "lindist_flow"],
      "default": "network_flow if fidelity = 1-2. lindist_flow otherwise"
    },
    "cycle_model": {
      "type": "string",
      "description": "Choice of how to model cycle constraints. none=none. enumeration=completely enumerates all cycles. Best representation, but may require an exponential number of constraints. flow=uses a flow model to remove cycles. This is the most compact representation, but the solvers are not as good.",
      "enum": ["none", "enumeration", "flow"],
      "default": "none if fidelity = 1-4. flow otherwise"
    },
    "is_discrete": {
      "type": "boolean",
      "description": "Choice of how to model design variables (continuous or discrete)",
      "default": "false if fidelity = 1. true otherwise"
    },
    "solver": {
      "type": "string",
      "description": "Choice of solver to use.",
      "enum": ["cplex", "scip", "bonmin"],
      "default": "scip"
    },
    "solver_iteration_timeout": {
      "type": "float",
      "description": "Maximum CPU seconds to spend on an iteration of the algorithm",
      "default": infinity
    },
    "phase_variation": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "This is a number that controls the amount of phase imbalance may occur at transformers in the system. This is a number between 0 and 1",
      "default": 0.15
    },
    "buses": {
      "type": "array",
      "description": "This block describes the necessary bus (node) data for running an instance of RDT.",
      "items": {
        "type": "object",
        "description": "Each entry here contains information about a single bus",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the bus"
          },
          "min_voltage": {
            "type": "number",
            "description": "Minimum voltage level for the bus in p.u.",
            "default": 0.8
          },
          "max_voltage": {
            "type": "number",
            "description": "Maximum voltage level for the bus in p.u.",
            "default": 1.2
          },
          "ref_voltage": {
            "type": "number",
            "description": "Reference voltage for the bus in p.u.",
            "default": 1.0
          },
          "has_phase": {
            "type": "array",
            "description": "Array indicating whether or not a bus has a phase",
            "items": {
              "type": "boolean",
              "description": "Entries of the array",
              "default": true
            }
          }
        },
        "required": [
          "id"
        ]
      }
    },  
    "loads": {
      "type": "array",
      "description": "This block describes the loads of the power system.",
      "items": {
        "type": "object",
        "description": "Each entry of the array provides information on one load.  More than one load per bus is allowed.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the load"
          },
          "node_id": {
            "type": "string",
            "description": "Identifier of the bus the load is attached to"
          },
          "has_phase": {
            "type": "array",
            "description": "Array that indicates whether this load serves a phase or not",
            "items": {
              "type": "boolean",
              "description": "There should be three entries in this array"
            }
          },
          "max_real_phase": {
            "type": "array",
            "description": "Maximum or desired real load in per unit",
            "items": {
              "type": "number",
              "description": "A 3 entry array indicating the phase real load in per unit"
            }
          },
          "max_reactive_phase": {
            "type": "array",
            "description": "Maximum or desired reactive load in per unit",
            "items": {
              "type": "number",
              "description": "A 3 entry array indicating the phase reactive load in per unit."
            }
          },
          "is_critical": {
            "type": "boolean",
            "description": "a flag indicating whether or not a load is critical or not.",
            "default": false
          }
        },
        "required": [
          "id",
          "node_id",
          "has_phase",
          "max_real_phase",
          "max_reactive_phase"
        ]
      }
    },
  
    "lines": {
      "type": "array",
      "description": "This is an array of the lines in the power system model.",
      "items": {
        "type": "object",
        "description": "Each entry contains a block containing information about a single line",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the line"
          },
          "node1_id": {
            "type": "string",
            "description": "Identifier of the first node the line is connected to"
          },
          "node2_id": {
            "type": "string",
            "description": "Identifier of the second the line is connected to"
          },
          "has_phase": {
            "type": "array",
            "description": "Vector of booleans corresponding to whether of not the line carries a phase",
            "items": {
              "type": "boolean",
              "description": "A vector of 3 boolean values for the phases"
            }
          },
          "capacity": {
            "type": "number",
            "description": "per unit capacity of the line",
            "default": 1e30
          },
          "length": {
            "type": "number",
            "description": "The length of the line. Length units are consistent with the line code entries, i.e. impedance values are per length",
            "default": 1.0
          },
          "num_phases": {
            "type": "integer",
            "description": "The number of phases the line carries.",
            "default": 3
          },
          "is_transformer": {
            "type": "boolean",
            "description": "Flag indicating whether or not the line is a transformer",
            "default": false
          },
          "line_code": {
            "type": "string",
            "description": "Line code identifier to get additional information about the line"
          },
          "construction_cost": {
            "type": "number",
            "description": "The cost of constructing this line.",
            "default": 1e30
          },
          "harden_cost": {
            "type": "number",
            "description": "The cost of hardening this line.",
            "default": 1e30
          },
          "switch_cost": {
            "type": "number",
            "description": "The cost of building a switch.",
            "default": 1e30
          },
          "is_new": {
            "type": "boolean",
            "description": "Flag for whether or not this line is a new construction option.",
            "default": false
          },
          "can_harden": {
            "type": "boolean",
            "description": "Flag for whether or not this line can be hardened.",
            "default": true
          },
          "can_add_switch": {
            "type": "boolean",
            "description": "Flag for whether or not a switch can be built here",
            "default": true
          },
          "has_switch": {
            "type": "boolean",
            "description": "Flag for whether or not a switch already exists at the line",
            "default": false
          }
        },
        "required": [
          "id",
          "node1_id",
          "node2_id",
          "has_phase",
          "length",
          "num_phases",
          "line_code"
        ]
      }
    },
  
  
"lines_codes": {
      "type": "array",
      "description": "This is an array of the line codes of the model.  This used to compactly model aspects of a line that are common across lines.  For example, impedance values.",
      "items": {
        "type": "object",
        "description": "Each entry contains a block containing information about a single line code",
        "properties": {
          "line code": {
            "type": "string",
            "description": "Unique identifier for the line code"
          },
          "num_phases": {
            "type": "integer",
            "description": "Number of phases for the line code"
          },
          "rmatrix": {
            "type": "array",
            "description": "An array of the resistance terms for the line (per length, per unit). The entries correspond to the rows of the rmatrix",
            "items": {
              "type": "array",
              "description": "The first entry is phase A. The second entry is phase B. The third entry is phase C",
              "items" : {
                 "type": "number",
                 "description": "Column entries for the rmatrix"
              }
            }
          },
          "xmatrix": {
            "type": "array",
            "description": "An array of the reactance terms for the line (per length, per unit). The entries correspond to the rows of the rmatrix",
            "items": {
              "type": "array",
              "description": "The first entry is phase A. The second entry is phase B. The third entry is phase C",
              "items" : {
                 "type": "number",
                 "description": "Column entries for the rmatrix"
 
              }
            }
          }
        },
        "required": [
          "line_code",
          "num_phases",
          "rmatrix",
          "xmatrix"
        ]
      }
    },
  
  
    "generators": {
      "type": "array",
      "description": "This block describes the generators in the model.",
      "items": {
        "type": "object",
        "description": "Each entry of this array contains information about one generator in the model.  More than one generator can exist at a bus",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the generator"
          },
          "node_id": {
            "type": "string",
            "description": "identifier of the bus the generator is connected to"
          },
          "has_phase": {
            "type": "array",
            "description": "Array of flags indicating whether or not a generator has a phase or not",
            "items": {
              "type": "boolean",
              "default": true
            }
          },
          "max_real_phase": {
            "type": "array",
            "description": "Existing maximum real power output of the generator for each phase in per unit",
            "items": {
              "type": "number",
              "default": 1.7976931348623e+308
            }
          },
          "max_reactive_phase": {
            "type": "array",
            "description": "Existing maximum raective power output of the generator for each phase in per unit",
            "items": {
              "type": "number",
              "default": 1.7976931348623e+308
            }
          },
        "microgrid_cost": {
            "type": "number",
            "description": "One-time fixed cost for building (additional) distributed generation, i.e. expanded capacity",
            "default": 0
          },
          "is_new": {
            "type": "boolean",
            "description": "Flag indicating whether or not this is a new generator",
            "default": false
          }
        },
        "required": [
          "id",
          "node_id",
          "has_phase",
          "max_real_phase",
          "max_reactive_phase"
        ]
      }
    },
  
    "scenarios": {
      "type": "array",
      "description": "This block contains information about the damage scenarios",
      "items": {
        "type": "object",
        "description": "Each entry in the array contains information about a single damage scenario",
        "properties": {
          "id": {
            "type": "string",
            "description": "A unique identifier for the scenario"
          },
          "hardened_disabled_lines": {
            "type": "array",
            "description": "A list of identifiers for electric power lines that are damaged even after being hardened",
            "items": {}
          },
         "disabled_communication_lines": {
            "type": "array",
            "description": "A list of identifiers for communication lines that are damaged if they are not hardened",
            "items": {}
          },
          "disabled_lines": {
            "type": "array",
            "description": "A list of identifiers for electric power lines that are damaged if they are not hardened",
            "items": {}
          }
        },
        "required": [
          "id"
        ]
      }
    } 
  },
  "required": [
    "buses",
    "loads",
    "lines",
    "line_codes",
    "generators",
    "scenarios"
  ]
}

Output Format

The output for the RDT software is JSON based. The top level output parameters include


design_cost               The cost of the chosen design
total_load                The total load that can be satisfied by the 
                          demand (per unit)

The design solution for power lines includes


id                         The unique identifier of the line.
hardened                   Boolean for whether or not the line is
                           hardened.
built                      Boolean for whether or not the line is
                           built.
switch_built               Boolean for whether or not a switch is
                           added to a line.

The design solution for generators includes


id                         The unique identifier of the generator.
built_capacity             The capacity of the built generator (0 if
                           the generator is not built)

The scenario solutions in include the following results for each bus.


id                         The unique identifier of the bus.
voltage                    The three phase voltage magnitude for the bus

The scenario solutions in include the following results for each line.


id                         The unique identifier of the line.
in_use                     Boolean for whether or not the line is in use

The scenario solutions in include the following results for each load.


id                         The unique identifier of the load.
real_served                The 3 phase real consumption in per unit 
reactive_served            The 3 phase reactive consumption in per unit 
real_unserved              The 3 phase real demand not served in per unit 
reactive_unserved          The 3 phase reactive demand not served in per unit 

The scenario solutions in include the following results for each generator.


id                         The unique identifier of the generator.
real_phase                 Real output of the generator (3 phases) in per unit 
reactive_phase             Reactive output of the generator (3 phases) in per unit 

JSON Output Format

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "The definition of the output from RDT",
  "properties": {
    "design_solution": {
      "type": "object",
      "description": "The block defines the design solution.",
      "properties": {
        "design_cost": {
          "type": "number",
          "description": "The cost of the chosen design"
        },
        "total_load": {
          "type": "number",
          "description": "The total load that can be satisfied by the demand (per unit)"
        },
        "lines": {
          "type": "array",
          "description": "This block defines the design solution associated with lines",
          "items": {
            "type": "object",
            "description": "The design of a specific line",
            "properties": {
              "id": {
                "type": "string",
                "description": "The line's unique identifier"
              },
              "hardened": {
                "type": "boolean",
                "description": "Whether or not a line was hardened"
              },
              "built": {
                "type": "boolean",
                "description": "Whether or not a line was built"
              },
              "switch_built": {
                "type": "boolean",
                "description": "Whether or not a switch was added to a line"
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "generators": {
          "type": "array",
          "description": "This block defines the design solution associated with generators",
          "items": {
            "type": "object",
            "description": "The design of a specific generator",
            "properties": {
              "id": {
                "type": "string",
                "description": "The unique identifier for the generator"
              },
              "built_capacity": {
                "type": "number",
                "description": "The capacity built for this generator"
              }
            },
            "required": [
              "id"
            ]
          }
        }
      },
      "required": [
        "design_cost"
      ]
    },
    "scenario_solution": {
      "type": "array",
      "description": "Results associated with operations choices under a specific damage scenario.  These choices are generally fed to a trusted power flow simulator for verification",
      "items": {
        "type": "object",
        "description": "The operations choices for a specific damage scenario.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The scenario's unique identifier"
          },
          "critical_load_met": {
            "type": "number",
            "description": "The critical load that is satisfied in this scenario (per unit)"
          },
          "non_critical_load_met": {
            "type": "number",
            "description": "The non critical load that is satisfied in this scenario (per unit)"
          },
          "lines": {
            "type": "array",
            "description": "Line operations data",
            "items": {
              "type": "object",
              "description": "A specific line's operation point",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the line"
                },
                "in_use": {
                  "type": "boolean",
                  "description": "Whether or not a line is in use.  Lack of use could be because the line is not built, it is damaged and/or the switch is open"
                }
              },
              "required": [
                "id",
                "in_use"
              ]
            }
          },
          "buses": {
            "type": "array",
            "description": "The bus operating points",
            "items": {
              "type": "object",
              "description": "A specific bus's operating point",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique id"
                },
                "voltage": {
                  "type": "array",
                  "description": "The three phase voltage magnitude for the bus",
                  "items": {
                    "type": "number"
                  }
                }
              },
              "required": [
                "id",
                "voltage"
              ]
            }
          },
          "generators": {
            "type": "array",
            "description": "The generator operating points",
            "items": {
              "type": "object",
              "description": "A specific generator's operating point",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique id"
                },
                "real_phase": {
                  "type": "array",
                  "description": "Real output of the generator (3 phases) in per unit",
                  "items": {
                    "type": "number"
                  }
                },
                "reactive_phase": {
                  "type": "array",
                  "description": "Reactive output of the generator (3 phases) in per unit",
                  "items": {
                    "type": "number"
                  }
                }
              },
              "required": [
                "id",
                "real_phase",
                "reactive_phase"
              ]
            }
          },
          "loads": {
            "type": "array",
            "description": "The load operating points for the damage scenario",
            "items": {
              "type": "object",
              "description": "A specific load operating point",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The unique id"
                },
                "real_served": {
                  "type": "array",
                  "description": "The 3 phase real consumption in per unit",
                  "items": {
                    "type": "number"
                  }
                },
                "reactive_served": {
                  "type": "array",
                  "description": "The 3 phase reactive consumption in per unit",
                  "items": {
                    "type": "number"
                  }
                },
                "real_unserved": {
                  "type": "array",
                  "description": "The 3 phase real demand not served in per unit",
                  "items": {
                    "type": "number"
                  }
                },
                "reactive_unserved": {
                  "type": "array",
                  "description": "The 3 phase reactive demand not served in per unit",
                  "items": {
                    "type": "number"
                  }
                }
              },
              "required": [
                "id",
                "real_phase",
                "reactive_phase"
              ]
            }
          }
        },
        "required": [
          "id",
          "lines",
          "buses",
          "generators",
          "loads"
        ]
      }
    }
  },
  "required": [
    "design_solution",
    "scenario_solution"
  ]
}