/Reinforcement-Learning

Comparing the performance of Reinforcement learning models to control temperature with that of a PID and a thermostat controller.

Primary LanguageMATLABMIT LicenseMIT

Reinforcement-Learning

Comparing the performance of Reinforcement learning models to control temperature with that of a PID and a thermostat controller. Find video of the training process here.

Find the Google Slides Link to the project presentation here.

Thermostat controller controlling the temperature.

Thermostat controller

PID controller controlling the temperature.

PID controller

DDPG RL Agent controller controlling the temperature.

RL controller

PG RL Agent controller controlling the temperature.

TD3 RL Agent controller controlling the temperature.

DQN RL Agent controller controlling the temperature.

Steps to recreate models:

  1. Open the DDPG Folder and Run sldemo_househeat_data.m, and make sure variables exist on the workspace.

  2. Run house_thermostat.slx to generate a the plots for the control using a regular thermostat.

  3. Run house_PID.slx to generate a the plots for the control using a Discrete PID controller.

  4. ddpg_live(new).mlx live notebook. Start running each cell individually. (Make sure the variable - training is set to true in the notebook.)

  5. Open the Final Folder and first Run sldemo_househeat_data.m, rlwatertank.slx again, pg.m to generate a the plots for the control using a Policy Gradient. DDPG.m to generate a the plots for the control using a Deep Deterministic Policy Gradient. Td3.mto generate a the plots for the control using a Twin Delayed Deep Deeterministic Policy Gradient.

  6. Open the DQN Folder and run first Run sldemo_househeat_data.m, rlwatertank.slx again, dqn.m to generate a the plots for the control using a Deep Q Network.

Warnings:

Make sure to have the following toolkits installed to be able to recreate these simulations successfully:

  1. Reinforcement Learning Toolkit.
  2. Machine Learning Toolkit.
  3. PID Tuner

Run files using MATLAB 2020.

Create your own reward function to tune model results.

You will be able to tune the reward function for the simulation by updating the Reward block in the RL_Heat_DDPG_test.slx file.

Use this link to set up base thermal model of the house from the MATLAB-SIMULINK website.