Public interface
New resource types
EnergyModelsLanguageInterfaces.ResourceBio — Type
ResourceBio{T<:Real} <: ResourceResources that can be transported and converted. These resources cannot be included as resources that are emitted, e.g, in the variable emissions_strategic. Compared to a ResourceCarrier, the ResourceBio Resource includes additionally the fuel definition (a string identifier of the biomass) and the moisture content of the biomass (as a mass fraction).
Fields
idis the name/identifyer of the resource.bio_type::Stringis the type of biomass, e.g., "sprucestem", "sprucebark", "spruceT&B", or "birchstem".moisture::Float64is the moisture content of the biomass resource as a mass fraction.co2_int::Tis the CO₂ intensity, e.g., t/MWh.
New parameter types
EnergyModelsLanguageInterfaces.PVParameters — Type
PVParameters
PVParameters(lat::Real, lon::Real; loss::Real = 14.0,
pvtechchoice::String = "crystSi", mountingplace::String = "free",
optimalangles::Bool = true, usehorizon::Bool = true,
)A structure to hold parameters for photovoltaic (PV) power generation.
Fields
lat::Real: Latitude of the location in decimal degrees (e.g., 52.0 for 52°N).lon::Real: Longitude of the location in decimal degrees (e.g., 13.0 for 13°E).loss::Real=14.0: Total system losses in percentage (e.g., 14.0 for 14% losses).pvtechchoice::String="crystSi": Type of PV technology. Options include:"crystSi": Crystalline silicon (default)."CIS": Copper indium selenide."CdTe": Cadmium telluride.
mountingplace::String="free": Mounting type of the PV system. Options include:"free": Free-standing system (default)."building": Building-integrated system.
optimalangles::Bool=true: Whether to use optimal tilt and azimuth angles for the PV system.usehorizon::Bool=true: Whether to include the effect of the horizon in the calculations.
New nodal types
EnergyModelsLanguageInterfaces.WindPower — Type
WindPower <: AbstractNonDisRESA wind power source. It extends the existing AbstractNonDisRES node through allowing for sampling the profile from a Python code through a constructor.
Fields
idis the name/identifyer of the node.cap::TimeProfileis the installed capacity.profile::TimeProfileis the power production in each operational period as a ratio of the installed capacity at that time.opex_var::TimeProfileis the variable operating expense per energy unit produced.opex_fixed::TimeProfileis the fixed operating expense.output::Dict{Resource, Real}are the generatedResources, normally Power.data::Vector{<:Data}is the additional data (e.g. for investments). The fielddatais conditional through usage of a constructor.
EnergyModelsLanguageInterfaces.PV — Type
PV <: AbstractNonDisRESA photovoltaic source. It extends the existing AbstractNonDisRES node through extracting data from the PVGIS tool from the EU Science Hub (available at https://re.jrc.ec.europa.eu/pvg_tools) through a constructor.
Fields
idis the name/identifyer of the node.cap::TimeProfileis the installed capacity.profile::TimeProfileis the power production in each operational period as a ratio of the installed capacity at that time.opex_var::TimeProfileis the variable operating expense per energy unit produced.opex_fixed::TimeProfileis the fixed operating expense.output::Dict{Resource, Real}are the generatedResources, normally Power.data::Vector{<:Data}is the additional data (e.g. for investments). The fielddatais conditional through usage of a constructor.
EnergyModelsLanguageInterfaces.CSPandPV — Type
CSPandPV <: AbstractNonDisRESA combined CSP and PV source producing both power and heat. It extends the existing AbstractNonDisRES to multiple production profiles. The profiles can have variations on the strategic level.
Fields
idis the name/identifyer of the node.cap::Dict{<:Resource,<:TimeProfile}is the installed capacity (for all resources in a Dict).profile::Dict{<:Resource,<:TimeProfile}is the production profile in each operational period as a ratio of the installed capacity at that time (for all resources in a Dict).opex_var::Dict{<:Resource,<:TimeProfile}is the variable operating expense per energy unit produced (for all resources in a Dict).opex_fixed::Dict{<:Resource,<:TimeProfile}is the fixed operating expense (for all resources in a Dict).output::Dict{Resource, Real}are the generatedResources, normally Power.data::Vector{<:Data}is the additional data (e.g. for investments). The fielddatais conditional through usage of a constructor.
EnergyModelsLanguageInterfaces.MultipleBuildingTypes — Type
struct MultipleBuildingTypes <: EMB.SinkA MultipleBuildingTypes node that creates sinks for all demand resources. The demand for each resources has a penalty for both surplus and deficit. The penalties introduced in the field penalty affect the variable OPEX for both a surplus and deficit.
Fields
idis the name/identifier of the node.cap::Dict{<:Resource,<:TimeProfile}is the demand.penalty_surplus::Dict{<:Resource,<:TimeProfile}are the penalties for surplus.penalty_deficit::Dict{<:Resource,<:TimeProfile}are the penalties for deficit.input::Dict{<:Resource,<:Real}are the inputResources with conversion valueReal.data::Vector{<:Data}is the additional data (e.g., for investments). The fielddatais conditional through usage of a constructor.
EnergyModelsLanguageInterfaces.BioCHP — Type
BioCHP <: NetworkNodeA BioCHP node that samples the CHP model at https://github.com/iDesignRES/CHP_modelling.git.
The current implementation supports v0.4.0 (can be achieved with git checkout v0.4.0).
The BioCHP utilizes a linear, time independent conversion rate of the input Resources to the output Resources, subject to the available capacity. The capacity is hereby normalized to a conversion value of 1 in the fields input and output.
Fields
idis the name/identifier of the node.cap::TimeProfileis the installed capacity.electricity_resource::Resourceis the electric power resource.opex_var::TimeProfileis the variable operating expense per per capacity usage through the variable:cap_use.opex_fixed::TimeProfileis the fixed operating expense per installed capacity through the variable:cap_inst.input::Dict{<:Resource,<:Real}are the inputResources with conversion valueReal.output::Dict{<:Resource,<:Real}are the generatedResources with conversion valueReal.data::Vector{<:Data}is the additional data (e.g., for investments). The fielddatais conditional through usage of a constructor.
Sampling constructors
EnergyModelsLanguageInterfaces.WindPower — Method
WindPower(
id::Any,
cap::TimeProfile,
windfarm::Dict,
time_start::String,
time_end::String,
opex_var::TimeProfile,
opex_fixed::TimeProfile,
output::Dict{<:Resource,<:Real};
data::Vector{<:Data} = Data[],
method::String = "Ninja",
data_path::String = "",
source::String = "NORA3",
)Constructs a WindPower instance where the power production profile is sampled from a Python function.
Arguments
idis the name or identifier of the node.capis the installed capacity.windfarmis a dictionary containing the wind farm parameters. An example dictionary is given by:windfarm = Dict( "id" => "windfarm_1", # The identifier of the windfarm "lat" => 56.8233, # The latitude coordinates of the windfarm "lon" => 4.3467, # The longitude of the wind farm "orientation" => missing, # The orientation "shape" => missing, "turbine_height" => 150, # The turbine height )time_startis the starting time (as a string) for the wind power time series sampling. The format is "YYYY-MM-DD".time_endis the end time (as a string) for the wind power time series sampling. The format is "YYYY-MM-DD".opex_varis the variable operating expense per energy unit produced.opex_fixedis the fixed operating expense.outputare the generatedResources, normally Power, with conversion valueReal.
Keyword arguments
datais the additional data (e.g., for investments). The default value is nodata.methodis the chosen method for data retrieval. The user can choose between the strings "Ninja", "Tradewindoffshore", "Tradewindupland", and "Tradewind_lowland". The default value is "Ninja".data_pathis an optional file path for already downloaded data. The default value is an empty datapath.sourceis the data source for wind data. The user can choose between the strings "NORA3" and "ERA5". The default value is "NORA3".
EnergyModelsLanguageInterfaces.PV — Method
PV(
id::Any,
cap::TimeProfile,
opex_var::TimeProfile,
opex_fixed::TimeProfile,
output::Dict{<:Resource,<:Real},
time_start::DateTime,
time_end::DateTime,
params::PVParameters;
data::Vector{<:Data} = Data[],
data_path::String = "pvgis_cache",
filename_hint::String = "",
)Constructs a PV instance where the power production profile is sampled from the PVGIS API.
Arguments
id: The name or identifier of the node.cap: The installed capacity.opex_var: The variable operating expense per energy unit produced.opex_fixed: The fixed operating expense.output: The generatedResources, normally Power, with conversion valueReal.time_start::DateTime: The start of the time range for which the PV output data is requested.time_end::DateTime: The end of the time range for which the PV output data is requested.params::PVParameters: Parameters for the PV system. SeePVParametersfor details.
Keyword arguments
data: Additional data (e.g., for investments). Default is nodata.data_path: Directory where the cached CSV file will be stored. Default is"pvgis_cache".filename_hint: Optional string to include in the cache file name for identification. Default is"".
EnergyModelsLanguageInterfaces.CSPandPV — Method
CSPandPV(
id::Any,
process_pay_load::Dict,
time_start::DateTime,
time_end::DateTime,
resources_map::Dict{String,<:Resource};
data::Vector{<:Data} = Data[],
data_location::String = joinpath(tempdir(), "CSPandPV"),
overwrite_saved_data::Bool = false,
)Constructs a CSPandPV instance where the power and heat production profiles are sampled from the executeSolarEnergyModelProcess function in the solar_power_plants python project.
Arguments
idis the name or identifier of the node in EMX.process_pay_loadis the process dictionary for the Python function.time_startis the start time for the sampling.time_endis the end time for the sampling.resources_mapis a map of resource keys toEMB.Resources, e.g., the dictionaryPower = ResourceCarrier("Power", 0.0) Heat = ResourceCarrier("Heat", 0.0) resources_map = Dict( "Ppv" => Power, "Pthermal" => Heat, )It must contain the keys "Ppv" and "Pthermal" with their equivalent in EMX as values.
Keyword arguments
datais the additional data (e.g., for investments). The default value is nodata.data_locationis the location where the data is saved. The default value is in the temporary directory.overwrite_saved_datais a boolean that determines if the stored data should be overwritten (in which case the buildingenergyprocess is called). The default value isfalse.
EnergyModelsLanguageInterfaces.MultipleBuildingTypes — Method
MultipleBuildingTypes(
id::Any,
process_pay_load::Dict,
time_start::DateTime,
time_end::DateTime,
buildings::Vector{String},
resources_map::Dict{String,<:Resource},
T::TimeStructure,
penalty_surplus::Dict{<:Resource,<:TimeProfile},
penalty_deficit::Dict{<:Resource,<:TimeProfile};
data::Vector{<:Data} = Data[],
data_location::String = joinpath(tempdir(), "buildings"),
overwrite_saved_data::Bool = false,
)Constructs a MultipleBuildingTypes instance where the demand profiles are sampled from the executeBuildingEnergySimulationProcess function in the building_energy_process python project.
Arguments
idis the name or identifier of the node.process_pay_loadis the process dictionary for the Python function.time_startis the starting time for the sampling.time_endis the ending time for the sampling.buildingsis a vector of the buildings to be considered. Any combination of the following building types are allowed:- "Apartment Block"
- "Single family- Terraced houses"
- "Hotels and Restaurants"
- "Health"
- "Education"
- "Offices"
- "Trade"
- "Other non-residential buildings"
- "Sport"
resources_mapis a map of resource keys toEMB.Resources, e.g., the dictionaryCoal = ResourceCarrier("Coal", 0.35) LNG = ResourceCarrier("LNG", 0.2) Oil = ResourceCarrier("Oil", 0.3) NG = ResourceCarrier("NG", 0.2) SolidBiomass = ResourceCarrier("SolidBiomass", 0.1) Power = ResourceCarrier("Power", 0.0) Heat = ResourceCarrier("Heat", 0.0) LiquidBiomass = ResourceCarrier("LiquidBiomass", 0.15) Biogas = ResourceCarrier("Biogas", 0.05) Hydrogen = ResourceCarrier("Hydrogen", 0.0) SolarHeat = ResourceCarrier("SolarHeat", 0.0) resources_map = Dict( "Solids|Coal" => Coal, "Liquids|Gas" => LNG, "Liquids|Oil" => Oil, "Gases|Gas" => NG, "Solids|Biomass" => SolidBiomass, "Electricity" => Power, "Heat" => Heat, "Liquids|Biomass" => LiquidBiomass, "Gases|Biomass" => Biogas, "Hydrogen" => Hydrogen, "Heat|Solar" => SolarHeat, )Tis the TimeStructure used in the model.penalty_surplus::Dict{<:Resource,<:TimeProfile}is the penalties for surplus.penalty_deficit::Dict{<:Resource,<:TimeProfile}is the penalties for deficit.
Keyword arguments
datais the additional data (e.g., for investments). The default value is nodata.data_locationis the location where the data is saved. The default value is in the temporary directory.overwrite_saved_datais a boolean that determines if the stored data should be overwritten (in which case the buildingenergyprocess is called). The default value isfalse.
The "Variable cost [€/KWh]" and "Emissions [KgCO2/KWh]" from the building_energy_process model is currently not used. Both of these are incorporated indirectly through the usage of the energy carriers.
EnergyModelsLanguageInterfaces.BioCHP — Method
BioCHP(
id::Any,
cap::TimeProfile,
mass_fractions::Dict{<:ResourceBio,<:Real},
heat_output_ratios::Dict{<:ResourceHeat,<:Real},
electricity_resource::Resource;
data::Vector{<:Data} = Data[],
libpath::String = joinpath(
@__DIR__,
"..",
"..",
"CHP_modelling",
"build",
"lib",
"libbioCHP_wrapper.so",
),
)Constructs a BioCHP instance where the power and heat production profiles are sampled from the bioCHP_plant_c function in the C++ library CHP_modelling with shared library file located at libpath. The BioCHP has electricity production of the resource electricity_resource and heat production of the resources in heat_output_ratios (which can be different ResourceHeats at different temperature levels).
Arguments
idis the name or identifier of the node.capis the installed electric capacity.mass_fractionsis the mass fractions of each inputResourceBio.heat_output_ratiosis the output heatResourceHeats with the ratio of installed capacity of heat to that of the electricity.electricity_resourceis theResourcefor the electricity.
Keyword arguments
data::Vector{<:Data}is the additional data (e.g., for investments).libpathis the absolute path of theCHP_modellinglibrary file.
Utility functions
EnergyModelsLanguageInterfaces.call_python_function — Function
call_python_function(module_name::String, function_name::String; kwargs...)
call_python_function(module_name::String, function_name::String, args::Vector)Call an external Python function.
Arguments
module_name- the name of the Python module to be used.function_name- the name of the function to be called. Nested names (e.g., due to sub modules) must be separated by ".".
This function enables a vector of arguments (args) or keyword arguments (kwargs) as the input to the python function to be called.
The function can be called with either a vector of arguments or keyword arguments, but not both. A combination of both arguments and keyword arguments is not possible as Julia does not distinguish methods solely based on the presence of keyword arguments.
It is assumed that the required packages of the python module is installed in the root environment.
If a specific python environment is required, one can use conda to create the environment and then set ENV["PYTHON"] to the path of the python executable in that environment. This requires a rebuild of PyCall with Pkg.build("PyCall") followed by a restart of Julia.
EnergyModelsLanguageInterfaces.fetch_element — Function
fetch_element(elements, id)Fetch the element with the given id from the elements array.