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

Commit 065c10ef authored by Markus Millinger's avatar Markus Millinger
Browse files

Included safety valve for lacking capacity and generation input data

parent ce0ca7f8
......@@ -59,7 +59,7 @@ for scenario = 1:noScenarios
s.weatherYear = {'2018'};
%Set country specific data
countryID = 'DE';
countryID = 'SE';
% powerDataCountry = ...
% powerData(contains(powerData.cet_cest_timestamp,s.weatherYear),...
% contains(powerData.Properties.VariableNames,countryID));
......
......@@ -22,6 +22,10 @@
function [genDataScaled,capFacInst] = scalingCapFacVRE(capData,genData,capFac)
if capData==0 %to avoid division by zero
capData=0.00001*ones(8760,1);
end
ScaleFactor = 1;
capFacVar = sum(genData./capData)/length(genData);
capFacInst = genData./capData;
......@@ -29,13 +33,10 @@ capFacInst = genData./capData;
while capFacVar < capFac
index = capFacInst<1;
genData(index) = min(genData(index).*ScaleFactor,capData(index));
% genData(~index) = capData(~index);
ScaleFactor = ScaleFactor+0.001;
capFacInst = genData./capData;
capFacVar = sum(genData./capData)/length(genData);
end
% capFacVar/capFac;
genDataScaled = genData;
% ScaleFactor;
end
\ No newline at end of file
......@@ -28,14 +28,6 @@ indexCountry = find(contains(s.countryNames,{countryID}));
s.discountRateInvest = techData.data.countryData(1,indexCountry);
s.labourCostStart = techData.data.countryData(2,indexCountry); %/h
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']))};
s.PVgen = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_solar_gen']))};
s.WindOnCap = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_onshore_cap']))};
s.WindOnGen = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_onshore_gen']))};
s.WindOffCap = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_offshore_cap']))};
s.WindOffGen = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_offshore_gen']))};
s.windOnShoreInit = techData.data.countryData(11,indexCountry);
s.windOnShoreEnd = techData.data.countryData(12,indexCountry);
s.windOffShoreInit = techData.data.countryData(13,indexCountry);
......@@ -79,6 +71,26 @@ f.resPot = techData.data.biomassResPot(1:f.numResidue,index
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');
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']))};
if isempty(s.PVcap)==1 %if the data does not exist for the country/year, use the given initial capacity as approximation (the set weather year should not be too far off the capacity year for this to work properly)
s.PVcap = s.solarPVInit.*ones(8760,1);
end
s.PVgen = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_solar_gen']))};
s.WindOnCap = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_onshore_cap']))};
if isempty(s.WindOnCap)==1
s.WindOnCap = s.windOnShoreInit.*ones(8760,1);
end
s.WindOnGen = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_onshore_gen']))};
s.WindOffCap = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_offshore_cap']))};
if isempty(s.WindOffCap)==1
s.WindOffCap = s.windOffShoreInit.*ones(8760,1);
end
s.WindOffGen = powerDataCountry{:,contains(powerDataCountry.Properties.VariableNames,join([countryID,'_wind_offshore_gen']))};
if isempty(s.WindOffGen)==1
s.WindOffGen = 10^-6*ones(8760,1);
end
%The number of historic passenger vehicles in each fuel type
%(Diesel,Hybrid (excl. Plug-in-hybrid),Plug-in-Hybrid,Battery electric/Fuel
%cell,Natural gas (incl. LPG),Flex-Fuel,Petrol)
......
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