Co-Opetition Summer 2026 (Closes September)
This page provides interactive guidance for attendees taking part in the Co-opetition. As a participant, you can work through the guidance sections and questions at your own pace, even after the live workshop sessions. If you're attending a live workshop session, we encourage you to follow the guidance and mark the sections as complete as you go. This will help us run the live session, to make sure everyone has a chance to keep up.
9 steps · 5 questions · live results ↗
Are you currently a student?
How experienced are you at coding in Python?
What OS are you using? (you can select multiple if you have different systems that you prefer to run on)
Select all that apply
On the system you're currently using, do the terminal/powershell commands python and pip generate a successful output?
Please ensure you have Python 3.11+ to avoid any issues running this app. We highly recommended installing using pipx, which isolates the app in its own environment and puts the r2h2 command on your PATH automatically. Even if you habitually manage your own environments (as is best practice!), you'll find pipx extremely useful here, for launching the app and keeping it up-to-date, with minimal CLI instructions.
As a prerequisite, you'll need pip on your path (i.e. typing pip in your terminal/powershell returns a list of pip reference commands).
Next, you should ensure that pipx is installed, by pasting the following into your terminal:
pip install pipx
pipx ensurepath
Warning
Please be sure to close and restart a fresh terminal before installing the app. This ensures that changes made bypipx ensurepathcan apply to the installation below.
Paste the following into a fresh terminal:
pipx install r2h2
Once the installation finishes, type:
r2h2
The first time you use the app, you'll be asked where you want to save all the associated data (an SQlite database, and various files for storing wind data, and controller code). When prompted, type a location on your local system, in a directory that you have full access rights.
Method 1 (easiest)
We recommend checking for upgrades periodically. The easiest way to do this is to click on the help page, and look for 'Check for updates' towards the bottom of the page. The message from the pop-up window should ideally be clear, but if you come across issues (we're beta testing!) you can try the alternative method below.
Method 2 (alternative / fall-back)
To upgrade, type the following into a terminal:
pipx upgrade r2h2
The in-built default model can help you get started, to test out your installation and give you a template for tailoring your own model. To get started, navigate to the 'Models & Simulation' view, and click 'Default Model'. This will take you directly into a detailed view of the new model; you'll also find this model is now listed in the 'Models & Simulation' view.
Expand 'Simulation Settings', which will prompt you to find wind data. Follow the link to the 'Wind Inputs' view, and you'll see how to upload files. The simulation engine expects a specific format of file (.h5, with specific fields). We currently host a set of files derived from our models, which are ready to use with the R2H2 too. You can download one or more of these wind input files from here: https://www.renewabletools.co.uk/r2h2/data-resources/.
Revert back to 'Models & Simulations' → 'Default Model', and go back to 'Simulation Settings'.
Follow the prompt to 'link a wind file', at which point you will see some options for selecting a date range. On first attempt, it is recommended to adjust the date fields to run the simulation for no longer than a week, to double check that your installation worked. You can also set 'Don't save 1hz data' on first pass.
Finally, click 'Simulate' towards the top right of the screen. After around 10-15 seconds, you should see a progress bar, and will see an estimated runtime shortly afterwards.
Once the simulation runs, you can click on the relevant row in the 'Simulation Runs' table, to see the simulation outputs.
For future reference, if you plan to manage the wind inputs files more closely, navigate to the bottom of the 'Models & Simulation' view, and add/remove wind inputs, or drag to reorder the files if required.
To begin to develop your own model, you'll want to be able to adapt the linked components and their parameters. To do this, go to the 'Component Library' view, and look for the component type that you are interested in changing (e.g. Battery). Here, you can find a tabulated list of specific components; the columns 'Name' and 'Linked Models' will help you find the components which are currently in use. If you click the pencil icon you can edit parameters, and either 'Save' or Save a copy'.
On this page, can also create new components via '+ Add new'. To add/remove components from your Model, revert to the 'Models & Simulations' view, and look for the plus icon next on the component panels (e.g. the Battery panel).
For the purposes of this tutorial, we'll continue to use the default configurations and values.
As part of the next stages of the Co-opetition, we'll work on the controller design. Revert back to 'Models & Simulations' → 'Default Model', you'll see a panel named 'Controller Code'. The controls of this panel should be intuitive; you can select your controller from the dropdown menu (remember to click select if you change this), and you can create new controllers by copying existing ones.
In the code panel, the code is editable and will apply to your simulations for the present Model. If you are editing your code, make sure to click 'Save' after editing.
Within the Simulation Settings panel, you can configure your next simulation run to record 1Hz data (you can't do this after the fact for previous runs). This data stream can become quite large if you decide to collect over too long a period, and in general you should decide carefully how much to record.
Selecting 'Save 1Hz data' will enable some further settings, where you can set the time period for 1Hz data records (this doesn't have to be for the full simulation run). You can also toggle on/off parameters which appear in the Controller Code panel. To test out 1Hz data collection, try selecting a few of the parameters, and run a test simulation for around 1 week, after which you can view some additional plots in the detailed results page.
Finally, you can expose more time vectors from within the simulation code by including a buffer definition in your Python controller code. To do this, try adding a dictionary similar to below, to the end of your controller code:
buffer = {
'battery_SoC': battery.arSoC,
}
Click 'Save' at the top right of the Controller Code panel. Back in Simulation Settings, click 'Detect from controller', after which new toggle buttons will appear under variables for 1Hz data collection.
How did the installation go?