diff --git a/.gitignore b/.gitignore index 3ec22b832..d6a5241ce 100644 --- a/.gitignore +++ b/.gitignore @@ -32,8 +32,14 @@ pypsa.egg-info/ files.txt -*.org +tom_notes.org *.pdf *.aux + +website/examples/*.py + +*.zip + +*.html \ No newline at end of file diff --git a/website/doc b/website/doc new file mode 120000 index 000000000..05af2cfb6 --- /dev/null +++ b/website/doc @@ -0,0 +1 @@ +../doc/_build/html \ No newline at end of file diff --git a/website/download/index.org b/website/download/index.org new file mode 100644 index 000000000..c9a9a1ee0 --- /dev/null +++ b/website/download/index.org @@ -0,0 +1,8 @@ +#+TITLE: Python for Power System Analysis: Download +#+OPTIONS: toc:nil no default TOC + + +See the [[../doc/installation.html][installation instructions]]. + +You can also see/download the code directly from +[[https://github.com/FRESNA/PyPSA][github]]. diff --git a/website/examples/index.org b/website/examples/index.org new file mode 100644 index 000000000..d5bc8361a --- /dev/null +++ b/website/examples/index.org @@ -0,0 +1,66 @@ +#+TITLE: Python for Power System Analysis: Examples +#+OPTIONS: toc:nil no default TOC + +These examples demonstrate PyPSA using [[http://jupyter.org/][Jupyter/iPython notebooks]]. To +download the notebook files directly, replace the example file ending +=.html= with =.ipynb=. + +For some of the examples you may have to download data from the +=examples= folder in the [[https://github.com/FRESNA/PyPSA][PyPSA github +repository]]. + +- [[./minimal_example_pf.html][*Minimal example of power flow*]] - This script performs a non-linear + power flow for a three-node network. +- [[./minimal_example_lopf.html][*Minimal example of linear optimal power flow*]] - This script performs + a linear optimal power flow for a three-node network. +- [[./transformer_example.html][*Transformer example*]] - Minimal example of transformer with + non-trivial phase shift and tap ratio. +- *SciGrid German network* + - [[./scigrid-lopf-then-pf.html][*Linear OPF then non-linear PF on the SciGRID German network*]] - + This script performs a linear optimal power flow on the [[http://scigrid.de/][SciGRID]] + network for Germany for a full day and then examines the results. + A full non-linear power flow is then performed on the network + with the optimised dispatch. + - [[./scigrid-sclopf.html][*Security-constrained LOPF on the SciGRID German network*]] - This + script performs a security-constrained linear optimal power flow + on the [[http://scigrid.de/][SciGRID]] network for Germany, taking into account several + possible branch outages. + - [[./add_load_gen_trafos_to_scigrid.html][*Attaching load, generation, transformers and missing lines to the + SciGRID German network*]] - This script attaches load, conventional + generation data and wind and solar data, transformers and missing + lines to the [[http://scigrid.de/][SciGRID]] network for Germany. It then exports the + resulting network for use in the script above. Only a single + day's worth of data is in the [[https://github.com/FRESNA/PyPSA][PyPSA github repository]]; a full year + (2011) of load and wind/solar data can be downloaded [[./scigrid-with-load-gen-trafos-2011.zip][here]]. +- [[./ac-dc-lopf.html][*Meshed AC-DC network*]] - This example demonstrates multiply-connected + AC-DC meshed networks with an example of 3 separate synchronous AC + areas connected by a 3-node DC network. +- [[./unit-commitment.html][*Generator Unit Commitment Examples*]] - This tutorial runs through + examples of unit commitment for generators at a single bus. Examples + of minimum part-load, minimum up time, minimum down time, start up + costs, shut down costs and ramp rate restrictions are shown. +- [[./simple-electricity-market-examples.html][*Simple Electricity Market Examples*]] - This tutorial gradually builds + up more and more complicated energy-only electricity markets in + PyPSA, starting from a single bidding zone, going up to multiple + bidding zones connected with transmission (NTCs) along with variable + renewables and storage. +- *Coupling to Other Energy Sectors* + - [[./lopf-with-heating.html][*Linear optimal power flow with coupling to the heating sector*]] - In + this example three locations are optimised, each with an electric + bus and a heating bus and corresponding loads. At each location + the electric and heating buses are connected with heat pumps; heat + can also be supplied to the heat bus with a boiler. The electric + buses are connected with transmission lines and there are + electrical generators at two of the nodes. + - [[./power-to-gas-boiler-chp.html][*Power-to-Gas with Gas Boiler and Combined-Heat-and-Power unit*]] + - [[./power-to-heat-water-tank.html][*Power-to-Heat with Water Tank*]] + - [[./battery-electric-vehicle-charging.html][*Transport: Charging Battery Electric Vehicle with Solar Panel*]] + - [[./chained-hydro-reservoirs.html][*Chained Hydroelectric Reservoirs*]] + - [[./replace-generator-storage-units-with-store.html][*Replacing Generators and Storage Units with Fundamental Stores and + Links*]] - This notebook demonstrates how generators and storage + units can be replaced by more fundamental components (Stores and + Links), and how their parameters map to each other. + + +If you have a nice example of using PyPSA, send your iPython notebook to +Tom Brown (brown at fias.uni-frankfurt.de). diff --git a/website/forum/index.org b/website/forum/index.org new file mode 100644 index 000000000..48c2dfb18 --- /dev/null +++ b/website/forum/index.org @@ -0,0 +1,6 @@ +#+TITLE: Python for Power System Analysis: Forum +#+OPTIONS: toc:nil no default TOC + + + +PyPSA has a Google Group [[https://groups.google.com/group/pypsa][forum / mailing list]]. diff --git a/website/generate.py b/website/generate.py new file mode 100644 index 000000000..31adb0c66 --- /dev/null +++ b/website/generate.py @@ -0,0 +1,144 @@ +# make the code as Python 3 compatible as possible +from __future__ import print_function, division, absolute_import + +import os, markdown, sys, getopt + + +hierarchy = [["index.html","home"], + ["download/index.html","download"], + ["examples/index.html","examples"], + ["doc/index.html","documentation"], + ["publications/index.html","publications"], + ["forum/index.html","forum"], +] + + + +def process_org(org_name): + """Build HTML page and write it.""" + + html_name = org_name[:-4] + ".html" + + root_path = org_name.count("/")*"../" + + hierarchy_path = [] + + def find_path(layer,path,hierarchy_path): + if len(path) > 0 and path[-1] == html_name: + hierarchy_path += path + else: + for item in layer: + new_path = path + [item[0]] + if len(item) > 2: + new_layer = item[2] + else: + new_layer = [] + find_path(new_layer,new_path,hierarchy_path) + + find_path(hierarchy,[],hierarchy_path) + + hierarchy_path.append("") + + layer = hierarchy + + name = "" + + menu = "" + + for n,item in enumerate(hierarchy_path): + + bare_layer = [i[0] for i in layer] + + filled_layer = [[i[0],i[0][:i[0].rfind(".")]] if len(i) < 2 else i for i in layer] + + menu += "
\n" + + if item != "": + full_item = layer[ bare_layer.index(item)] + for i in filled_layer: + if i[0] == html_name: + name = i[1] + else: + full_item = [] + + if len(full_item) < 3: + break + + layer = full_item[2] + + + html = """ + + +