{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "6f66bb76",
   "metadata": {
    "editable": false
   },
   "source": [
    "## Instructions\n",
    "1. Make sure you are running this in your directory and not trying to use the copy in the shared handout directory. If you are in the shared handout directory quit this worksheet and use the \"move\" option that appears when you check the box next to this notebook in the list of notebooks. Reminder: you will get an error message because you cannot delete the original, but will still get a copy in your home directory.\n",
    "2. This worksheet can be rerun as many times as you want to get more practice.\n",
    "3. **When providing answers this worksheet reports X(t) for what we usually write as $[X]_t$.**\n",
    "4. Run the cell immediately below to initialize the tools needed for this worksheet."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bad6d3bc",
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "from RandomMech import *"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fb370130",
   "metadata": {
    "editable": false
   },
   "source": [
    "#### Practice 1:\n",
    "Run the cell immediately below to generate a relatively simple mechanism to practice writing rate laws for. Then write out what you believe the rate laws are."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "64a8d756",
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "mech1 = randommech(2,2)\n",
    "prettymech(mech1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7fa4cca5",
   "metadata": {
    "editable": false
   },
   "source": [
    "Once you have written the rate laws for the reaction above, run the cell immediately below to get the answer for the correct rate laws. Check your answers against these."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f6f6ef08",
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "laws1 = rxnmechtodiffratelaws(mech1)\n",
    "prettydiffratelaws(laws1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "62e4c3bb",
   "metadata": {
    "editable": false
   },
   "source": [
    "#### Practice 2:\n",
    "Run the cell immediately below to generate a more complex mechanism to practice writing rate laws for. Then write out what you believe the rate laws are."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a7f7df3c",
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "mech2 = randommech(2,4)\n",
    "prettymech(mech2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1ad9cfc1",
   "metadata": {
    "editable": false
   },
   "source": [
    "Once you have written the rate laws for the reaction above, run the cell immediately below to get the answer for the correct rate laws. Check your answers against these."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "57644199",
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "laws2 = rxnmechtodiffratelaws(mech2)\n",
    "prettydiffratelaws(laws2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ae5a2e2f",
   "metadata": {
    "editable": false
   },
   "source": [
    "#### Practice 3:\n",
    "Run the cell immediately below to generate what may be a quite complex mechanism to practice writing rate laws for. Then write out what you believe the rate laws are."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "03570038",
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "mech3 = randommech(4,5)\n",
    "prettymech(mech3)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c1742c1e",
   "metadata": {
    "editable": false
   },
   "source": [
    "Once you have written the rate laws for the reaction above, run the cell immediately below to get the answer for the correct rate laws. Check your answers against these."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3253acb7",
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "laws3 = rxnmechtodiffratelaws(mech3)\n",
    "prettydiffratelaws(laws3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8704fffb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
