Skip to content

Commit

Permalink
Merge pull request #6 from ThomasHeggarty/master
Browse files Browse the repository at this point in the history
Correction of a few bugs - closes #5
  • Loading branch information
willu47 authored Jun 10, 2020
2 parents 5eea33f + 03793ee commit 4a51993
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions osemosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
######### RE Gen Target #############

model.TotalREProductionAnnual = Var(model.REGION, model.YEAR, initialize=0.0)
model.RETotalDemandOfTargetFuelAnnual = Var(model.REGION, model.YEAR, initialize=0.0)
model.RETotalProductionOfTargetFuelAnnual = Var(model.REGION, model.YEAR, initialize=0.0)

model.TotalTechnologyModelPeriodActivity = Var(model.REGION, model.TECHNOLOGY, initialize=0.0)

Expand Down Expand Up @@ -534,13 +534,13 @@ def ModelPeriodEmissionsLimit_rule(model,r,e):
######### Reserve Margin Constraint ############## NTS: Should change demand for production

def ReserveMargin_TechnologiesIncluded_rule(model,r,l,y):
return (sum((model.TotalAnnualCapacity[r,t,y]*model.ReserveMarginTagTechnology[r,t,y]*model.CapacityToActivityUnit[r,t]) for t in model.TECHNOLOGY) == model.TotalCapacityInReserveMargin[r,y])
ReserveMargin_TechnologiesIncluded = Constraint(model.REGION, model.TIMESLICE, model.YEAR, rule=ReserveMargin_TechnologiesIncluded_rule)
return (sum((model.TotalCapacityAnnual[r,t,y]*model.ReserveMarginTagTechnology[r,t,y]*model.CapacityToActivityUnit[r,t]) for t in model.TECHNOLOGY) == model.TotalCapacityInReserveMargin[r,y])
model.ReserveMargin_TechnologiesIncluded = Constraint(model.REGION, model.TIMESLICE, model.YEAR, rule=ReserveMargin_TechnologiesIncluded_rule)

def ReserveMargin_FuelsIncluded_rule(model,r,l,y):
return sum((model.RateOfProduction[r,l,f,y]*model.ReserveMarginTagFuel) for f in model.FUEL) == model.DemandNeedingReserveMargin[r,l,y]
ReserveMargin_FuelsIncluded = Constraint(model.REGION, model.TIMESLICE, model.YEAR, rule=ReserveMargin_FuelsIncluded_rule)
return sum((model.RateOfProduction[r,l,f,y]*model.ReserveMarginTagFuel[r,f,y]) for f in model.FUEL) == model.DemandNeedingReserveMargin[r,l,y]
model.ReserveMargin_FuelsIncluded = Constraint(model.REGION, model.TIMESLICE, model.YEAR, rule=ReserveMargin_FuelsIncluded_rule)

def ReserveMarginConstraint_rule(model,r,l,y):
return model.DemandNeedingReserveMargin[r,l,y]*model.ReserveMargin[r,y] <= model.TotalCapacityInReserveMargin[r,y]
ReserveMarginConstraint = Constraint(model.REGION, model.TIMESLICE, model.YEAR, rule=ReserveMarginConstraint_rule)
model.ReserveMarginConstraint = Constraint(model.REGION, model.TIMESLICE, model.YEAR, rule=ReserveMarginConstraint_rule)

0 comments on commit 4a51993

Please sign in to comment.