{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains material from [cbe30338-2021](https://jckantor.github.io/cbe30338-2021);\n", "content is available [on Github](https://github.com/jckantor/cbe30338-2021.git).*\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [2.3 First Order Model for a Single Heater](https://jckantor.github.io/cbe30338-2021/02.03-First-Order-Model-for-a-Single-Heater.html) | [Contents](toc.html) | [Tag Index](tag_index.html) | [3.0 Feedback Control](https://jckantor.github.io/cbe30338-2021/03.00-Feedback-Control.html) >
"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# IMPORT DATA FILES USED BY THIS NOTEBOOK\n",
"import os, requests\n",
"\n",
"file_links = [(\"data/Model_Data.csv\", \"https://jckantor.github.io/cbe30338-2021/data/Model_Data.csv\")]\n",
"\n",
"# This cell has been added by nbpages. Run this cell to download data files required for this notebook.\n",
"\n",
"for filepath, fileurl in file_links:\n",
" stem, filename = os.path.split(filepath)\n",
" if stem:\n",
" if not os.path.exists(stem):\n",
" os.mkdir(stem)\n",
" if not os.path.isfile(filepath):\n",
" with open(filepath, 'wb') as f:\n",
" response = requests.get(fileurl)\n",
" f.write(response.content)\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 1,
"link": "[2.4 Model Identification for the Temperature Control Lab](https://jckantor.github.io/cbe30338-2021/02.04-Model-Identification.html#2.4-Model-Identification-for-the-Temperature-Control-Lab)",
"section": "2.4 Model Identification for the Temperature Control Lab"
}
},
"source": [
"# 2.4 Model Identification for the Temperature Control Lab\n",
"\n",
"Models are essential for feedback control. It may be difficult to understand where and how the model was incorporated into the control system design, and the model may be just a simplistic cause-and-effect understanding of process operation, but be assured that somewhere in the control system is an embedded understanding of process operation.\n",
"\n",
"The notebook is deep dive in creating models for the dynamic response of the Temperature Control Lab to power inputs and external disturbances. The survey of models include:\n",
"\n",
"* Empirical models, single-input single-output\n",
" * Linear first-order\n",
" * Linear first-order with dead-time\n",
" \n",
"\n",
"* Energy balance models\n",
" * Single-input, single-output\n",
" * First order \n",
" * Second order\n",
" * Multi-input, multi-output\n",
" * Fourth order\n",
"\n",
"\n",
"* State space models"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 2,
"link": "[2.4.1 Accessing experimental data](https://jckantor.github.io/cbe30338-2021/02.04-Model-Identification.html#2.4.1-Accessing-experimental-data)",
"section": "2.4.1 Accessing experimental data"
}
},
"source": [
"## 2.4.1 Accessing experimental data\n",
"\n",
"Data acquired through normal process operation or experimentation will normally be accessed from a process database. Here we demonstrate reading data stored previously stored in a `.csv` file by a process historian."
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpages": {
"level": 3,
"link": "[2.4.1.1 Read data into a Pandas DataFrame](https://jckantor.github.io/cbe30338-2021/02.04-Model-Identification.html#2.4.1.1-Read-data-into-a-Pandas-DataFrame)",
"section": "2.4.1.1 Read data into a Pandas DataFrame"
}
},
"source": [
"### 2.4.1.1 Read data into a Pandas DataFrame\n",
"\n",
"[Pandas](https://pandas.pydata.org/) is one of the most important and widely used Python libraries for data analysis and manipulation. Here we use the library to access a `.csv` file containing previously collected data from a step test of the Temperature Control Lab."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"nbpages": {
"level": 3,
"link": "[2.4.1.1 Read data into a Pandas DataFrame](https://jckantor.github.io/cbe30338-2021/02.04-Model-Identification.html#2.4.1.1-Read-data-into-a-Pandas-DataFrame)",
"section": "2.4.1.1 Read data into a Pandas DataFrame"
}
},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | T1 | \n", "T2 | \n", "Q1 | \n", "Q2 | \n", "
---|---|---|---|---|
Time | \n", "\n", " | \n", " | \n", " | \n", " |
0.0 | \n", "21.221 | \n", "21.446 | \n", "50.0 | \n", "0.0 | \n", "
10.0 | \n", "21.253 | \n", "21.511 | \n", "50.0 | \n", "0.0 | \n", "
20.0 | \n", "22.188 | \n", "21.575 | \n", "50.0 | \n", "0.0 | \n", "
30.0 | \n", "23.477 | \n", "21.672 | \n", "50.0 | \n", "0.0 | \n", "
40.0 | \n", "24.991 | \n", "21.897 | \n", "50.0 | \n", "0.0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
560.0 | \n", "52.803 | \n", "36.722 | \n", "50.0 | \n", "0.0 | \n", "
570.0 | \n", "52.803 | \n", "36.786 | \n", "50.0 | \n", "0.0 | \n", "
580.0 | \n", "52.803 | \n", "36.754 | \n", "50.0 | \n", "0.0 | \n", "
590.0 | \n", "53.028 | \n", "37.012 | \n", "50.0 | \n", "0.0 | \n", "
600.0 | \n", "52.642 | \n", "36.947 | \n", "50.0 | \n", "0.0 | \n", "
61 rows × 4 columns
\n", " "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}