Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. demand = Jan[:24*4*5]
  2. t = range(len(demand))
  3. demand_dict = {}
  4. for tt, dd in zip(t, demand):
  5. demand_dict[tt] = dd
  6.  
  7.  
  8. class Battery:
  9. def __init__(self, n, Emax, Emin, cap):
  10. self.n=n
  11. self.Emax=Emax
  12. self.Emin=Emin
  13. self.cap=cap
  14.  
  15.  
  16. B1=Battery(0.8,3800,400,500)
  17. B2=Battery(0.8,7600,800,1000)
  18. Batts=[B1,B2]
  19. Results=[]
  20. Instance=[]
  21. for b in Batts:
  22. data = {None: {'cosP': {None: cosP},
  23. 't': {None: t},
  24. 'cosE': {None: cosE},
  25. 'cosF':{None:cosF},
  26. 'n':{None: b.n},
  27. 'Emax':{None:b.Emax}, #kWh max capacity
  28. 'Emin':{None:b.Emin}, #kWh min capacity
  29. 'cap':{None:b.cap},
  30. 'dem': demand_dict
  31. }
  32. }
  33. instance=model.create_instance(data)
  34. opt=SolverFactory('glpk')
  35. results = opt.solve(instance)
  36. Results.append(results)
  37. Instance.append(instance)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement