Giter VIP home page Giter VIP logo

minpower's People

Contributors

adamgreenhall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minpower's Issues

visualization problem with uc test case

Hello,
similar problem with the unit commitment test case and the --visualization option but a bit different traceback:

Traceback (most recent call last):
File "c:\Anaconda\envs\mp\Scripts\minpower-script.py", line 9, in
load_entry_point('minpower==4.3.1', 'console_scripts', 'minpower')()
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\solve.py", line 258, in main
try: solve_problem(directory)
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\solve.py", line 140, in solve_problem
if user_config.visualization: solution.visualization()
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\results.py", line 491, in visualization
self, self.generators, self.times, prices, withPrices=withPrices)
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\results.py", line 837, in stack_plot_UC
T = [t.Start for t in times]
AttributeError: 'str' object has no attribute 'Start'

Thanks,
André Sorge

visualization problem with ed test case

Hello,
I'm running minpower in an anaconda windows installation. Calling the economic dispatch test case with --visualization option I got following traceback:

Traceback (most recent call last):
File "c:\Anaconda\envs\mp\Scripts\minpower-script.py", line 9, in
load_entry_point('minpower==4.3.1', 'console_scripts', 'minpower')()
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\solve.py", line 258, in main
try: solve_problem(directory)
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\solve.py", line 140, in solve_problem
if user_config.visualization: solution.visualization()
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\results.py", line 281, in visualization
minGen = min(getattrL(generators, 'Pmin'))
File "c:\Anaconda\envs\mp\lib\site-packages\minpower\commonscripts.py", line 196, in getattrL
return [getattr(item, attribute) for item in L]
AttributeError: 'Generator' object has no attribute 'Pmin'

Best regards,
André Sorge

TypeError: long() argument must be a string or a number, not 'datetime.datetime'

Hello,

I am having troubles getting started with minpower.

I followed the instructions on the website and successfully installed minpower/CPLEX. When trying to execute the sample UC case I receive the following output.

user@Computer C:\Users\user\minpower
$ pip install minpower
Requirement already satisfied (use --upgrade to upgrade): minpower in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): pyomo==4.0.9682 in c:\python27\lib\site-packages (from minpower)
Requirement already satisfied (use --upgrade to upgrade): pandas==0.16 in c:\python27\lib\site-packages (from minpower)
Requirement already satisfied (use --upgrade to upgrade): numpy==1.9.1 in c:\python27\lib\site-packages (from minpower)
Requirement already satisfied (use --upgrade to upgrade): ply in c:\python27\lib\site-packages (from pyomo==4.0.9682->minpower)
Requirement already satisfied (use --upgrade to upgrade): six>=1.6.1 in c:\python27\lib\site-packages (from pyomo==4.0.9682->minpower)
Requirement already satisfied (use --upgrade to upgrade): nose in c:\python27\lib\site-packages (from pyomo==4.0.9682->minpower)
Requirement already satisfied (use --upgrade to upgrade): PyUtilib>=5.0 in c:\python27\lib\site-packages (from pyomo==4.0.9682->minpower)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in c:\python27\lib\site-packages (from pandas==0.16->minpower)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in c:\python27\lib\site-packages (from pandas==0.16->minpower)
You are using pip version 8.0.2, however version 8.1.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

user@Computer C:\Users\user\minpower
$ minpower uc
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\minpower.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\minpower\solve.py", line 297, in main
    solve_problem(directory)
  File "c:\python27\lib\site-packages\minpower\solve.py", line 147, in solve_problem
    generators, loads, lines, times, scenario_tree, data = get_data.parsedir()
  File "c:\python27\lib\site-packages\minpower\get_data.py", line 201, in parsedir
    lines_data, init_data)
  File "c:\python27\lib\site-packages\minpower\get_data.py", line 137, in _parse_raw_data
    generators_data, loads_data)
  File "c:\python27\lib\site-packages\minpower\get_data.py", line 377, in setup_times
    timeseries[name] = get_schedule(joindir(datadir, load[fcol])) * \
  File "c:\python27\lib\site-packages\minpower\schedule.py", line 11, in get_schedule
    return ts_from_csv(filename)
  File "c:\python27\lib\site-packages\minpower\commonscripts.py", line 107, in ts_from_csv
    df.index = pd.DatetimeIndex(df.index)
  File "c:\python27\lib\site-packages\pandas\util\decorators.py", line 88, in wrapper
    return func(*args, **kwargs)
  File "c:\python27\lib\site-packages\pandas\tseries\index.py", line 332, in __new__
    subarr = cls._simple_new(subarr, name=name, freq=freq, tz=tz)
  File "c:\python27\lib\site-packages\pandas\tseries\index.py", line 502, in _simple_new
    values = com._ensure_int64(values).view(_NS_DTYPE)
  File "pandas\src\generated.pyx", line 115, in pandas.algos.ensure_int64 (pandas\algos.c:51102)
  File "pandas\src\generated.pyx", line 120, in pandas.algos.ensure_int64 (pandas\algos.c:50998)
TypeError: long() argument must be a string or a number, not 'datetime.datetime'

I tested it also with a fresh install of Anaconda, but I receive the same output.

