Skip to content
imeldawang edited this page Aug 28, 2015 · 3 revisions

Welcome to the switch-hawaii-studies wiki!

Setup:

These instructions should work on Linux or Mac OS X computers by pasting these commands into a terminal. The general steps should also work on Windows, but that has not been tested. At a minimum, you will need to update the path separators from forward slash / to back slash .

This also requires the standard Switch prerequisites of Python, Pyomo, etc. Before attempting to install this, I strongly recommend installing Switch and testing its installation. See https://github.com/switch-model/switch

Download software and scripts.

git clone https://github.com/switch-model/switch-hawaii-studies.git
cd switch-hawaii-studies/models/pumped_hydro
git clone https://github.com/switch-model/switch.git
git clone https://github.com/switch-model/switch-hawaii-core.git

Download input data from a database.

Before proceeding, edit switch-hawaii-core/scenario_data.py and change user='switch_user' from switch_user to your user name on the postgresql database. Contact Matthias about setting up an account if you don't have login credentials. You will also need to setup your postgresql password file. The easy way to do this is to use pgAdmin to test that your account works and say yes to save password when prompted. The other way to do this is make a file named .pgpass in your home directory, restrict its permission to your user bash chmod 0600 , and add this line switch.eng.hawaii.edu:5432:*:<username>:<password> with your username and password. If the file already exists, just verify its permissions and add a new line to it. The database connection steps may change in the future. For long-term distribution to the public, we will probably make a backup of the database available for folks to download and set up on their own computers.

Open switch-hawaii-core/scenario_data.py, find the line that includes psycopg2.connect(database='switch', host=pghost, user='switch_user') and change the user to your postgresql username.

Large set of inputs, takes 45 minutes to an hour to run on a relatively fast computer.

Open get_scenario_data.py in a text editor and set time_sample='rps'

mkdir inputs
cd inputs
python ../get_scenario_data.py
cd ..
python solve.py

Small set of inputs with simplified model, takes about 5 minutes to run on a relatively fast computer.

Open get_scenario_data.py in a text editor and set time_sample='rps_test_45'

mkdir inputs_test
cd inputs_test
python ../get_scenario_data.py
cd ..
python solve.py no_ev no_rps no_renewables no_demand_response no_pumped_hydro tag=fossil_only inputs=inputs_test

Tested systems

These setup instructions have been validated on the following systems & Pyomo versions. If you set this up on your system and it works, please use the command bash pyomo --version to collect your system information and paste it below. Mahalo.

  • Pyomo 4.0.9682 (CPython 2.7.9 on Darwin 13.4.0)
  • Pyomo 4.1.10527 (CPython 2.7.5 on Linux 3.10.0-229.7.2.el7.x86_64)