{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# HW 6"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can use this document as a template for completing your homework. That is, download this file (link at the top right), and use it to do the problems. You should upload your notebook file to Learning Suite. (Don't put spaces in file names.)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 0\n",
    "\n",
    "Make sure you can open and run notebooks in either VScode (preferred), or Jupyter Lab, or some other program. You need to be able to open existing files, and create and save new files. There needs to be a working Python kernel so you can run code.\n",
    "\n",
    "Just state if you did this: yes or no"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Open and read through a Jupyter notebook. Browse the menus and get familiar with them. Find the keyboard shortcut to run a cell. \n",
    "\n",
    "Just state if you did this: yes or no."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 2\n",
    "\n",
    "A version of the ideal gas law in terms of density is given by\n",
    "$$\\rho = \\frac{MP}{RT},$$\n",
    "where $M$ is the mean molecular weight.\n",
    "\n",
    "Compute the density of air at 300 K, and 0.85 atmospheres (Provo). \n",
    "Use a single print statement so that your answer looks something like\n",
    "```rho = 123.456 kg/m3``` where the number 123.456 will be the actual answer. (Note, I like kg/m3 more than kg/m^3. The latter is clunky and everyone knows what you mean by kg/m3.)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 3\n",
    "\n",
    "Redo Problem 3 from HW 2 using Python"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The Redlich-Kwong (RK) equation is more accurate than the Ideal Gas Law because it allows for molecular interactions at high pressures. The RK equation of state and the ideal gas law, are, respectively:\n",
    "$$P_{RK} = \\frac{RT}{V-b}-\\frac{a}{V(V+b)\\sqrt{T}}$$\n",
    "$$P_{IG} = \\frac{RT}{V}$$\n",
    "Here, $V$ is molar volume. Also,\n",
    "$$a = 0.427 R^2T_c^{2.5}/P_c,$$\n",
    "$$b = 0.0866 RT_c/P_c,$$\n",
    "$$R = 0.0821\\,\\,\\text{liter-atm/K}.$$\n",
    "\n",
    "Code up these equations. Make sure to document your code by including units and variable descriptions. If you write $P_c$ $T_c$, and $R$ with units listed, you don't need to put the units on everything derived from them, like a, and b. Evaluate $P_{RK}$, and $P_{IG}$ for air for $T=500$ K, $V=5$ L/mol, $P_c=37.2$ atm, and $T_c=132.5$ K. Report the pressures in units of Pa. You should convert the units when declaring a varialbe, like this:\n",
    "\n",
    "```P_c = 37.2 * 101325           # Critical pressure (Pa).```\n",
    "\n",
    "In reporting the pressures, use a print statement so the output looks like:\n",
    "\n",
    "```The RK pressure is #### (Pa)```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "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.14.7"
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