I am using numpy-1.10.4. If I downgrade to numpy 1.9.1 I receive the following error.

RuntimeError: module compiled against API version a but this version of numpy is 9
``

I apologize. Obviously the error is due to an outdated pandas version.
I am still stuck with this error, but I guess I can figure that out:

$ minpower uc
Traceback (most recent call last):
  File "c:\anaconda2\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\anaconda2\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Anaconda2\Scripts\minpower.exe\__main__.py", line 9, in <module>
  File "c:\anaconda2\lib\site-packages\minpower\solve.py", line 297, in main
    solve_problem(directory)
  File "c:\anaconda2\lib\site-packages\minpower\solve.py", line 147, in solve_problem
    generators, loads, lines, times, scenario_tree, data = get_data.parsedir()
  File "c:\anaconda2\lib\site-packages\minpower\get_data.py", line 201, in parsedir
    lines_data, init_data)
  File "c:\anaconda2\lib\site-packages\minpower\get_data.py", line 140, in _parse_raw_data
    loads = build_class_list(loads_data, powersystems.Load, times, timeseries)
  File "c:\anaconda2\lib\site-packages\minpower\get_data.py", line 292, in build_class_list
    invalid_fields.tolist()))
ValueError: invalid fields in model:: ['p', 'type']

Installation error

Hello,

I have just installed minpower under actual version of cygwin 1.7.17-1 and python version 2.6.8. All prerequisites for minpower install well but during minpower installation I got following syntax error:

Installing collected packages: minpower
Running setup.py install for minpower
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/minpower/commonscripts.py', 173, 78, ' try: data=[{field_map[drop_case_spaces(name)]:convert_str2num(val) for name,val in row.items() if valid_cell(name,val)} for row in raw_data]\n'))

I'm not sure if this is a bug because I can't identify a syntax problem (but python is not my world) or if the runtime environment cygwin+python is not supported. Is there a possibility to overcome this issue?

Best regards,
André

ImportError: No module named opt.base

I am beginner in Linux, but I could manage home directory and installed Anaconda_Python,minpower and gurobi(licence activated).

Directed path for all 3 to /bin.
So in terminal I get
which python as "/home/hithuanand/anaconda/bin/python"
which minpower as
/home/hithuanand/anaconda/bin/minpower
which gurobi_cl as
/home/hithuanand/opt/gurobi603/linux64/bin/gurobi_cl

To run "minpower uc" I extract uc.zip in home directory.
As instructed I run "minpower uc" in terminal but I get

