Commit 3b20b091 authored by Gerrit Erichsen's avatar Gerrit Erichsen
Browse files

Merge branch 'master' of https://collaborating.tuhh.de/iet/CharL

parents 359e281d 2c05373a
......@@ -90,12 +90,17 @@ double Biomass::getInvestCost() const
return m_nominalPower * m_specificInvestCost;
}
double Biomass::getAnnuityCost() const
{
return this->getInvestCost() * m_preferences->getAnnuityFactor(m_lifeTime);
}
double Biomass::getFixedOperationalCost() const
{
return 0.01 * m_specificFixedOperationalCost * getInvestCost();
}
double Biomass::getOperationalCost() const
double Biomass::getTotalOperationalCost() const
{
double totalOperationalCost = 0.;
for (int i = 0; i < m_load.size(); i++)
......
......@@ -42,8 +42,9 @@ public:
double getTotalCO2Seperated() const;
double getFullLoadHours() const;
double getInvestCost() const;
double getAnnuityCost() const;
double getFixedOperationalCost() const;
double getOperationalCost() const;
double getTotalOperationalCost() const;
//other
void clearResults();
......@@ -54,6 +55,7 @@ private:
double m_specificInvestCost; // Specific cost of plant in €/MW
double m_specificFixedOperationalCost; // Specific cost of O&M as usually fix part in relation to invest cost in %
double m_specificOperationalCost; // Specific O&M cost in €/MWh
int m_lifeTime; // life time; in a
// RESULTS //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
vector<double> m_load; //load that was produced in MW
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,12 +6,9 @@
#include <cmath>
#include <ctime>
//folgendes wieder Löschen
#include <QFile>
#include <QString>
#include <QStringList>
#include <QDebug>
//ende:folgendes wieder Löschen
#ifdef HAS_OPTIMIZATION
#include "OptimisationSchedule.h"
#endif
#include "InternalResult.h"
......@@ -53,37 +50,37 @@ void CharLAlgorithm::setPreferences(int nTimeSteps, double stepTime, int levelOf
useLastValueWhenConst, createForecast,
reworkOperationPlan, forecastType, foreCastIntervall,
foreCastPeriod, optimiserGap, optimiserTimeLimit,
storageLevelCurve, interestRate, deprecationPeriod,
storageLevelCurve, interestRate,
co2Costs, curtailmentCosts, optimiserTargetWeight,
optimization, fi);
}
void CharLAlgorithm::transferDemandData(int network, const vector<float> * powerDemand)
void CharLAlgorithm::transferDemandData(size_t node, const vector<float> * powerDemand)
{
if (network < m_networks.size() && network >= 0)
if (node < m_networks.size())
{
m_networks[network]->setPowerDemand(powerDemand);
m_networks[node]->setPowerDemand(powerDemand);
}
}
void CharLAlgorithm::transferDemandForecastData(int network,
void CharLAlgorithm::transferDemandForecastData(size_t node,
const vector<vector<float> > * powerDemand)
{
if (network < m_networks.size() && network >= 0)
if (node < m_networks.size())
{
m_networks[network]->setPowerDemandForecast(powerDemand);
m_networks[node]->setPowerDemandForecast(powerDemand);
}
}
void CharLAlgorithm::transferReactiveDemandData(int network, vector<float> reactivePowerDemand) //dv
void CharLAlgorithm::transferReactiveDemandData(size_t node, vector<float> reactivePowerDemand) //dv
{
if (network < m_networks.size() && network >= 0)
if (node < m_networks.size())
{
m_networks[network]->setReactivePowerDemand(reactivePowerDemand);
m_networks[node]->setReactivePowerDemand(reactivePowerDemand);
}
}
void CharLAlgorithm::transferPowerDemandToReactiveDemanddata(int network, vector<float> powerDemand)
void CharLAlgorithm::transferPowerDemandToReactiveDemanddata(size_t node, vector<float> powerDemand)
{
double PI = 3.14159265;
double fi = m_preferences->fi();
......@@ -95,9 +92,9 @@ void CharLAlgorithm::transferPowerDemandToReactiveDemanddata(int network, vector
}
if (network < m_networks.size() && network >= 0)
if (node < m_networks.size())
{
m_networks[network]->setReactivePowerDemand(powerDemand);
m_networks[node]->setReactivePowerDemand(powerDemand);
}
}
......@@ -253,21 +250,31 @@ void CharLAlgorithm::transferGridConfiguration(vector<vector<double> > lineCapac
m_grid = new Grid(lineCapacities, lineImpedances, lineInducitivity, m_networks, m_preferences);
}
int CharLAlgorithm::createNetwork(string name)
int CharLAlgorithm::createNode(string name)
{
m_networks.push_back(new Network(name, m_preferences));
return int(m_networks.size()) - 1;
}
void CharLAlgorithm::addConventionalPlant(int network, string name, double gradient, double nominalPower,
double co2, double actualCO2,
size_t CharLAlgorithm::createLocation(size_t node, string name, double lat, double lon, double areaSolar, double areaWind)
{
// hint: no consistency check (node availability)!
// create location
Location location(name, lat, lon, areaSolar, areaWind, m_preferences);
return m_networks[node]->addLocation(location);
}
void CharLAlgorithm::addConventionalPlant(size_t network, size_t location, string name, double gradient,
double nominalPower, double co2, double actualCO2,
vector<pair<double,double>> efficiencyCurve,
double timeCold, double timeWarm, double timeHot,
double minDownTime, double minUpTime,
double fuelCost, double investCost,
double fixedOM_Cost, double specOM_Cost,
double hotStartCost, double warmStartCost, double coldStartCost,
double hotStartEmissions, double warmStartEmissions, double coldStartEmissions)
double hotStartEmissions, double warmStartEmissions, double coldStartEmissions,
double temperatureCoefficient, string fuelType, int lifeTime) // bw: added from GUI
{
if (network < m_networks.size() && network >= 0)
{
......@@ -275,23 +282,26 @@ void CharLAlgorithm::addConventionalPlant(int network, string name, double gradi
timeCold, timeWarm, timeHot, minDownTime, minUpTime,
fuelCost, investCost, fixedOM_Cost, specOM_Cost,
hotStartCost, warmStartCost, coldStartCost,
hotStartEmissions, warmStartEmissions, coldStartEmissions, m_preferences);
hotStartEmissions, warmStartEmissions, coldStartEmissions,
temperatureCoefficient, fuelType, lifeTime, m_preferences); // bw: added from GUI
m_networks[network]->addConventionalPlant(dummy);
}
}
void CharLAlgorithm::addStoragePlant(size_t network, string name, double nominalPower, double capacity,
void CharLAlgorithm::addStoragePlant(size_t network, size_t location, string name,
double nominalPower, double capacity,
double gradientCharge, double gradientDischarge,
const EfficiencyField & efficiencyCharge, const EfficiencyField & efficiencyDischarge,
vector<pair<double, double>> selfDischarge,
const EfficiencyField &efficiencyCharge, const EfficiencyField &efficiencyDischarge,
vector<pair<double, double> > selfDischarge,
double startTimeHotCharge, double startTimeWarmCharge, double startTimeColdCharge,
double startTimeHotDischarge, double startTimeWarmDischarge, double startTimeColdDischarge,
double minDownTimeCharge, double minUpTimeCharge,
double minDownTimeDischarge, double minUpTimeDischarge,
double investCostPower, double investCostCapacity,
double fixedOM_Cost, double specOM_Cost,
double startCostHotCharge, double startCostWarmCharge, double startCostColdCharge,
double startCostHotDischarge, double startCostWarmDischarge, double startCostColdDischarge)
double investCostPowerCharge, double investCostPowerDischarge, double investCostCapacity,
double fixedOMCostCharge, double fixedOMCostDischarge, double specOMCostCharge,
double specOMCostDischarge, double startCostHotCharge, double startCostWarmCharge, double startCostColdCharge,
double startCostHotDischarge, double startCostWarmDischarge, double startCostColdDischarge,
int lifeTimeCharge, int lifeTimeDischarge, double typicalUnitSizeCharge, double typicalUnitSizeDischarge) // bw: added from GUI
{
if (network < m_networks.size())
{
......@@ -300,49 +310,70 @@ void CharLAlgorithm::addStoragePlant(size_t network, string name, double nominal
startTimeHotCharge, startTimeWarmCharge, startTimeColdCharge,
startTimeHotDischarge, startTimeWarmDischarge, startTimeColdDischarge,
minDownTimeCharge, minUpTimeCharge, minDownTimeDischarge, minUpTimeDischarge,
investCostPower, investCostCapacity, fixedOM_Cost, specOM_Cost,
investCostPowerCharge, investCostPowerDischarge, investCostCapacity, fixedOMCostCharge,
fixedOMCostDischarge, specOMCostCharge, specOMCostDischarge,
startCostHotCharge, startCostWarmCharge, startCostColdCharge,
startCostHotDischarge, startCostWarmDischarge, startCostColdDischarge,
m_preferences);
lifeTimeCharge, lifeTimeDischarge, typicalUnitSizeCharge, typicalUnitSizeDischarge,
m_preferences); // bw: added from GUI
m_networks[network]->addStoragePlant(dummy);
}
}
void CharLAlgorithm::addPvPlant(int network, string name, double areaPVModule, double pMPP, double nominalPowerOfPark, double tilt, double azimuth,
double groundCoverageRatio, double temperatureCoefficientInPercentPerK, vector<pair<double,double>> efficiencyCurveInverter,
vector<pair<double,double>> efficiencyCurvePVIrr, double investCost, double fixedOM_Cost)
void CharLAlgorithm::addPvPlant(size_t network, size_t location, string name, double installedPower,
double dcToAcRatio, double area, double temperatureLossCoefficient,
double modulePeakPower, double mppVoltage,
double ocVoltage, double scCurrent, double moduleLengthLongSide,
double moduleLengthShortSide,
const vector<pair<double,double>> & moduleEfficiency,
bool arePortraitOriented, double tiltInDeg, double azimuthInDeg,
double groundCoverageRatio,
const vector<pair<double,double>> & inverterEfficiency,
double specificInvestCost, double specificFixOaMcost, int lifeTime)
{
Solar dummy;
Solar dummy(name, installedPower, dcToAcRatio, area, temperatureLossCoefficient, modulePeakPower, mppVoltage,
ocVoltage, scCurrent, moduleLengthLongSide, moduleLengthShortSide,
moduleEfficiency, arePortraitOriented, tiltInDeg,
azimuthInDeg, groundCoverageRatio, inverterEfficiency,
specificInvestCost, specificFixOaMcost, lifeTime,
m_networks.at(network)->getLocationPtr(location), m_preferences);
m_networks[network]->addSolarPlant(dummy);
}
void CharLAlgorithm::addWindPark(int network, string name, double nominalPowerOfPark, double hubHeight, double rotorDiameter, double areaOfPark, vector<pair<double,double>> powerCurve, vector<pair<double, double> > ctCurve, double investCost, double fixedOM_Cost, double specOM_Cost)
void CharLAlgorithm::addWindPark(size_t network, size_t location, string name,
double nominalPowerOfPark, double hubHeight, double rotorDiameter,
double areaOfPark, vector<pair<double,double>> powerCurve,
vector<pair<double, double> > ctCurve, double investCost,
double fixedOM_Cost, double specOM_Cost, int lifeTime)
{
if (network < m_networks.size() && network >= 0)
if (network < m_networks.size())
{
Wind dummy(name, nominalPowerOfPark, hubHeight, rotorDiameter, areaOfPark, powerCurve, ctCurve, investCost, fixedOM_Cost, specOM_Cost, m_preferences);
Wind dummy(name, nominalPowerOfPark, hubHeight, rotorDiameter, areaOfPark,
powerCurve, ctCurve, investCost, fixedOM_Cost, specOM_Cost, lifeTime,
m_networks.at(network)->getLocationPtr(location), m_preferences);
m_networks[network]->addWindPlant(dummy);
}
}
void CharLAlgorithm::setGenericWindCapacity(int network, double capacity)
void CharLAlgorithm::setGenericWindCapacity(size_t node, double capacity)
{
if (network < m_networks.size() && network >= 0)
if (node < m_networks.size())
{
m_networks[network]->setGenericWindCapacity(capacity);
m_networks[node]->setGenericWindCapacity(capacity);
}
}
void CharLAlgorithm::setGenericSolarCapacity(int network, double capacity)
void CharLAlgorithm::setGenericSolarCapacity(size_t node, double capacity)
{
if (network < m_networks.size() && network >= 0)
if (node < m_networks.size())
{
m_networks[network]->setGenericSolarCapacity(capacity);
m_networks[node]->setGenericSolarCapacity(capacity);
}
}
void CharLAlgorithm::run()
{
#ifdef HAS_OPTIMIZATION
//tz - total optimisations in rooling horizon
m_optimisationLoopTotal = m_preferences->getNumberOfTimeSteps() / m_preferences->getNumberOfStepsForeCastPeriod();
......@@ -352,6 +383,7 @@ void CharLAlgorithm::run()
{
m_optimisationLoopTotal++;
}
#endif
//******************************************
if (m_preferences->doCalculatePowerFlow())
......@@ -364,6 +396,7 @@ void CharLAlgorithm::run()
for (int i = 0; i < m_preferences->getNumberOfTimeSteps(); i++)
{
#ifdef HAS_OPTIMIZATION
//tz - optimize forecast if sep is start of interval
if (i == (m_optimisationLoopCounter * m_preferences->getNumberOfStepsForeCastPeriod())
&& m_preferences->createOperationPlan() == true
......@@ -376,9 +409,9 @@ void CharLAlgorithm::run()
{
nStepsInterval = m_preferences->getNumberOfTimeSteps() - m_optimisationLoopCounter * m_preferences->getNumberOfStepsForeCastPeriod();
}
qDebug() << "CHARL: ### OptimisationLoop #" << m_optimisationLoopCounter + 1 << "-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|";
optimizeForecast(nStepsInterval);
}
#endif
//calculateStoragePower(i);
calculateVolatile(i);
......@@ -414,7 +447,6 @@ void CharLAlgorithm::run()
m_networks[j]->restart();
}
i = -1;
qDebug() << "->->->->->->->->->->Restart<-<-<-<-<-<-<-<-<-<-<-";
cout << "->->->->->->->->->->Restart<-<-<-<-<-<-<-<-<-<-<-";
}
}
......@@ -628,7 +660,7 @@ void CharLAlgorithm::calculateGrid(int step) //dv
}
clock_t end = clock();
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
qDebug() << "Elapsed: " << elapsed_secs;
cout << "Elapsed: " << elapsed_secs;
for (int i = 0; i < m_networks.size(); i++)
{
......
......@@ -27,7 +27,6 @@
#include "Network.h"
#include "Result.h"
#include "SimulationPreferences.h"
#include "OptimisationSchedule.h"
#include "Grid.h"
#include "EfficiencyField.h"
......@@ -46,12 +45,12 @@ public:
int foreCastPeriod, double optimiserGap, double optimiserTimeLimit, vector<double> storageLevelCurve,
double interestRate, int deprecationPeriod, double co2Costs, double curtailmentCosts, double optimiserTargetWeight, bool optimization, double fi);
void transferDemandData(int network,
void transferDemandData(size_t node,
const vector<float> * powerDemand);
void transferDemandForecastData(int network,
void transferDemandForecastData(size_t node,
const vector<vector<float>> * powerDemand);
void transferReactiveDemandData(int network, vector<float> reactivePowerDemand); //dv
void transferPowerDemandToReactiveDemanddata(int network, vector<float> powerDemand); //dv
void transferReactiveDemandData(size_t node, vector<float> reactivePowerDemand); //dv
void transferPowerDemandToReactiveDemanddata(size_t node, vector<float> powerDemand); //dv
void transferWindData(int node,
const vector<float> * windData);
......@@ -90,8 +89,9 @@ public:
const vector<vector<float>> * temperatures);
void transferGridConfiguration(vector<vector<double>> lineCapacities, vector<vector<double>> lineImpedances, vector<vector<double>> lineInducitivity);
int createNetwork(string name);
void addConventionalPlant(int network, string name,
int createNode(string name); // former network
size_t createLocation(size_t node, string name, double lat , double lon, double areaSolar, double areaWind); // local in node
void addConventionalPlant(size_t network, size_t location, string name,
double gradient, double nominalPower,
double co2, double actualCO2,
vector<pair<double, double> > efficiencyCurve,
......@@ -99,8 +99,9 @@ public:
double minDownTime, double minUpTime,
double fuelCost, double investCost, double fixedOM_Cost, double specOM_Cost,
double hotStartCost, double warmStartCost, double coldStartCost,
double hotStartEmissions, double warmStartEmissions, double coldStartEmissions);
void addStoragePlant(size_t network, string name,
double hotStartEmissions, double warmStartEmissions, double coldStartEmissions,
double temperatureCoefficient, string fuelType, int lifeTime);
void addStoragePlant(size_t network, size_t location, string name,
double nominalPower, double capacity,
double gradientCharge, double gradientDischarge,
const EfficiencyField &efficiencyCharge, const EfficiencyField &efficiencyDischarge,
......@@ -109,15 +110,23 @@ public:
double startTimeHotDischarge, double startTimeWarmDischarge, double startTimeColdDischarge,
double minDownTimeCharge, double minUpTimeCharge,
double minDownTimeDischarge, double minUpTimeDischarge,
double investCostPower, double investCostCapacity, double fixedOM_Cost, double specOM_Cost,
double startCostHotCharge, double startCostWarmCharge, double startCostColdCharge,
double startCostHotDischarge, double startCostWarmDischarge, double startCostColdDischarge);
void addPvPlant(int network, string name, double areaPVModule, double pMPP, double nominalPowerOfPark, double tilt, double azimuth, double groundCoverageRatio, double temperatureCoefficientInPercentPerK, vector<pair<double,double>> efficiencyCurveInverter,
vector<pair<double,double>> efficiencyCurvePVIrr, double investCost, double fixedOM_Cost);
void addWindPark(int network, string name, double nominalPowerOfPark, double hubHeight, double rotorDiameter, double areaOfPark, vector<pair<double, double> > powerCurve,
vector<pair<double, double> > ctCurve, double investCost, double fixedOM_Cost, double specOM_Cost);
void setGenericWindCapacity(int network, double capacity);
void setGenericSolarCapacity(int network, double capacity);
double investCostPowerCharge, double investCostPowerDischarge, double investCostCapacity,
double fixedOMCostCharge, double fixedOMCostDischarge, double specOMCostCharge,
double specOMCostDischarge, double startCostHotCharge, double startCostWarmCharge, double startCostColdCharge,
double startCostHotDischarge, double startCostWarmDischarge, double startCostColdDischarge,
int lifeTimeCharge, int lifeTimeDischarge, double typicalUnitSizeCharge, double typicalUnitSizeDischarge);
void addPvPlant(size_t network, size_t location, string name, double installedPower, double dcToAcRatio, double area,
double temperatureLossCoefficient, double modulePeakPower, double mppVoltage,
double ocVoltage, double scCurrent, double moduleLengthLongSide, double moduleLengthShortSide,
const vector<pair<double, double> > &moduleEfficiency, bool arePortraitOriented, double tiltInDeg,
double azimuthInDeg, double groundCoverageRatio, const vector<pair<double, double> > &inverterEfficiency,
double specificInvestCost, double specificFixOaMcost, int lifeTime);
void addWindPark(size_t network, size_t location, string name, double nominalPowerOfPark, double hubHeight,
double rotorDiameter, double areaOfPark, vector<pair<double, double> > powerCurve,
vector<pair<double, double> > ctCurve, double investCost, double fixedOM_Cost,
double specOM_Cost, int lifeTime);
void setGenericWindCapacity(size_t node, double capacity);
void setGenericSolarCapacity(size_t node, double capacity);
//void getNextX(int step); //dv
......
......@@ -10,12 +10,9 @@ QT -= gui
TARGET = CharLAlgorithm
TEMPLATE = lib
CONFIG += USE_CPLEX
#CONFIG += USE_GUROBI
include($$PWD/../common.pri)
DEFINES += CHARLALGORITHM_LIBRARY
DEFINES += HAS_CPLEX
#DEFINES += HAS_GUROBI
SOURCES += CharLAlgorithm.cpp \
EfficiencyField.cpp \
......@@ -59,44 +56,46 @@ unix {
INSTALLS += target
}
#CoinUtils
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/release/ -lCoinUtils
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/debug/ -lCoinUtils
else:unix: LIBS += -L$$PWD/../../libs/CoinUtils/ -lCoinUtils
INCLUDEPATH += $$PWD/../../libs/src/CoinUtils
DEPENDPATH += $$PWD/../../libs/src/CoinUtils
USE_OPTIMIZATION{
#CoinUtils
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/release/ -lCoinUtils
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/CoinUtils/debug/ -lCoinUtils
else:unix: LIBS += -L$$PWD/../../libs/CoinUtils/ -lCoinUtils
INCLUDEPATH += $$PWD/../../libs/src/CoinUtils
DEPENDPATH += $$PWD/../../libs/src/CoinUtils
#Osi
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/Osi/release/ -lOsi
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/Osi/debug/ -lOsi
else:unix: LIBS += -L$$PWD/../../libs/Osi/ -lOsi
INCLUDEPATH += $$PWD/../../libs/src/Osi
DEPENDPATH += $$PWD/../../libs/src/Osi
#Osi
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/Osi/release/ -lOsi
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/Osi/debug/ -lOsi
else:unix: LIBS += -L$$PWD/../../libs/Osi/ -lOsi
INCLUDEPATH += $$PWD/../../libs/src/Osi
DEPENDPATH += $$PWD/../../libs/src/Osi
#FlopCpp
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/release/ -lFlopCpp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/debug/ -lFlopCpp
else:unix: LIBS += -L$$PWD/../../libs/FlopCpp/ -lFlopCpp
INCLUDEPATH += $$PWD/../../libs/src/FlopCpp
DEPENDPATH += $$PWD/../../libs/src/FlopCpp
#FlopCpp
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/release/ -lFlopCpp
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../libs/FlopCpp/debug/ -lFlopCpp
else:unix: LIBS += -L$$PWD/../../libs/FlopCpp/ -lFlopCpp
INCLUDEPATH += $$PWD/../../libs/src/FlopCpp
DEPENDPATH += $$PWD/../../libs/src/FlopCpp
#GLPK
LIBS += -L$$PWD/../../libs/winglpk-4.47/glpk-4.47/w64/ -lglpk_4_47
INCLUDEPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
DEPENDPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
#GLPK
LIBS += -L$$PWD/../../libs/winglpk-4.47/glpk-4.47/w64/ -lglpk_4_47
INCLUDEPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
DEPENDPATH += $$PWD/../../libs/winglpk-4.47/glpk-4.47/src
#CPLEX
USE_CPLEX{
LIBS += -L'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/lib/x64_windows_vs2013/stat_mda/' -lcplex1271 -lilocplex
INCLUDEPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
DEPENDPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
}
#CPLEX
USE_CPLEX{
LIBS += -L'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/lib/x64_windows_vs2013/stat_mda/' -lcplex1271 -lilocplex
INCLUDEPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
DEPENDPATH += 'C:/Program Files/IBM/ILOG/CPLEX_Studio1271/cplex/include/ilcplex'
}
#GUROBI
USE_GUROBI{
LIBS += -L'C:/gurobi702/win64/lib' -lgurobi_c++md2013 -lgurobi70
INCLUDEPATH += 'C:/gurobi702/win64/include'
DEPENDPATH += 'C:/gurobi702/win64/include'
#GUROBI
USE_GUROBI{
LIBS += -L'C:/gurobi702/win64/lib' -lgurobi_c++md2013 -lgurobi70
INCLUDEPATH += 'C:/gurobi702/win64/include'
DEPENDPATH += 'C:/gurobi702/win64/include'
}
}
#Eigen
......
......@@ -60,7 +60,7 @@ Conventional::Conventional(const SimulationPreferences * preferences) :
Conventional::Conventional(string name, double power, double gradient, double co2, double actualCo2, vector<pair<double, double> > efficiencyCurve,
double timeCold, double timeWarm, double timeHot, double minDownTime, double minUpTime, double fuelCost, double investCost, double fixedOM_Cost,
double specOM_Cost, double costHotStart, double costWarmStart, double costColdStart, double emissionsHotStart, double emissionsWarmStart, double emissionsColdStart,
const SimulationPreferences * preferences) :
double temperatureCoefficient, string fuelType, int lifeTime, const SimulationPreferences * preferences) : // bw: added from GUI
m_name(name),
m_power(power),
m_powerGradient(gradient),
......@@ -74,6 +74,9 @@ Conventional::Conventional(string name, double power, double gradient, double co
m_minUptime(minUpTime),
m_coolDownTimeToWarm(8.), //tc - hard coded for now: SET to 8h (typical: 8h)
m_coolDownTimeToCold(48.), //tc - hard coded for now: SET to 48h (typical: 48h)
m_lifeTime(lifeTime), // bw: added from GUI
m_fuelType(fuelType), // bw: added from GUI
m_temperatureCoefficient(temperatureCoefficient), // bw: added from GUI
m_emissionHotStart(emissionsHotStart), //tc - hot start emission in kg/Hot-Start
m_emissionWarmStart(emissionsWarmStart), //tc - warm start emission in kg/Warm-Start
m_emissionColdStart(emissionsColdStart), //tc - cold start emission in kg/Cold-Start
......@@ -473,12 +476,17 @@ double Conventional::getInvestCost() const
return m_power * m_specificInvestCost;
}
double Conventional::getAnnuityCost() const
{
return this->getInvestCost() * m_preferences->getAnnuityFactor(m_lifeTime);
}
double Conventional::getFixedOperationalCost() const
{
return 0.01 * m_specificFixedOperationalCost * getInvestCost();
}
double Conventional::getOperationalCost() const
double Conventional::getTotalOperationalCost() const
{
double totalOperationalCost = 0.;
for (int i = 0; i < m_load.size(); i++)
......
......@@ -33,7 +33,8 @@ public:
Conventional(const SimulationPreferences * preferences);
Conventional(string name, double power, double gradient, double co2, double actualCo2, vector<pair<double,double>> efficiencyCurve,
double timeCold, double timeWarm, double timeHot, double minDownTime, double minUpTime, double fuelCost, double investCost, double fixedOM_Cost, double specOM_Cost,
double costHotStart, double costWarmStart, double costColdStart, double emissionsHotStart, double emissionsWarmStart, double emissionsColdStart, const SimulationPreferences * preferences);
double costHotStart, double costWarmStart, double costColdStart, double emissionsHotStart, double emissionsWarmStart, double emissionsColdStart,
double temperatureCoefficient, string fuelType, int lifeTime, const SimulationPreferences * preferences); // bw: added from GUI
// function to "operate" plant at a given time "step", for a given "time", with a given "power"; returns the emitted CO2 for that operation
int operate(double power, int step);
......@@ -91,8 +92,9 @@ public:
double getFullLoadHours() const;
double getFuelCosts() const;
double getInvestCost() const;
double getAnnuityCost() const;
double getFixedOperationalCost() const;
double getOperationalCost() const;
double getTotalOperationalCost() const;
// complex getter
double getMinPower(int step, double time) const; //returns the currently minimal power that is reachable in a given "time"
......@@ -130,6 +132,9 @@ private:
double m_minUptime; // tc - Minimum uptime after startup in h
double m_coolDownTimeToWarm; // tc - Minimum cool down time after shutdown before a warm start in h
double m_coolDownTimeToCold; // tc - Minimum cool down time after shutdown before a warm start in h
int m_lifeTime; // bw: added from GUI
string m_fuelType; // bw: added from GUI
double m_temperatureCoefficient; // bw: added from GUI
//tc - emission data
double m_emissionHotStart; // tc - hot start emission in kg/Hot-Start
double m_emissionWarmStart; // tc - warm start emission in kg/Warm-Start
......
......@@ -61,38 +61,41 @@ InternalResult::InternalResult(string name, int nTimeSteps, double stepTime) :
InternalResult::~InternalResult()
{
//note: to supress compiler warning size_t is used, which is generally unsigned ->
// therefore, as the objects get deleted back to front,
// the loop check is not against underflow but overflow, as size_t wraps around
//delete config objects (because there is nowhere else where they get deleted)
for (int i = int(int(m_biomass.size())) - 1; i >= 0; i--)
for (size_t i = m_biomass.size() - 1; i < m_biomass.size(); i--)
{
delete m_biomass[i];