When making a Julia script file in ENERGY 2100, it is helpful to modify a Julia Script File - Modifying a Va

Each policy file contains Julia code and is set up with a standardized structure having the following 7 components:

Components of a Policy File:


  1. Load the EnergyModel to gain access to ENERGY 2100's variables, functions, etc.
  2. Define the policy file as a new module. Assign the module a name.
  3. Import global functions and constants defined in the EnergyModel to have access in the policy module.        
  4. Define new data types, VariableArray and SetArray. These data types will be used structure variables as arrays of float64 numbers, and the sets to be vectors of strings. 
  5. Create and initialize objects (variable arrays and sets) to be used in the policy file as a Julia struct. Assign a name to the struct ("RControl" in the figure below). The struct is defined using Julia's @kwdef macro (short for "keyword default") which is a helper utility for creating Julia structures allowing for user-defined VariableArrays and SetArrays to hold data.
  6. Write code in Julia function(s) to modify policy variables.
  7. Call to the functions written in #6 to execute the policy equations.