From June 06th, all CI Jobs will run on federated Helmholtz infrastructure by default. If you need UFZ-internal resources, add the tag "ufz-internal" to your CI configuration or use a custom GitLab Runner (e.g. EVE). If you have any questions, feel free to contact us!

Curious to learn more about GitLab CI? Join this free course on 14-16 June. Register now

Commit fc4146e6 authored by Markus Millinger's avatar Markus Millinger
Browse files

Added short description of each function

parent 7ef55aae
......@@ -98,7 +98,7 @@
%% Text of abstract
\textbf{Ca. 100 words}
BENOPT, an optimal material and energy allocation model is presented, which is used to assess cost-optimal and/or greenhouse gas abatement optimal allocation of renewable energy carriers across power, heat and transport sectors. A high level of detail on the processes from source to end service enable detailed life-cycle and cost assessments, as well as a systems perspective. The model has an up to hourly resolution, which can be aggregated depending on the task. Pareto analyses can be performed, as well as thorough sensitivity analyses. The model has been developed in Matlab and GAMS and is designed to analyse sector coupling and biomass usage, as a more detailed complement to IAMs and power system models.
BENOPT, an optimal material and energy allocation model is presented, which is used to assess cost-optimal and/or greenhouse gas abatement optimal allocation of renewable energy carriers across power, heat and transport sectors. A high level of detail on the processes from source to end service enable detailed life-cycle and cost assessments, as well as a systems perspective. The model has an up to hourly resolution, which can be aggregated depending on the task. Pareto analyses can be performed, as well as thorough sensitivity analyses. The model has been developed in Matlab and GAMS and is designed to analyse sector coupling and biomass usage, as a more detailed complement to integrated assessment models and power system models.
\end{abstract}
\begin{keyword}
......@@ -228,15 +228,15 @@ BENOPT contains sectors for transport (road passenger, road goods, shipping and
The key model functions are presented here, with a mathematical formulation of the model presented in the supplementary material.
\textit{Process data, opex and capex costs}. The process data includes CAPEX data, infrastructure, operation and maintenance cost, personnel cost and inputs and outputs, including by-products and secondary feedstocks. The input and output data enables a detailed calculation of the costs and is elaborated in \cite{Millinger.2017b}.
\textit{Process data, opex and capex costs}. The process data includes CAPEX data, infrastructure, operation and maintenance cost, personnel cost and inputs and outputs, including by-products and secondary feedstocks. The input and output data enables a detailed calculation of the costs and is elaborated in \citet{Millinger.2017b}.
\textit{GHG function}. The agricultural and conversion process input and output data combined with emission factors enable the calculation of pathway GHG emissions, as described in \cite{Millinger.2018b}.
\textit{GHG function}. The agricultural and conversion process input and output data combined with emission factors enable the calculation of pathway GHG emissions \cite{Millinger.2018b}.
\textit{Feedstock cost module}. Feedstock price developments are calculated by adding the per hectare profit of a benchmark crop (wheat) to the per hectare production cost of each energy crop, as described in \cite{Millinger.2018d}.
\textit{Feedstock cost module}. Feedstock price developments are calculated by adding the per hectare profit of a benchmark crop (wheat) to the per hectare production cost of each energy crop \cite{Millinger.2018d}.
\textit{VRE and excess electricity modules}. Variable renewable electricity generation and power load in the baseline year is scaled according to the scenario specific future wind and solar PV capacity expansion and electricity demand development, resulting in VRE share and excess electricity developments, as described in \cite{Tafarte.2019,Millinger.2020}.
\textit{VRE and excess electricity modules}. Variable renewable electricity generation and power load in the baseline year is scaled according to the scenario specific future wind and solar PV capacity expansion and electricity demand development, resulting in VRE share and excess electricity developments \cite{Tafarte.2019,Millinger.2020}.
\textit{Optimization module}. Input data for the optimization is formatted to suit the GAMS data format and transferred to the optimization module in GAMS as described in an earlier version in \cite{Millinger.2019}. The data is transferred back to Matlab for data handling and plotting.
\textit{Optimization module}. Input data for the optimization is formatted to suit the GAMS data format and transferred to the optimization module in GAMS. The data is transferred back to Matlab for data handling and plotting.
\textit{Sensitivity analysis module}. Monte Carlo sensitivity analysis \cite{Millinger.2018d,Millinger.2018b} can be performed with parallel computing, enabling faster runs. Any parameter can be added for variation and plotting related to individual parameters can be performed (Fig. \ref{fig:monteCarloScatter}).
......
This diff is collapsed.
This diff is collapsed.
......@@ -17,6 +17,9 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Creation of GAMS variables
%
function gamsVarOut = gamsVarCreate2(name,inputVar,x,y,type)
......
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BENOPT (BioENergy OPTimisation model)
% Copyright (C) 2012-2020 Markus Millinger
%
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Calculation of greenhouse gas emissions of biomass crops and conversion
% technologies
%
function [s,f]=ghgEmissions(s,f)
for time=1:s.runTime
%% Feedstock
f.ghgCultivationTotHa(time,:) = f.ghgSeeds.*f.ghgEFSeeds...
+f.ghgN2Oha.*f.ghgEFN2O...
+f.ghgNha.*f.ghgEFN(time)...
+f.ghgP2O5.*f.ghgEFP2O5...
+f.ghgK2O.*f.ghgEFK2O(1)...
+f.ghgCaO.*f.ghgEFCaO(1)...
+f.ghgMgO.*f.ghgEFMgO...
+f.ghgPesticides.*f.ghgEFPesticides(1)...
+f.ghgPowerDrying.*s.ghgEFPower(time)...
+f.ghgDiesel.*s.ghgEFDiesel(time); %kg Co2eq/ha/a
f.ghgCultivationTotTfm(time,:) = f.ghgCultivationTotHa(time,:)./f.feedYieldFM(time,:); %%kg Co2eq/tFM - FeedYield without temporal development
f.ghgCultivationTotGJfeed(time,:) = f.ghgCultivationTotTfm(time,:)./f.feedFMenergyContent; %%kg Co2eq/GJfeed
%%
f.ghgTransport1(time) = (s.ghgTransp1DistFull.*s.ghgTranspDieselFull+...
s.ghgTransp1DistEmpty.*s.ghgTranspDieselEmpty).*s.ghgEFDiesel(time)./s.ghgTransp1Amount; %CO2eq/tFM
f.ghgTransport1GJfeed(time,1:f.numFeed) = f.ghgTransport1(time).*ones(1,f.numFeed)./f.feedFMenergyContent; %CO2eq/tFM
if s.heatOption==1
s.ghgEFHeat(time,:) = ones([s.numTech,1]).*0.067; %kgCO2eq/MJ
elseif s.heatOption==2
s.ghgEFHeat(time,:) = ones([s.numTech,1])*(...
%% Feedstock
f.ghgCultivationTotHa(time,:) = f.ghgSeeds.*f.ghgEFSeeds...
+f.ghgN2Oha.*f.ghgEFN2O...
+f.ghgNha.*f.ghgEFN(time)...
+f.ghgP2O5.*f.ghgEFP2O5...
+f.ghgK2O.*f.ghgEFK2O(1)...
+f.ghgCaO.*f.ghgEFCaO(1)...
+f.ghgMgO.*f.ghgEFMgO...
+f.ghgPesticides.*f.ghgEFPesticides(1)...
+f.ghgPowerDrying.*s.ghgEFPower(time)...
+f.ghgDiesel.*s.ghgEFDiesel(time); %kg Co2eq/ha/a
f.ghgCultivationTotTfm(time,:) = f.ghgCultivationTotHa(time,:)./f.feedYieldFM(time,:); %%kg Co2eq/tFM - FeedYield without temporal development
f.ghgCultivationTotGJfeed(time,:) = f.ghgCultivationTotTfm(time,:)./f.feedFMenergyContent; %%kg Co2eq/GJfeed
%%
f.ghgTransport1(time) = (s.ghgTransp1DistFull.*s.ghgTranspDieselFull+...
s.ghgTransp1DistEmpty.*s.ghgTranspDieselEmpty).*s.ghgEFDiesel(time)./s.ghgTransp1Amount; %CO2eq/tFM
f.ghgTransport1GJfeed(time,1:f.numFeed) = f.ghgTransport1(time).*ones(1,f.numFeed)./f.feedFMenergyContent; %CO2eq/tFM
if s.heatOption==1
s.ghgEFHeat(time,:) = ones([s.numTech,1]).*0.067; %kgCO2eq/MJ
elseif s.heatOption==2
s.ghgEFHeat(time,:) = ones([s.numTech,1])*(...
f.ghgCultivationTotHa(time,6)... %CO2eq/ha
+f.ghgTransport1(time).*f.feedYieldFM(6)... %CO2eq/tFM * tFM/ha
)./(f.feedYieldGJ(6).*10^6*s.heatEta); %CO2eq/ha *(GJ/ha)^-1 * GJ/MJ * eta^-1
end
s.ghgP1tot(time,:) = s.ghgP1Heat(time,:).*s.ghgEFHeat(time,:)...
+ s.ghgP1Power(time,:).*s.ghgEFPower(time)... + s.ghgP1Hydrogen.*s.ghgEFHydrogen(time)...Hydrogen GHG is calculated in GAMS
+ s.ghgP1CO2(time,:).*s.ghgEFCO2(time);%
s.ghgP2tot(time,:) = s.ghgP2Heat(time,:).*s.ghgEFHeat(time,:)...
+s.ghgP2Power(time,:).*s.ghgEFPower(time)...
+s.ghgP2CH3OH(time,:).*s.ghgEFCH3OH(time);
s.ghgP2Byprod(time,:) = s.ghgP2YieldByprod.*10^3-s.ghgP2ByprodUpgradePower.*s.ghgEFPower(time); %/tFM_feed
s.ghgTransport21(time,:) = s.ghgTranspGasGridPower.*s.ghgEFPower(time)+s.ghgTranspProcessHeat.*s.ghgEFHeat(time,:);
s.ghgTransport22(time,:) = (s.ghgTransp2DistFull.*s.ghgTranspDieselFull+s.ghgTransp2DistEmpty.*s.ghgTranspDieselEmpty).*s.ghgEFDiesel(time)./s.ghgTranspAmount;
s.ghgTransport2(time,:) = s.ghgTransport21(time,:)+s.ghgTransport22(time,:);
s.P1toGJfactor(time,:) = s.ghgP1AllocationFactor.*s.ghgP2AllocationFactor...
./(s.feedFMenergyContent.*s.plantConvEta(time,:));
s.P2toGJfactor(time,:) = s.ghgP2AllocationFactor./(s.feedFMenergyContent.*s.plantConvEta(time,:));
s.ghgCultivationTotGJ(time,:) = zeros(1,s.numTech);%s.ghgCultivationTotHa(time,:).*s.hatoGJfactor(time,:);
s.ghgTransport1GJ(time,:) = zeros(1,s.numTech);%s.ghgTransport1(time,:).*s.P1toGJfactor(time,:);
%%
s.ghgP1totGJ(time,:) = s.ghgP1tot(time,:).*s.P1toGJfactor(time,:);
s.ghgP2totGJ(time,:) = s.ghgP2tot(time,:).*s.P2toGJfactor(time,:);
s.ghgP2ByprodGJ(time,:) = -s.ghgP2Byprod(time,:)./(s.feedFMenergyContent.*s.plantConvEta(time,:));
s.ghgTransport2GJ(time,:) = s.ghgTransport2(time,:);%./(s.feedFMenergyContent.*s.plantConvEta(time,:));
%kgCo2eq/GJ
s.fuelGHGemission(time,:) = s.ghgCultivationTotGJ(time,:)+s.ghgTransport1GJ(time,:)+s.ghgP1totGJ(time,:)+s.ghgP2totGJ(time,:)+s.ghgP2ByprodGJ(time,:)+s.ghgTransport2GJ(time,:);
s.ghgHeatTotGJ(time,:) = s.ghgP1Heat(time,:).*s.ghgEFHeat(time,:).*s.P1toGJfactor(time,:)...
+ s.ghgP2Heat(time,:).*s.ghgEFHeat(time,:).*s.P2toGJfactor(time,:)...
+ s.ghgTranspProcessHeat.*s.ghgEFHeat(time,:);
s.ghgPowerTotGJ(time,:) = s.ghgP1Power(time,:).*s.ghgEFPower(time).*s.P1toGJfactor(time,:)...
+ s.ghgP2Power(time,:).*s.ghgEFPower(time).*s.P2toGJfactor(time,:)...
+ s.ghgTranspGasGridPower.*s.ghgEFPower(time);
s.ghgDieselTotGJ(time,:) = s.ghgTransport22(time,:);
s.ghgSoilN2OTotGJ(time,:) = zeros(1,s.numTech);
s.ghgFertilizerTotGJ(time,:) = zeros(1,s.numTech);
s.ghg2ndFeedTotGJ(time,:) = s.ghgP2CH3OH(time,:).*s.ghgEFCH3OH(time).*s.P2toGJfactor(time,:);
s.ghgOtherTotGJ(time,:) = zeros(1,s.numTech);
s.fuelGHGabatement(time,:) = s.referenceGHGemission-s.fuelGHGemission(time,:); %% %kgCo2eq/GJ - Positive number
end
s.ghgP1tot(time,:) = s.ghgP1Heat(time,:).*s.ghgEFHeat(time,:)...
+ s.ghgP1Power(time,:).*s.ghgEFPower(time)... + s.ghgP1Hydrogen.*s.ghgEFHydrogen(time)...Hydrogen GHG is calculated in GAMS
+ s.ghgP1CO2(time,:).*s.ghgEFCO2(time);%
s.ghgP2tot(time,:) = s.ghgP2Heat(time,:).*s.ghgEFHeat(time,:)...
+s.ghgP2Power(time,:).*s.ghgEFPower(time)...
+s.ghgP2CH3OH(time,:).*s.ghgEFCH3OH(time);
s.ghgP2Byprod(time,:) = s.ghgP2YieldByprod.*10^3-s.ghgP2ByprodUpgradePower.*s.ghgEFPower(time); %/tFM_feed
s.ghgTransport21(time,:) = s.ghgTranspGasGridPower.*s.ghgEFPower(time)+s.ghgTranspProcessHeat.*s.ghgEFHeat(time,:);
s.ghgTransport22(time,:) = (s.ghgTransp2DistFull.*s.ghgTranspDieselFull+s.ghgTransp2DistEmpty.*s.ghgTranspDieselEmpty).*s.ghgEFDiesel(time)./s.ghgTranspAmount;
s.ghgTransport2(time,:) = s.ghgTransport21(time,:)+s.ghgTransport22(time,:);
s.P1toGJfactor(time,:) = s.ghgP1AllocationFactor.*s.ghgP2AllocationFactor...
./(s.feedFMenergyContent.*s.plantConvEta(time,:));
s.P2toGJfactor(time,:) = s.ghgP2AllocationFactor./(s.feedFMenergyContent.*s.plantConvEta(time,:));
s.ghgCultivationTotGJ(time,:) = zeros(1,s.numTech);%s.ghgCultivationTotHa(time,:).*s.hatoGJfactor(time,:);
s.ghgTransport1GJ(time,:) = zeros(1,s.numTech);%s.ghgTransport1(time,:).*s.P1toGJfactor(time,:);
%%
s.ghgP1totGJ(time,:) = s.ghgP1tot(time,:).*s.P1toGJfactor(time,:);
s.ghgP2totGJ(time,:) = s.ghgP2tot(time,:).*s.P2toGJfactor(time,:);
s.ghgP2ByprodGJ(time,:) = -s.ghgP2Byprod(time,:)./(s.feedFMenergyContent.*s.plantConvEta(time,:));
s.ghgTransport2GJ(time,:) = s.ghgTransport2(time,:);%./(s.feedFMenergyContent.*s.plantConvEta(time,:));
%kgCo2eq/GJ
s.fuelGHGemission(time,:) = s.ghgCultivationTotGJ(time,:)+s.ghgTransport1GJ(time,:)+s.ghgP1totGJ(time,:)+s.ghgP2totGJ(time,:)+s.ghgP2ByprodGJ(time,:)+s.ghgTransport2GJ(time,:);
s.ghgHeatTotGJ(time,:) = s.ghgP1Heat(time,:).*s.ghgEFHeat(time,:).*s.P1toGJfactor(time,:)...
+ s.ghgP2Heat(time,:).*s.ghgEFHeat(time,:).*s.P2toGJfactor(time,:)...
+ s.ghgTranspProcessHeat.*s.ghgEFHeat(time,:);
s.ghgPowerTotGJ(time,:) = s.ghgP1Power(time,:).*s.ghgEFPower(time).*s.P1toGJfactor(time,:)...
+ s.ghgP2Power(time,:).*s.ghgEFPower(time).*s.P2toGJfactor(time,:)...
+ s.ghgTranspGasGridPower.*s.ghgEFPower(time);
s.ghgDieselTotGJ(time,:) = s.ghgTransport22(time,:);
s.ghgSoilN2OTotGJ(time,:) = zeros(1,s.numTech);
s.ghgFertilizerTotGJ(time,:) = zeros(1,s.numTech);
s.ghg2ndFeedTotGJ(time,:) = s.ghgP2CH3OH(time,:).*s.ghgEFCH3OH(time).*s.P2toGJfactor(time,:);
s.ghgOtherTotGJ(time,:) = zeros(1,s.numTech);
s.fuelGHGabatement(time,:) = s.referenceGHGemission-s.fuelGHGemission(time,:); %% %kgCo2eq/GJ - Positive number
end
\ No newline at end of file
......@@ -17,14 +17,16 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Plotting for Monte Carlo
%
function mCplot(iter,x,y,xlab,ylab,m,n,p,type)
sz = 2;
c = 'black';%linspace(1,10,length(y))
% figure()
c = 'black';
subplot(m,n,p)
% for simNum=1:iter
if contains(type,'scatter')
scatter(x,y,sz,c,'filled')
% lsline
......@@ -48,4 +50,3 @@ subplot(m,n,p)
ylabel(ylab)
xlabel(xlab)
end
% end
......@@ -17,6 +17,9 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Start function for the model
%
clearvars;
close all;
......
......@@ -17,6 +17,9 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Merit order plotting
%
function meritOrderPlot(prod,cost,legendNames,col,year,scenario,xlab,ylab,tit,yMax,xMax,fileName)
%% Creates a sorted merit order rectangle plot
......
......@@ -17,6 +17,9 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Monte carlo sensitivity analysis with optional parallel computing
%
function [mcVar,weatherYear,H2,runTimeGAMS,timeSteps,EVfactor,dRate,CO2source,H2max,landMax,CO2Use] = monteCarlo(iter,s,f,g,biofuelsDataIn,powerDataIn)
......
This diff is collapsed.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BENOPT (BioENergy OPTimisation model)
% Copyright (C) 2012-2020 Markus Millinger
% Copyright (C) 2012-2020 Markus Millinger, Philip Tafarte
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -17,6 +17,8 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Scaling of capacity factor of solar PV and on- and offshore wind
function [genDataScaled,capFacInst] = scalingCapFacVRE(capData,genData,capFac)
......
......@@ -17,7 +17,9 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%Setting the color scheme
%
function col = setCol
col = [2,175,198;...
......
......@@ -17,7 +17,9 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Function for setting the data
%
function [f,g,s] = setData(techData)
......
......@@ -17,7 +17,9 @@
%
% Contact: markus.millinger@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Function for adapting excess electricity to a lower temporal resolution
%
function [surplusPowerVar,surplusPowerVar2,posResLoadVar,resLoadDataHour] = surplusPower(g,s,residualLoad,powerYear)
......
......@@ -16,6 +16,9 @@
%
% Contact: philip.tafarte@ufz.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Function for variable renewable electricity generation including power storage
%
function [residualLoad,powerYear,RENsharedynstorage,RENshare100] = vrePower(powerData,onshore,offshore,photoV,demandIn,MustRun,RENMustRun,powerStorage,powerStorageMax)
for i=1:7
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment