Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- demand = Jan[:24*4*5]
- t = range(len(demand))
- demand_dict = {}
- for tt, dd in zip(t, demand):
- demand_dict[tt] = dd
- class Battery:
- def __init__(self, n, Emax, Emin, cap):
- self.n=n
- self.Emax=Emax
- self.Emin=Emin
- self.cap=cap
- B1=Battery(0.8,3800,400,500)
- B2=Battery(0.8,7600,800,1000)
- Batts=[B1,B2]
- Results=[]
- Instance=[]
- for b in Batts:
- data = {None: {'cosP': {None: cosP},
- 't': {None: t},
- 'cosE': {None: cosE},
- 'cosF':{None:cosF},
- 'n':{None: b.n},
- 'Emax':{None:b.Emax}, #kWh max capacity
- 'Emin':{None:b.Emin}, #kWh min capacity
- 'cap':{None:b.cap},
- 'dem': demand_dict
- }
- }
- instance=model.create_instance(data)
- opt=SolverFactory('glpk')
- results = opt.solve(instance)
- Results.append(results)
- Instance.append(instance)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement