Skip to content

Commit

Permalink
LP now also includes startup costs + some checks regarding the compat…
Browse files Browse the repository at this point in the history
…ibility between power plant constraints and model formulation
  • Loading branch information
squoilin committed Feb 9, 2020
1 parent b2cc2a0 commit e34b9a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
9 changes: 8 additions & 1 deletion dispaset/preprocessing/data_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,14 @@ def check_units(config, plants):
logging.critical('The value of ' + key + ' should be lower than the horizon length (' + str(
config['HorizonLength'] * 24) + ' hours). A higher value has been found for units ' + str(plantlist))
sys.exit(1)


# Checking che compatibility between the selected simulation time and the power plant constraints:
if config['SimulationType'] in ('LP','LP clustered') :
for key in ['NoLoadCost', 'PartLoadMin', 'MinEfficiency', 'StartUpTime']:
if (plants[key] > 0).any():
logging.error('Non-null value(s) have been found for key ' + key + ' in the power plant list. \
This cannot be modelled with the ' + config['SimulationType'] + ' formulation and \
will therefore not be considered.')
return True


Expand Down
9 changes: 0 additions & 9 deletions dispaset/preprocessing/data_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,15 +525,6 @@ def load_config_excel(ConfigFile,AbsPath=True):
if config['default'].get(param,'')=='':
config['default'][param]=DEFAULTS[param]

# config['default']['ShareOfFlexibleDemand'] = sheet.cell_value(81, 5)
# for def_value in config['default']:
# if config['default'][def_value] =='':
# logging.warning('No value was provided in config file for {}. Will use {}'.format(def_value, DEFAULTS[def_value]))
# config['default'][def_value] = DEFAULTS[def_value]




config['zones'] = read_truefalse(sheet, 86, 1, 109, 3)
config['zones'] = config['zones'] + read_truefalse(sheet, 86, 4, 109, 6)

Expand Down
2 changes: 1 addition & 1 deletion dispaset/preprocessing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def clustering(plants, method='Standard', Nslices=20, PartLoadMax=0.1, Pmax=30):
mapping['NewIndex'][oldplant] = NewName

# Transforming the start-up cost into ramping for the plants that did not go through any clustering:
if method == 'LP clustered':
if method in ('LP', 'LP clustered'):
for i in range(Nunits_merged):
if plants_merged['RampingCost'][i] == 0:
Power = plants_merged['PowerCapacity'][i]
Expand Down

0 comments on commit e34b9a0

Please sign in to comment.