{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Legendre transformation\n", "\n", "A legendre transformation is used in thermodynamics to derive different relation from one **fundamental** relation, the *internal energy*. \n", "The *internal energy* is defined as: \n", "\n", "$$ U(S,V) = TS - pV \\\\\n", "dU = TdS - pdV $$\n", "\n", "and comprises the heat given *to* the system (TdS) and the volumetric work done *by* the system (PdV), all in Joule. These two terms, TdS and pdV are sets of *conjugate variables*.\n", "\n", "By transforming the internal energy, we can arrive at other thermodynamic expressions, such as Helmholtz Energy (F(T,V)), Enthalpy (H(S,p)), or Gibbs Free Energy (G(T,p)). These expressions also consist of pairs of conjugate variables, which differ from the conjugate variables of the internal energy. \n", "\n", "So, basically the legendre transformation transforms a function of a set of variables (internal energy) to another function of a set of *conjugate* variables (Helmholtz Energy, Enthalpy, etc). \n", "\n", "Below you see an example of how calculate the (change in) internal energy of a system. Assume we have a baloon filled with a gas. Its volume is reduced and it transferres heat to its surroundings. What is the change in internal energy?\n", "" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The change in internal energy equals 49.983 kilo Joule.\n" ] } ], "source": [ "# Example calculation of Internal energy and Work done\n", "pext = 1.01325e5 # external, atmospheric pressure in Pascal\n", "q = -680 # heat transferred to surroundings in Joule. As heat is given BY the system, it is negative\n", "v1 = 1.2 # volume 1 in m³\n", "v2 = 0.7 # volume 2 in m³\n", "\n", "## We calculate the change in internal energy dU = TdS - pdV --> dV is negative, because the baloon shrinks\n", "dU = q - pext * (v2 - v1)\n", "print(\"The change in internal energy equals %.3f kilo Joule.\" % (dU/1000.))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Conjugate variables\n", "A force is always accompanied by a displacement. Those two together are called a pair of *conjugate variables*. For example, pressure *p* and volume *V* are such a conjugate pair. \n", "\n", "An applied pressure (*p*) causes a change in volume (*dV*).\n", "\n", "\n", "So all in all, the legendre transformation, is all about the product rule: \n", "\n", "If (x,y) is a set of conjugate variables, then their total differential is \n", "\n", "$$ d(xy) = xdy + ydx $$\n", "\n", "This expression relates the variation dy in quantity y to the variation dx in quantitiy x. \n", "If we apply the product rule to a function f(x,y), we get\n", "\n", "$$ df(x,y) = \\bigg(\\frac{\\partial f}{\\partial x} \\bigg)_y dx + \\bigg(\\frac{\\partial f}{\\partial y}\\bigg)_x dy $$\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The full legendre transformation is defined as: \n", "\n", "$$ \\tau(\\sigma,\\omega) = f(x,y) - \\bigg(\\frac{\\partial f}{\\partial x} \\bigg)_y - \\bigg(\\frac{\\partial f}{\\partial y} \\bigg)_x $$ \n", "\n", "The second term on the right side is for transforming $x$ into $\\sigma$, and the third term transforms $y$ into $\\omega$. Now, if two thermodynamic expressions share a variable (e.g. U(S,V) and F(T,V)), meaning $y == \\omega$), that dimension of the full legendre transformation is neglected. \n", "So to get the Helmoltz energy from the internal energy, the Legendre transformation reduces to: \n", "\n", "$$ \\tau(\\sigma,\\omega) = f(x,y) - \\bigg(\\frac{\\partial f}{\\partial x} \\bigg)_y \\text{ with $\\omega$ = y}$$ " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Maxwell Relations\n", "Maxwell relations are used to relate thermodynamic expressions to quantities such as entropy, temperature, pressure, or volume. They are used to relate directly measurable quantities to thermodynamic quantities, which may not be directly accessible in experiments (like chemical potential or entropy). \n", "\n", "They give another way of looking at thermodynamic processes. Maxwell relations can be derived by the schwarz theorem: \n", "\n", "$$ \\bigg[\\frac{\\partial}{\\partial y} \\bigg(\\frac{\\partial f}{\\partial x} \\bigg)_y \\bigg]_x = \n", "\\bigg[\\frac{\\partial}{\\partial x} \\bigg(\\frac{\\partial f}{\\partial y} \\bigg)_x \\bigg]_y$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Measurable thermodynamic response functions\n", "*Response functions* are called that way because they measure a change in system quantity *in response* to an infinitesimal pertubation. \n", "As said, Maxwell relations relate measurable variables like temperature, pressure to more abstract quantities. Or differently phrased: \n", "\n", "Maxwell relations allow expressions of experimentally inaccessible quantities in terms of experimentally measurable response functions. \n", "\n", "
\n", "\n", "
\n", "$c_v = \\bigg(\\frac{\\partial U}{\\partial T}\\bigg)_V = T \\bigg(\\frac{\\partial S}{\\partial T}\\bigg)_V$ const. volume heat capacity \n", "
\n", "
\n", "
\n", "$c_p = \\bigg(\\frac{\\partial H}{\\partial T}\\bigg)_p = T \\bigg(\\frac{\\partial S}{\\partial T}\\bigg)_p$ const. pressure heat capacity \n", "
\n", "
\n", "
\n", "$K_T = -\\frac{1}{V} \\bigg(\\frac{\\partial V}{\\partial p}\\bigg)_T = - \\bigg(\\frac{\\partial ln(V)}{\\partial p}\\bigg)_T$ isothermal compressibility \n", "
\n", "
\n", "
\n", "$\\alpha_p = \\frac{1}{V} \\bigg(\\frac{\\partial V}{\\partial T}\\bigg)_p = \\bigg(\\frac{\\partial ln(V)}{\\partial T}\\bigg)_p$ thermal expansion coefficient \n", "
" ] } ], "metadata": { "anaconda-cloud": {}, "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.6.8" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "toc": { "colors": { "hover_highlight": "#DAA520", "navigate_num": "#000000", "navigate_text": "#333333", "running_highlight": "#FF0000", "selected_highlight": "#FFD700", "sidebar_border": "#EEEEEE", "wrapper_background": "#FFFFFF" }, "moveMenuLeft": true, "nav_menu": { "height": "80px", "width": "253px" }, "navigate_menu": true, "number_sections": false, "sideBar": true, "threshold": 4, "toc_cell": false, "toc_section_display": "block", "toc_window_display": false, "widenNotebook": false } }, "nbformat": 4, "nbformat_minor": 1 }