Model object

The anyModel object is the overarching structure that contains all data and objects of particular energy system model created with AnyMOD.

anyModel(inDir::Union{String,Array{String,1}}, outDir::String; kwargs)

In- and output files

The constructor function above has two mandatory arguments that the directories for in- and output files. inDir::Union{String,Array{String,1}} specifies the directory (or directories) of input files. This can either be a string or an array of strings if input files are spread across different directories.

All .csv files within the provided directories (and their sub-directories) starting with set_ or par_ will be read-in as an input file. Other files are ignored and can be used for documentation. Within the specific files, only columns whose name contains one of the following keywords are actually read-in: parameter, variable, value, id, region, timestep, carrier, technology, and mode. Other columns can be used freely for documentation.

Reserved keywords

Within the input files all is a reserved keyword. For an explanation on how it is used, see Time-steps.

outDir::String: defines the directory of output files. All reporting files including status reports, results, or graphs are written to this directory.

Optional arguments

Additionally, the constructor accepts a list of optional arguments listed in the table below.

  • internal name of the model object
  • added to the name of output files and printed during reporting
""data handling
  • specifies the delimiter used within the read-in csv files
  • interval in years between steps of capacity expansion
10model generation
  • depth in the tree of time-steps that defines the superordinate dispatch level (usually years)
  • scales down energy quantities within the model, relevant when working
    with reduced time-series
  • controls if the model performs endogenous decommissioning, see decommissioning
    for implementation
  • available options are:
    • decomm: capacities are decommissioned endogenously, once decommissioned
      capacities cannot be put into operation again
    • recomm: no endogenous decommissioning, operated capacities equal installed capacities
    • none: capacities are decommissioned endogenously and can be put back into operation
  • capacity expansion can be modeled at a resolution less detailed than yearly, this option
    determines how capacities are distributed among the subsequent years in this case
  • available options are:
    • linear: expansion is equally distributed among years resulting in a linear increase
    • none: all expansion occurs in the first year
  • controls the frequency of writing updates to the console
  • controls the frequency of checking for errors
  • controls the frequency of writing to the report file
avaMin0.01performance and stability
  • determines if losses from exchange and self-discharge of storage are subject to emissions
    (see Range of factors)
  • if set, reports all constraints whose range exceeds the specified value
  • type is Float64
  • scales different groups of variables within the model
  • format for argument is (capa = 1e1, oprCapa = 1e2, dispConv = 1e3, ...)
  • see Column scaling for details and defaults
  • specifies the maximum range of coefficients in the matrix and right-hand side of the model's underlying
    optimization problem
  • format for argument is (mat = (1e-2,1e5), rhs = (1e-2,1e2))
  • see Row scaling for details and defaults
  • sets external bounds for all capacities and dispatch variables (in GW) and for the objective value (in Mil. €)
  • see Variable limits for details and defaults
  • format for argument is (capa = NaN, disp = NaN, obj = NaN)


Relevant fields of the model object include:
  • sets::Dict{Symbol,Tree}: sets defined within the model and their tree structure each saved as Tree object (see Sets and mappings for details)
  • parts::NamedTuple: all parts of the model, these contain the specific parameters, variables, and constraints (see Parts for details)
  • report::Array{Tuple,1}: entries for writing to the reporting file (see Error handling for details)
  • graInfo::graInfo: properties for creation of plots and graphics, can be used to adjust colors and labels (see Styling for details)
  • optModel::Model: the actual JuMP object of the models underlying optimization problem