Metadata-Version: 2.4
Name: tclab-jupyter
Version: 0.1.0
Summary: Notebook UI and reusable control/runtime components for the Temperature Control Lab.
Project-URL: Homepage, https://github.com/evertoncolling/tclab_jupyter
Project-URL: Repository, https://github.com/evertoncolling/tclab_jupyter
Author-email: Everton Colling <evertoncolling@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: control,jupyter,mpc,pid,tclab
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.11
Requires-Dist: gekko>=1.0.6
Requires-Dist: numpy>=1.26
Requires-Dist: scipy>=1.11
Provides-Extra: hardware
Requires-Dist: tclab>=0.4.10; extra == 'hardware'
Provides-Extra: notebook
Requires-Dist: bqplot>=0.12.43; extra == 'notebook'
Requires-Dist: ipywidgets>=8.1.2; extra == 'notebook'
Requires-Dist: jupyter>=1.0.0; extra == 'notebook'
Description-Content-Type: text/markdown

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# tclab_jupyter

A jupyter based application and library to explore different control techniques of a simple temperature plant.

## Overview

This code was written to showcase an Arduino based Temperature Control Lab (https://apmonitor.com/pdc/index.php/Main/ArduinoTemperatureControl) for a Lecture on Advanced Control Techniques.

The TCLab system is built with two temperature sensors and two heaters. A Matlab or Python interface is provided to read the temperature data from the board and control the heaters power output. A library was created with two entry points, one that aims to control the Arduino System (`HardwareNotebookApp`) and another one replacing the Arduino interface with a simulator (`SimulationNotebookApp`), so the app can be used without the real hardware, as a demonstration.

This project implements four different control techniques (Manual, On-Off, PID and MPC) so the user can test and visualize the differences between them.

There is also a configurations window that presents some parameters that can be adjusted for the whole simulation or for each control technique.

The interface was build using ipywidgets and bqplot. The dynamic plant simulation is done using scipy `odeint` function, whilst the MPC is implemented using the gekko library. For more information regarding the MPC options refer to the gekko documentation (https://gekko.readthedocs.io/en/latest/).

**Dependencies**
- numpy
- scipy
- ipywidgets (https://github.com/jupyter-widgets/ipywidgets)
- bqplot==0.11.9 (https://github.com/bloomberg/bqplot)
- gekko (https://github.com/BYU-PRISM/GEKKO)
- tclab (only for the control_arduino.py)

## Install

```bash
pip install tclab_jupyter
```

## Usage

Import the module and create an object as shown below.
```python
from tclab_jupyter.ui.notebook import SimulationNotebookApp
demo = SimulationNotebookApp()
```

To open the main window, call the app function.
```python
demo.app()
```

<p align="center">
  <img src="https://github.com/evertoncolling/tclab_jupyter/blob/master/img/APP.PNG" alt="App Screenshot">
</p>

To open the configurations window, call the config function.
```python
demo.config()
```

<p align="center">
  <img src="https://github.com/evertoncolling/tclab_jupyter/blob/master/img/CONFIG.PNG" alt="Config Screenshot">
</p>
