# Building Energy Analysis Tutorial

Welcome to the Building Energy Analysis tutorial. This guide will help you learn about building energy analysis through hands-on exercises using Python and Jupyter notebooks.

## Overview

This tutorial consists of:
- Interactive Jupyter notebooks (named `notebookx_XXX.ipynb`)
- Lecture slides (named `slidesx_XXX.md`)


## Getting Started

Access the [MyBinder project](https://shorturl.at/dISF1) to start the tutorial.

Depending on your internet connection, you may have to wait a few minutes to start the tutorial.


## Working with MyBinder

The MyBinder window should look like this:

<img src="figs/tutorial_binder_window.png" width="100%">

There are three main instruments to work with:
- The project files, accesible from the left panel (**Project Structure**)
- The command bar, at the top of the window (**Command Bar**)
- The working area, in the middle of the window (**Working window**)


## Following the tutorial

We recommend to follow the tutorial in the following order:

- Go thorugh the slides for a subject first (**slidesXX_XXX.md**)
- Open the corresponding notebook (**notebookXX_XXX.ipynb**)
   - Solve the exercises in the notebook by writing in the corresponding cells
   - You can check the slides to get the information you need to solve the exercises
- After finishing the exercises on a notebook, save the notebook as a PDF file 


## Working with Notebooks

To open any notebook, double-click the corsponding .ipynb file.

### Notebook Basics

Notebooks contain two types of cells, as described bellow:

<img src="figs/tutorial_cell_types.png" width="100%">

1. **Text Cells** (for reading and writing):
   - Double-click to edit
   - Press **'Shift+Enter'** to execute the cell and display the text
   - Press **'Ctrl+S'** to save the notebook

2. **Code Cells** (for running Python):
   - Click the **Run** (▶️) button to run the cell
   - Alternatively, use the **"Restart and run all"** (▶️▶️) button in the top menu to run all the cells in the notebook


*Note: Each exercise is associated with a number so that you can use any kind of document to put your answers, providing the question numbers are mentioned.*

**Example:**

Section I. Sun
Question 1. Calculated solar radiations vs measurements¶

Recommended answer format in a diffent file:
Section I., Quesition 1: (your answer here)

*Note: Don't wait for the end to test your way of collecting results. You can work directly in the notebook but be careful not to loose your responses (save or export them regularly).*

### Working with Plots

The interactive plots typically show evolution of parmaeters (such as power consumption) over time:

<img src="figs/tutorial_plots.png" width="100%">

- **View Specific Legend Item (for example an appliance)**: Double-click items in the legend
- **Zoom In**: Click and drag a rectangle on the plot
- **Zoom Out**: Click "Autoscale" in the top-right corner of the plot
- **View Details**: Hover over lines to see line-specific information

For example, hovering over a line in the power consumption plot will show the weather temperature in function of the time.

## Saving your work

We recommand you regularly save your work by pressing **'Ctrl+S'**.


## Exporting the notebook for evaluation

You have several options, using the command bar:

1. File -> Save and Export Notebook As -> PDF
2. Print -> Print to PDF

If either option is not working, you can simply save the notebook as it is:
File -> Download

<img src="figs/tutorial_saving.png" width="100%">





