The UFZ services GitLab and Mattermost will be unavailable on Monday, July 4 from 06:00 AM to 08:00 AM due to maintenance work.

Commit 7ca8a6f3 authored by Markus Millinger's avatar Markus Millinger
Browse files

Moved data from different sheets to countryData to slim the Excel file, and...

Moved data from different sheets to countryData to slim the Excel file, and adapted the data reading
parent c84f7ea8
No preview for this file type
......@@ -54,24 +54,42 @@ for scenario = 1:noScenarios
clear s;
%Set some dimensions
s.numSectors = 11;
f.numResidue = 12;
s.weatherYear = {'2018'};
s.numTech = size(techData.data.techInputData(1,:),2);
s.numSectors = 11;
f.numResidue = 12;
f.numCrop = size(techData.data.feedstockInputData(1,1:end),2);
%Some general variables
s.inflation = 0;
s.plantPayBackTime = 20;
s.dieselCostStart = 0.9; %/l
s.referenceGHGemission = 94.1; %kgCO2/GJ
s.priceDevFactor = 0.04; % frac/a
f.wheatPriceStart = 189;% %/tFM
f.rapeSeedPriceStart = 381;% %/tFM
s.runTime = 2051-2020;
%How many time steps within each year - up to 8760 possible (heavy on run-time)
g.timeStepsIntraYear = 1:50;
%Set country specific data
countryID = 'SE';
countryID = 'DE';
s.weatherYear = {'2018'};
% powerDataCountry = ...
% powerData(contains(powerData.cet_cest_timestamp,s.weatherYear),...
% contains(powerData.Properties.VariableNames,countryID));
% save(['../data/powerData' countryID '.mat'],'powerDataCountry'); %Save to .mat-file - comment out if the .mat-file is up to date
powerDataCountry = ...
powerDataCountry = ...
importdata(['../data/powerData' countryID '.mat']); %reads data from .mat file
[f,g,s] = ...
setCountryData(techData,countryID,powerDataCountry,s,f); %Set country specific data
[f,g,s] = ...
setCountryData(techData,countryID,powerDataCountry,s,f,g); %Set country specific data
%Set variables
[f,g,s] = setData(techData,f,g,s);
[f,g,s] = setData(techData,f,g,s);
%% Monte Carlo sensitivity analysis example of VRE module
% monteCarlo(1000,s,f,g,techData);
......
......@@ -21,7 +21,7 @@
% Function for setting the country specific data
%
function [f,g,s] = setCountryData(techData,countryID,powerDataCountry,s,f)
function [f,g,s] = setCountryData(techData,countryID,powerDataCountry,s,f,g)
s.countryNames = techData.textdata.countryData(1,3:end);
indexCountry = find(contains(s.countryNames,{countryID}));
......@@ -62,14 +62,30 @@ s.EVstart = techData.data.countryData(45,indexCountry).*10^6
g.demandStart = techData.data.countryData(51:51+s.numSectors-1,indexCountry);
g.demandEnd = techData.data.countryData(71:71+s.numSectors-1,indexCountry);
%Power price & heat price for required input
for i=1:3
s.powerPrice(i,:) = linspace(techData.data.countryData(99+i,indexCountry),techData.data.countryData(106+i,indexCountry),s.runTime).*10^3.*10^-2'; %[ct/kWh -> /MWh]
end
s.heatPrice = linspace(techData.data.countryData(103,indexCountry),techData.data.countryData(109,indexCountry),s.runTime).*10^3.*10^-2; %[ct/kWh -> /MWh]
s.plantCap = techData.data.techInputData(198+indexCountry,1:end);%*10^6;
f.cropYieldFMlow = techData.data.feedstockInputData(40+indexCountry,1:end); %GJ/tFM
f.cropYieldFMhigh = techData.data.feedstockInputData(70+indexCountry,1:end); %GJ/tFM
f.cropLandUseInit = techData.data.feedstockInputData(100+indexCountry,1:end); % [ha]
f.resPot = techData.data.biomassResPot(1:f.numResidue,indexCountry);
s.ghgEFPowerData = techData.data.powerEmissions(1+indexCountry,[2017 2018 2030 2050]-2016); %kgCO2eq/kWh interp1([2015 2020 2025 2030 2035 2040 2045 2050],co2sourceData,2020:1:2050,'linear');
% Residue potential data [PJ_feed]
f.resPot = techData.data.countryData(120:120+f.numResidue-1,indexCountry).*ones(1,s.runTime); %PJ_feed
f.resPotImport = ...
techData.data.countryData(140:140+f.numResidue+f.numCrop-1,indexCountry).*ones(1,s.runTime);
% Residue price start [/GJ]
f.resPriceIniMin = techData.data.countryData(170:170+f.numResidue-1,indexCountry);
f.resPriceIniMax = techData.data.countryData(190:190+f.numResidue-1,indexCountry);
g.resImportMax = techData.data.countryData(202,indexCountry).*ones(1,s.runTime);
s.ghgEFPowerData = techData.data.countryData(210:213,indexCountry)'; %kgCO2eq/kWh
s.powerLoad = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_load_actual_entsoe_power_statistics']))};
s.PVcap = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_solar_cap']))};
......
......@@ -24,7 +24,6 @@
function [f,g,s] = setData(techData,f,g,s)
%Technology variables
s.numTech = size(techData.data.techInputData(1,:),2);
s.techNames = techData.textdata.techInputData(2,3:end);
s.techNamesLegend = s.techNames;
......@@ -36,8 +35,7 @@ s.sectorNamesLegend = s.sectorNames;
s.fuelNames = techData.textdata.techInputData(136:142,2)';
%Feedstock variables
f.residueNames = techData.textdata.biomassResPot(2:f.numResidue+1,1)';
f.numCrop = size(techData.data.feedstockInputData(1,1:end),2);
f.residueNames = techData.textdata.countryData(121:121+f.numResidue-1,1)';
f.cropNames = techData.textdata.feedstockInputData(1,3:f.numCrop+2);
f.cat = 3; %For dividing e.g. biomass types into 3 equal shares with different prices
f.numPowerSource = 2;
......@@ -46,24 +44,12 @@ f.feedNames = [f.cropNames f.residueNames f.powerNames];
%% Definition of Input Data s= Technology specific f=feedstock specific
%General variables
s.inflation = 0;
s.plantPayBackTime = 20;
s.dieselCostStart = 0.9; %/l
s.referenceGHGemission = 94.1; %kgCO2/GJ
f.wheatPriceStart = 189;% %/tFM
f.rapeSeedPriceStart = 381;% %/tFM
s.runTime = 2051-2020;
f.runTime = s.runTime;
s.year = linspace(2020,2050,s.runTime);
s.hourYear = linspace(1,8760,8760);
s.dayYear = linspace(1,365,365);
%% Set parameters for power sector
%How many time steps within each year - up to 8760 possible (heavy on run-time)
g.timeStepsIntraYear = 1:50;
%Onshore wind capacity [GW] from start year to end year in 5-year steps
s.onShore = round(linspace(s.windOnShoreInit,s.windOnShoreEnd,7));
......@@ -99,7 +85,6 @@ for i=1:7
end
%Set parameters for crops
s.priceDevFactor = 0.04; % frac/a
g.landMax = 10^6.*linspace(g.landUseInit,g.landUseEnd,s.runTime); %ha
%Set restrictions for fuel types in sectors
......@@ -133,13 +118,13 @@ for j=1:s.numSectors
interp1([2020 2050],[g.demandStart(j) g.demandEnd(j)],2020:1:2050,'linear');
end
%% System data
%Power price & heat price for required input
s.powerPrice = 10^3.*10^-2.*techData.data.demandData(10:12,1:s.runTime);%[/MWh]
s.powerPriceDevNormed = techData.data.demandData(8,1:s.runTime);%[/MWh]
s.heatPrice = 10^3.*10^-2.*techData.data.demandData(15,1:s.runTime)';%[/MWh]
% %% System data
% %Power price & heat price for required input
% s.powerPrice = 10^3.*10^-2.*techData.data.demandData(10:12,1:s.runTime);%[/MWh]
% % s.powerPriceDevNormed = techData.data.demandData(8,1:s.runTime);%[/MWh]
% s.heatPrice = 10^3.*10^-2.*techData.data.demandData(15,1:s.runTime)';%[/MWh]
%- for process heat, see feedCost function. Possibly differentiate input and output heat price - district heating could be output heat price reference
s.GHGabateTarget = 160*10^9*linspace(0.05,0.08,s.runTime); %kgCO2eq/a
% s.GHGabateTarget = 160*10^9*linspace(0.05,0.08,s.runTime); %kgCO2eq/a
%% Definition of technology data / Life Time
% Technology Lifetime (tech) [a]
......@@ -233,19 +218,6 @@ f.cropMachineVarHa = techData.data.feedstockInputData(9,1:f.numCrop);
f.cropServiceCostsHa = techData.data.feedstockInputData(10,1:f.numCrop);
f.cropDirectCostsHa = techData.data.feedstockInputData(11,1:f.numCrop);
% Residue potential data [PJ_feed]
f.resPot = f.resPot.*ones(1,s.runTime);
f.resPotImport = ...
techData.data.biomassResPot(30:30+f.numResidue+f.numCrop-1,1:s.runTime);
% Residue price start [/GJ]
f.resPriceIniMin = techData.data.biomassResPot(16:16+f.numResidue,1);
f.resPriceIniMax = techData.data.biomassResPot(16:16+f.numResidue,2);
g.resImportMaxIn = techData.data.biomassResPot(59,[1 4 14 24 34]);
g.resImportMax = ...
interp1([2017 2020 2030 2040 2050],g.resImportMaxIn,2020:1:2050,'linear');
%% Definition of technology data
......
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