File "/home/hithuanand/anaconda/lib/python2.7/site-packages/minpower/solve.py", line 16, in
import powersystems, get_data, stochastic, results
File "/home/hithuanand/anaconda/lib/python2.7/site-packages/minpower/powersystems.py", line 15, in
from optimization import (value, OptimizationObject,
File "/home/hithuanand/anaconda/lib/python2.7/site-packages/minpower/optimization.py", line 16, in
from coopr.opt.base import solvers as cooprsolver
ImportError: No module named opt.base

I have to import gurobi from python shell for checkin "gurobi" command. It works fine.

Please tell where is the mistake,COOPRSOLVER FROM 3 .py FILES. How to solve this?
I hope minpower is run from home directory!

Bare with my lack of knowledge, am a newbie. The minpower can contribute to my research.

Lower and upper bounds for boolean variables redefined

When running minpower in debug mode I get the following warning messages:

pyomo.lp:79690: warning: lower bound of variable status_Bridger1(t648)' redefined pyomo.lp:79690: warning: upper bound of variablestatus_Bridger1(t648)' redefined
pyomo.lp:79691: warning: lower bound of variable status_Bridger1(t649)' redefined pyomo.lp:79691: warning: upper bound of variablestatus_Bridger1(t649)' redefined

It complaining about statements in the LP file like:
0 <= status_Bridger1(t648) <= 1

any way to stop these statements from being created?

Ron

time varying bids

Either through a fuel cost schedule or as part of the bid points file, as in:

Date, Power, Cost
1/2/2012,0,0
1/2/2012,100,1000
1/2/2012,150,1550
1/3/2012,0,0
1/3/2012,100,1100
1/3/2012,150,2000
1/4/2012,0,0
1/4/2012,100,1100
1/4/2012,150,2000

Hydro model

Been working with the Hydro branch(s) for the last month, starting to make progress with it. Need to review the water balance constraint, don't think it is formulated correctly. I have changed my version to 'volume(t)=volume(t-1)+inflows-net_outflow'. Also having issues with ramping constraints and the model was missing several net_outflow constraints. Would like to collaborate more. BTW your email address needs to be updated, I have been getting delivery errors for "[email protected]".

Ronald Schellberg
Idaho Power Company
Transmission Policy and Development

type error occur when using bid file

When I add costcurvepointsfilename in generator , the console throw out this:
Traceback (most recent call last):
File "/root/miniconda3/bin/minpower", line 8, in
sys.exit(main())
File "/root/miniconda3/lib/python3.8/site-packages/minpower/solve.py", line 309, in main
solve_problem(directory)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/solve.py", line 157, in solve_problem
solution = create_solve_problem(power_system, times, scenario_tree)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/solve.py", line 223, in create_solve_problem
sln = results.make_solution(power_system, times)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 84, in make_solution
return problem_type[kind](power_system, times, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 116, in init
self._get_costs()
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 166, in _get_costs
self.incremental_cost = self.gen_time_df("incrementalcost")
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 147, in gen_time_df
[self.get_values(generators, method, t, evaluate) for t in times],
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 147, in
[self.get_values(generators, method, t, evaluate) for t in times],
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 135, in get_values
out = [value(getattr(obj, method)(time)) for obj in items]
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 135, in
out = [value(getattr(obj, method)(time)) for obj in items]
File "/root/miniconda3/lib/python3.8/site-packages/minpower/generators.py", line 166, in incrementalcost
self.bids.output_incremental(self.power(time, scenario))
File "/root/miniconda3/lib/python3.8/site-packages/minpower/bidding.py", line 146, in output_incremental
if A[0] <= input_val <= B[0]:
TypeError: '<=' not supported between instances of 'str' and 'float'

it seems that the output_incremental function picks up wrong data from the raw file using:
for A, B in pairwise(self.bid_points):
should use:
for A, B in pairwise(self.bid_points.values.tolist()):
instead

component already defined when lines get constraition

RuntimeError: Cannot add component 'swing_bus_i0_t00' (type <class 'pyomo.core.base.constraint.AbstractScalarConstraint'>) to block 'power system problem': a component by that name (type <class 'pyomo.core.base.constraint.ScalarConstraint'>) is already defined.

MinPower ignores Generator Names (and Kind)

I love minpower but i am fairly new to Python.

When running a sample EC, the output will always name the generators "g0","g1","g2", (...) , even though I specified a name and fuel type.

Where am I going wrong?

generators.csv

"name","kind","costcurveequation","Pmin","Pmax","min up time"," min down time"," ramp rate max","schedule filename"
"base","coal","30P+.01P^2",0,3000,0,0,3000,
"peaker","natural gas","50P",0,2500,0,2,2500,
"peaker1","natural gas","10P",0,1500,3,0,2500,
"peaker","oil","2P",0,700,0,2,1500,
"peaker1","oil","10P",0,550,3,0,1200,
"wind","wind",0,,,,,,"ireland_wind_fewdays.csv"

commitment-power.csv

time,g0,g1,g2,g3,g4,g5
2010-04-27 00:00:00,0.0,0.0,1397.0,700.0,0.0,403.0
2010-04-27 01:00:00,0.0,0.0,1486.0,700.0,0.0,303.0
2010-04-27 02:00:00,0.0,0.0,1421.0,700.0,0.0,311.0
2010-04-27 03:00:00,0.0,0.0,1332.0,700.0,0.0,340.0
2010-04-27 04:00:00,0.0,0.0,1260.0,700.0,0.0,360.0
2010-04-27 05:00:00,0.0,0.0,1221.0,700.0,0.0,345.0

Can't get minpower to work

These are copied from my terminal.

arthur@arthur-linux:/.local/lib/python2.7/site-packages/minpower$ which glpsol
/usr/bin/glpsol
arthur@arthur-linux:
/.local/lib/python2.7/site-packages/minpower$ pip freeze
adium-theme-ubuntu==0.3.4
appdirs==1.4.0
beautifulsoup4==4.4.1
chardet==2.3.0
cycler==0.9.0
decorator==4.0.9
glpk==0.4.52
html5lib==0.999
lxml==3.5.0
matplotlib==1.5.1
minpower==4.4.0
networkx==1.11
nose==1.3.7
numpy==1.9.1
PAM==0.4.2
pandas==0.18.1
pexpect==4.0.1
Pillow==3.1.2
ply==3.8
ptyprocess==0.5
pygobject==3.20.0
pyinotify==0.9.6
Pyomo==4.3.11377
pyparsing==2.0.3
PYPOWER==5.0.1
pypsa==0.4.1
python-dateutil==2.5.3
pytz==2016.4
PyUtilib==5.3.5
scipy==0.17.0
six==1.10.0
unity-lens-photos==1.0
arthur@arthur-linux:/.local/lib/python2.7/site-packages/minpower$ minpower uc
minpower: command not found
arthur@arthur-linux:
/.local/lib/python2.7/site-packages/minpower$ python minpower uc
python: can't open file 'minpower': [Errno 2] No such file or directory
arthur@arthur-linux:/.local/lib/python2.7/site-packages/minpower$ cd /.local/lib/python2.7/site-packages/
arthur@arthur-linux:
/.local/lib/python2.7/site-packages$ minpower ucminpower: command not found
arthur@arthur-linux:
/.local/lib/python2.7/site-packages$ python minpower uc/usr/bin/python: can't find 'main' module in 'minpower'
arthur@arthur-linux:~/.local/lib/python2.7/site-packages$

Clearly, I have installed minpower along with glpk and directory in ~/.bash is pathed right.
However, when I follow the instruction of type "minpower uc" in terminal, expect a case is loaded and solved. Not happening for me, can any experienced minpower user assist me?

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.