Public library
Index
EnergyModelsCompliance.compliance_elementEnergyModelsCompliance.compliance_elementEnergyModelsCompliance.test_caseEnergyModelsCompliance.test_case
Nodes and Links
EnergyModelsCompliance.compliance_element — Method
compliance_element(n::EMB.Node)
compliance_element(n::Storage)
compliance_element(l::Link)Returns two NamedTuples corresponding to respectively the errors and warnings of the testing of the indivdiual test functions. The called test functions are dependent on the chosen type:
The following functions are called:
compliance_capacity, not forStoragenodes,compliance_opex_var, not forStoragenodes,compliance_opex_fixed, not forStoragenodes,compliance_inputs, if the node has an input, checked through the functionhas_input,compliance_outputs, if the node has an output, checked through the functionhas_output,compliance_data,compliance_levelforStoragenodes, including a check that thelevelis corresponding to anAbstractStorageParameters, andcompliance_stor_resforStoragenodes.
EnergyModelsCompliance.test_case — Method
test_case(n::Source, 𝒯::TimeStructure, warn_log; co2::ResourceEmit = ResourceEmit("CO₂", 1.0))
test_case(n::NetworkNode, 𝒯::TimeStructure, warn_log; co2::ResourceEmit = ResourceEmit("CO₂", 1.0))
test_case(n::Storage, 𝒯::TimeStructure, warn_log; co2::ResourceEmit = ResourceEmit("CO₂", 1.0))
test_case(n::Sink, 𝒯::TimeStructure, warn_log; co2::ResourceEmit = ResourceEmit("CO₂", 1.0))Default testset which tests that the developed Node n can be included in an EnergyModelsBase model, and that the resulting model is solvable.
The testset automatically identifies a minimum working case for the given node structure and solves this case. The Source node of the example has in all versions (except if you test a source node) a variable OPEX of 0. This implies, that if you test a Sink node without a fixed demand, you must provide parameters so that it is beneficial to deliver energy to the sink node. This can be achieved through receiving a profit.
The same holds for a case in which you have a Storage node without an output.
The following default values are chosen:
- If we cannot use the function
capacity, we use a capacity of 100. Otherwise, the capacity is sufficient for the capacity of the node. - If we cannot use the function
opex_var(in all cases except forn::Sink), we assume it is 2500 for calculating the penalties of the Sink.
- If you use
JuMP.fixfor fixing storage charge or discharge variables, that is not providing a new method forhas_inputorhas_output, some of the tests may fail. These functions are in this case related to:cap_useof a source or sink, as well as:stor_charge_useor:stor_discharge_use. - The function is not working properly if you have the co2 keyword argument as
inputto your node. - The function is not designed to evaluate a required sequence of linked nodes. As an example, CCS retrofit requires the direct coupling of two nodes. This cannot be generalized.
- The function cannot be used for a link as you would need to provide
Nodes as values for the fields:fromand:to.
Arguments
n::EMB.Nodeis the node that is tested.𝒯::TimeStructureis the chosen time structure. It should only contain a single strategic period.warn_logis the warningNamedTupleobtained through calling the functioncompliance_element.
Keyword arguments
co2::ResourceEmitis the CO₂ resource in the model. If your node does not include CO₂, you do not have to specify it.
Tests
- The optimization problems leads to an optimal solution.
- The variable
:cap_useof all connected nodes is above 0.1 in at least one of the time periods.
We test furthermore:
- The variable
:cap_useof the nodenis above 0.1 in at least one of the time periods.
Storage nodes use a random source variable OPEX and a fixed sink demand to analyse the changes in the storage level. This implies that if the Storage node does not have an output, then it is crucial that it is beneficial to store the Resource. This can be achieved through negative OPEX terms that must be above We test furthermore:
- The variables
:stor_level,:stor_charge_use, and:stor_discharge_useof the nodenare above 0.1 in at least one of the time periods.
Areas and TransmissionModes
EnergyModelsCompliance.compliance_element — Method
EMC.compliance_element(a::Area)
EMC.compliance_element(tm::TransmissionMode)Returns two NamedTuples corresponding to respectively the errors and warnings of the testing of the indivdiual test functions. The called test functions are dependent on the chosen type:
The following functions are called:
EMC.compliance_capacity,EMC.compliance_opex_var, if theTransmissionModehas OPEX, checked through the functionhas_opex,EMC.compliance_opex_fixed, if theTransmissionModehas OPEX, checked through the functionhas_opex,EMC.compliance_inputs,EMC.compliance_outputs,EMC.compliance_data,compliance_lossforPipeMode,compliance_con_rateforPipeMode, andcompliance_bidirectional.
EMC.compliance_data is in the current stage removed due to changes to the handling of ExtensionData.
EnergyModelsCompliance.test_case — Method
EMC.test_case(tm::TransmissionMode, 𝒯::TimeStructure, warn_log; co2::ResourceEmit = ResourceEmit("CO₂", 1.0))Default testset which tests that the developed TransmissionMode tm can be included in an EnergyModelsGeography model, and that the resulting model is solvable.
The testset automatically identifies a minimum working case for the given transmission mode structure. The minimum working example includes 2 areas that are only connected by the given TransmissionMode. Area 1 is the :from area and includes sources for supplying all inputs of the TransmissionMode. Area 2 is the :to area and includes sinks for all outputs of the TransmissionMode. Both areas also include the opposite if bidirectional transport is allowed. In this case, the profit is positive in either area 1 or area 2.
The following default values are chosen:
- If we cannot use the function
capacity, we use a capacity of 100. Otherwise, the capacity is sufficient for the capacity of the mode. - The profit in the sinks is 150 and the penalty 1e4.
Arguments
tm::TransmissionModeis the transmission mode that is tested.𝒯::TimeStructureis the chosen time structure. It should only contain a single strategic period.warn_logis the warningNamedTupleobtained through calling the functioncompliance_element.
Tests
- The optimization problems leads to an optimal solution.
- The variable
:cap_useof all connected nodes is above 0.1 in at least one of the time periods. All source and sink nodes in the two areas are checked. - The variables
:trans_inand:trans_outare above 0.1 in at least one of the time periods.