{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "(lecture04:homework)=\n", "# Homework 4\n", "\n", "## Instructions\n", "\n", "+ Type your name and email in the \"Student details\" section below.\n", "+ Develop the code and generate the figures you need to solve the problems using this notebook.\n", "+ For the answers that require a mathematical proof or derivation you can either:\n", " \n", " - Type the answer using the built-in latex capabilities. In this case, simply export the notebook as a pdf and upload it on gradescope; or\n", " - You can print the notebook (after you are done with all the code), write your answers by hand, scan, turn your response to a single pdf, and upload on gradescope.\n", "\n", "+ The total homework points are 100. Please note that the problems are not weighed equally.\n", "\n", "```{note}\n", "+ This is due before the beginning of the next lecture.\n", "+ Please match all the pages corresponding to each of the questions when you submit on gradescope.\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Student details\n", "\n", "+ **First Name:**\n", "+ **Last Name:**\n", "+ **Email:**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let me set you up with some nice code for plotting and downloading files." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "import seaborn as sns\n", "sns.set(rc={\"figure.dpi\":100, 'savefig.dpi':300})\n", "sns.set_context('notebook')\n", "sns.set_style(\"ticks\")\n", "from IPython.display import set_matplotlib_formats\n", "set_matplotlib_formats('retina', 'svg')\n", "\n", "import requests\n", "import os\n", "\n", "def download(url, local_filename=None):\n", " \"\"\"\n", " Downloads the file in the ``url`` and saves it in the current working directory.\n", " \"\"\"\n", " data = requests.get(url)\n", " if local_filename is None:\n", " local_filename = os.path.basename(url)\n", " with open(local_filename, 'wb') as fd:\n", " fd.write(data.content)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem 1 - Visual analysis of a variable-speed compressor experiment\n", "\n", "In this problem we are going to need [this](https://raw.githubusercontent.com/PurdueMechanicalEngineering/me-297-intro-to-data-science/master/data/compressor_data.xlsx) dataset. The dataset was kindly provided to us by [Professor Davide Ziviani](https://scholar.google.com/citations?user=gPdAtg0AAAAJ&hl=en).\n", "As before, you can either put it on your Google drive or just download it with the code segment below:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | T_e | \n", "DT_sh | \n", "T_c | \n", "DT_sc | \n", "T_amb | \n", "f | \n", "m_dot | \n", "m_dot.1 | \n", "Capacity | \n", "Power | \n", "Current | \n", "COP | \n", "Efficiency | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "-30 | \n", "11 | \n", "25 | \n", "8 | \n", "35 | \n", "60 | \n", "28.8 | \n", "8.000000 | \n", "1557 | \n", "901 | \n", "4.4 | \n", "1.73 | \n", "0.467 | \n", "
1 | \n", "-30 | \n", "11 | \n", "30 | \n", "8 | \n", "35 | \n", "60 | \n", "23.0 | \n", "6.388889 | \n", "1201 | \n", "881 | \n", "4.0 | \n", "1.36 | \n", "0.425 | \n", "
2 | \n", "-30 | \n", "11 | \n", "35 | \n", "8 | \n", "35 | \n", "60 | \n", "17.9 | \n", "4.972222 | \n", "892 | \n", "858 | \n", "3.7 | \n", "1.04 | \n", "0.382 | \n", "
3 | \n", "-25 | \n", "11 | \n", "25 | \n", "8 | \n", "35 | \n", "60 | \n", "46.4 | \n", "12.888889 | \n", "2509 | \n", "1125 | \n", "5.3 | \n", "2.23 | \n", "0.548 | \n", "
4 | \n", "-25 | \n", "11 | \n", "30 | \n", "8 | \n", "35 | \n", "60 | \n", "40.2 | \n", "11.166667 | \n", "2098 | \n", "1122 | \n", "5.1 | \n", "1.87 | \n", "0.519 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
60 | \n", "10 | \n", "11 | \n", "45 | \n", "8 | \n", "35 | \n", "60 | \n", "245.2 | \n", "68.111111 | \n", "12057 | \n", "2525 | \n", "11.3 | \n", "4.78 | \n", "0.722 | \n", "
61 | \n", "10 | \n", "11 | \n", "50 | \n", "8 | \n", "35 | \n", "60 | \n", "234.1 | \n", "65.027778 | \n", "10939 | \n", "2740 | \n", "12.3 | \n", "3.99 | \n", "0.719 | \n", "
62 | \n", "10 | \n", "11 | \n", "55 | \n", "8 | \n", "35 | \n", "60 | \n", "222.2 | \n", "61.722222 | \n", "9819 | \n", "2929 | \n", "13.1 | \n", "3.35 | \n", "0.709 | \n", "
63 | \n", "10 | \n", "11 | \n", "60 | \n", "8 | \n", "35 | \n", "60 | \n", "209.3 | \n", "58.138889 | \n", "8697 | \n", "3091 | \n", "13.7 | \n", "2.81 | \n", "0.693 | \n", "
64 | \n", "10 | \n", "11 | \n", "65 | \n", "8 | \n", "35 | \n", "60 | \n", "195.4 | \n", "54.277778 | \n", "7575 | \n", "3223 | \n", "14.2 | \n", "2.35 | \n", "0.672 | \n", "
65 rows × 13 columns
\n", "