{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Computing standard thermodynamic properties of species\n", "\n", "

Written by Allan Leal (ETH Zurich) on Jan 20th, 2022

\n", "\n", "```{attention}\n", "Always make sure you are using the [latest version of Reaktoro](https://anaconda.org/conda-forge/reaktoro). Otherwise, some new features documented on this website will not work on your machine and you may receive unintuitive errors. Follow these [update instructions](updating_reaktoro_via_conda) to get the latest version of Reaktoro!\n", "```\n", "\n", "This tutorial demonstrates the use of Reaktoro for the computation of standard thermodynamic properties of chemical species such as:\n", "\n", "* the standard molar Gibbs energy, $G_i^\\circ$\n", "* the standard molar Helmholtz energy, $A_i^\\circ$\n", "* the standard molar enthalpy, $H_i^\\circ$\n", "* the standard molar internal energy, $U_i^\\circ$\n", "* the standard molar entropy, $S_i^\\circ$\n", "* the standard molar volume, $V_i^\\circ$\n", "* the standard molar heat capacity (constant pressure), $C_{P,i}^\\circ$\n", "* the standard molar heat capacity (constant volume), $C_{V,i}^\\circ$\n", "\n", "Let's start with the use of the SUPCRTBL database {cite}`Zimmer2016a` to compute the standard thermodynamic properties of the following chemical species:\n", "\n", "* CO{{_2}}(aq)\n", "* CO{{_2}}(g)\n", "* Calcite" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from reaktoro import *\n", "\n", "db = SupcrtDatabase(\"supcrtbl\")\n", "\n", "CO2g = db.species(\"CO2(g)\")\n", "CO2aq = db.species(\"CO2(aq)\")\n", "calcite = db.species(\"Calcite\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can now use method `props` in the {{Species}} class to compute the standard thermodynamic properties of these species at 60 °C and 100 bar:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "STANDARD THERMODYNAMIC PROPERTIES OF CO2(G) AT 60 °C AND 100 BAR\n", "+------------------------------------------+---------+-------------+\n", "| Property | Value | Unit |\n", "+------------------------------------------+---------+-------------+\n", "| Temperature | 333.15 | K |\n", "| Pressure | 1e+07 | Pa |\n", "| Standard Gibbs Energy | -401904 | J/mol |\n", "| Standard Enthalpy | -392186 | J/mol |\n", "| Standard Volume | 0 | m3/mol |\n", "| Standard Volume (Temperature Derivative) | 0 | m3/(mol*K) |\n", "| Standard Volume (Pressure Derivative) | 0 | m3/(mol*Pa) |\n", "| Standard Isobaric Heat Capacity | 38.5567 | J/(mol*K) |\n", "| Standard Isochoric Heat Capacity | 38.5567 | J/(mol*K) |\n", "| Standard Internal Energy | -392186 | J/mol |\n", "| Standard Entropy | 29.1699 | J/(mol*K) |\n", "| Standard Helmholtz Energy | -401904 | J/mol |\n", "+------------------------------------------+---------+-------------+\n", "STANDARD THERMODYNAMIC PROPERTIES OF CO2(AQ) AT 60 °C AND 100 BAR\n", "+------------------------------------------+--------------+-------------+\n", "| Property | Value | Unit |\n", "+------------------------------------------+--------------+-------------+\n", "| Temperature | 333.15 | K |\n", "| Pressure | 1e+07 | Pa |\n", "| Standard Gibbs Energy | -390193 | J/mol |\n", "| Standard Enthalpy | -405930 | J/mol |\n", "| Standard Volume | 3.43478e-05 | m3/mol |\n", "| Standard Volume (Temperature Derivative) | 3.31002e-08 | m3/(mol*K) |\n", "| Standard Volume (Pressure Derivative) | -2.62559e-14 | m3/(mol*Pa) |\n", "| Standard Isobaric Heat Capacity | 203.77 | J/(mol*K) |\n", "| Standard Isochoric Heat Capacity | 189.868 | J/(mol*K) |\n", "| Standard Internal Energy | -406274 | J/mol |\n", "| Standard Entropy | -47.2375 | J/(mol*K) |\n", "| Standard Helmholtz Energy | -390537 | J/mol |\n", "+------------------------------------------+--------------+-------------+\n", "STANDARD THERMODYNAMIC PROPERTIES OF CALCITE AT 60 °C AND 100 BAR\n", "+------------------------------------------+--------------+-------------+\n", "| Property | Value | Unit |\n", "+------------------------------------------+--------------+-------------+\n", "| Temperature | 333.15 | K |\n", "| Pressure | 1e+07 | Pa |\n", "| Standard Gibbs Energy | -1.13263e+06 | J/mol |\n", "| Standard Enthalpy | -1.20455e+06 | J/mol |\n", "| Standard Volume | 3.69181e-05 | m3/mol |\n", "| Standard Volume (Temperature Derivative) | 0 | m3/(mol*K) |\n", "| Standard Volume (Pressure Derivative) | 0 | m3/(mol*Pa) |\n", "| Standard Isobaric Heat Capacity | 86.9803 | J/(mol*K) |\n", "| Standard Isochoric Heat Capacity | 86.9803 | J/(mol*K) |\n", "| Standard Internal Energy | -1.20492e+06 | J/mol |\n", "| Standard Entropy | -215.868 | J/(mol*K) |\n", "| Standard Helmholtz Energy | -1.133e+06 | J/mol |\n", "+------------------------------------------+--------------+-------------+\n" ] } ], "source": [ "print(\"STANDARD THERMODYNAMIC PROPERTIES OF CO2(G) AT 60 °C AND 100 BAR\")\n", "print(CO2g.props(60, \"C\", 100, \"bar\"))\n", "\n", "print(\"STANDARD THERMODYNAMIC PROPERTIES OF CO2(AQ) AT 60 °C AND 100 BAR\")\n", "print(CO2aq.props(60, \"C\", 100, \"bar\"))\n", "\n", "print(\"STANDARD THERMODYNAMIC PROPERTIES OF CALCITE AT 60 °C AND 100 BAR\")\n", "print(calcite.props(60, \"C\", 100, \"bar\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now let's calculate the standard thermodynamic properties of CO{{_2}}(aq) from 25 to 300 °C along the saturation pressure of water. The code block below will build a Python dictionary containing data that we will plot later (i.e., the standard molar Gibbs energy and standard molar enthalpy of the species CO{{_2}}(aq) and the temperatures used to calculate these properties):" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "\n", "temperatures = np.linspace(25.0, 300.0, 100) + 273.15 # in K\n", "\n", "data = { \"T\": [], \"G0\": [], \"H0\": [] }\n", "\n", "for T in temperatures:\n", " P = waterSaturationPressureWagnerPruss(T) # in Pa\n", " props = CO2aq.props(T, P)\n", " data[\"T\" ].append(float(T - 273.15)) # in °C\n", " data[\"G0\"].append(float(props.G0 * 0.001)) # in kJ/mol\n", " data[\"H0\"].append(float(props.H0 * 0.001)) # in kJ/mol" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```{tip}\n", "You might also be interested in other methods for calculating the thermodynamic properties of water besides `waterSaturationPressureWagnerPruss`, which implements the water saturation pressure equation in {cite:t}`Wagner2002`. Below are other methods available in Reaktoro:\n", "\n", "* `waterDensityHGK`\n", "* `waterDensityWagnerPruss`\n", "* `waterLiquidDensityHGK`\n", "* `waterLiquidDensityWagnerPruss`\n", "* `waterVaporDensityHGK`\n", "* `waterVaporDensityWagnerPruss`\n", "* `waterPressureHGK`\n", "* `waterPressureWagnerPruss`\n", "* `waterSaturationPressureWagnerPruss`\n", "* `waterSaturationLiquidDensityWagnerPruss`\n", "* `waterSaturationVapourDensityWagnerPruss`\n", "* `waterThermoPropsHGK`\n", "* `waterThermoPropsWagnerPruss`\n", "\n", "Search for these method names in [Reaktoro's API Reference](https://reaktoro.org/api/) to learn more about how to use them.\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We'll use the [bokeh](https://bokeh.org/) plotting library next. First, we need to import it and initialize it to work with Jupyter Notebooks:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n const force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n const JS_MIME_TYPE = 'application/javascript';\n const HTML_MIME_TYPE = 'text/html';\n const EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n const CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n const script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n const cell = handle.cell;\n\n const id = cell.output_area._bokeh_element_id;\n const server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n const cmd_clean = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd_clean, {\n iopub: {\n output: function(msg) {\n const id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n const cmd_destroy = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd_destroy);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n const output_area = handle.output_area;\n const output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n const toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n const bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n const script_attrs = bk_div.children[0].attributes;\n for (let i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n const toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n const props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n const events = require('base/js/events');\n const OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n const NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n const el = document.getElementById(\"1002\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n const js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.2.min.js\"];\n const css_urls = [];\n \n\n const inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (let i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n const cell = $(document.getElementById(\"1002\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from bokeh.plotting import figure, show\n", "from bokeh.models import HoverTool\n", "from bokeh.io import output_notebook\n", "output_notebook()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can now define our interactive plot:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "(function(root) {\n function embed_document(root) {\n \n const docs_json = {\"349beb0e-88bc-4a19-b040-6e40f5ce22c8\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2071\"}],\"center\":[{\"id\":\"2074\"},{\"id\":\"2078\"},{\"id\":\"2111\"}],\"left\":[{\"id\":\"2075\"}],\"renderers\":[{\"id\":\"2099\"},{\"id\":\"2118\"}],\"sizing_mode\":\"scale_width\",\"title\":{\"id\":\"2061\"},\"toolbar\":{\"id\":\"2086\"},\"x_range\":{\"id\":\"2063\"},\"x_scale\":{\"id\":\"2067\"},\"y_range\":{\"id\":\"2065\"},\"y_scale\":{\"id\":\"2069\"}},\"id\":\"2060\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2063\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2109\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2067\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"2075\"},\"coordinates\":null,\"dimension\":1,\"group\":null,\"ticker\":null},\"id\":\"2078\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2079\",\"type\":\"PanTool\"},{\"attributes\":{\"coordinates\":null,\"group\":null,\"items\":[{\"id\":\"2112\"},{\"id\":\"2132\"}]},\"id\":\"2111\",\"type\":\"Legend\"},{\"attributes\":{\"data\":{\"G0\":[-385.9771767699132,-386.30687257624396,-386.64265510839425,-386.9843416950836,-387.3317660669607,-387.6847761600494,-388.04323228308175,-388.4070055742092,-388.77597669620354,-389.1500347254892,-389.5290762028274,-389.9130043167122,-390.30172819930215,-390.6951623148727,-391.0932259279476,-391.4958426383583,-391.90293997304025,-392.3144490268058,-392.73030414485623,-393.15044264146917,-393.57480454983624,-394.0033323990366,-394.43597101456726,-394.87266733963094,-395.3133702743612,-395.75803053106705,-396.20660050352944,-396.65903414858127,-397.1152868788791,-397.5753154653095,-398.03907794823084,-398.50653355645034,-398.9776426332383,-399.45236656858646,-399.9306677371364,-400.4125094412002,-400.8978558583662,-401.3866719933151,-401.8789236333882,-402.3745773076211,-402.8736002489135,-403.3759603590605,-403.8816261764186,-404.3905668459617,-404.9027520915664,-405.4181521903086,-405.93673794866055,-406.4584806804032,-406.9833521861546,-407.5113247343873,-408.042371043831,-408.5764642671742,-409.113577975973,-409.65368614669757,-410.1967631478451,-410.74278372806316,-411.2917230052244,-411.8435564564141,-412.3982599087782,-412.9558095312072,-413.5161818268195,-414.0793536262193,-414.6453020815099,-415.214004661053,-415.78543914494986,-416.359583621258,-416.9364164829304,-417.5159164254869,-418.0980624454324,-418.6828338394396,-419.2702102043167,-419.86017143779924,-420.45269774020124,-421.04776961697905,-421.6453678822668,-422.24547366345456,-422.8480684068955,-423.45313388484067,-424.0606522037222,-424.67060581391644,-425.28297752115634,-425.89775049977544,-426.5149083080042,-427.13443490558166,-427.75631467397733,-428.3805324395841,-429.0070735002947,-429.6359236559557,-430.2670692432773,-430.9004971758854,-431.53619499033476,-432.17415089905484,-432.81435385139036,-433.45679360414044,-434.1014608032813,-434.748347078922,-435.39744515599267,-436.0487489837325,-436.7022538877712,-437.3579567495334],\"H0\":[-413.79894079361713,-413.13177745643833,-412.4792480169194,-411.83979388024886,-411.21206928556694,-410.5949061278658,-409.9872855272911,-409.38831468692047,-408.79720792321655,-408.2132710185576,-407.6358882345542,-407.06451147418625,-406.4986511871224,-405.9378687015248,-405.38176972613826,-404.829998819856,-404.28223466492994,-403.7381860101409,-403.1975881758793,-402.6602000320046,-402.1258013755163,-401.59419064740285,-401.0651829385073,-400.5386082422353,-400.01430991933785,-399.49214334486896,-398.9719747124964,-398.45367997523897,-397.9371439042401,-397.4222592507243,-396.9089259976622,-396.3970506901375,-395.88654583456173,-395.377329358487,-394.86932412369725,-394.36245748631353,-393.85666089846234,-393.3518695466276,-392.84802202259954,-392.3450600232519,-391.8429280759299,-391.34157328658034,-390.8409451080514,-390.3409951263272,-389.84167686262117,-389.3429455895683,-388.8447581598047,-388.34707284551234,-387.84984918753156,-387.3530478528128,-386.85663049906196,-386.3605596455004,-385.8647985487405,-385.36931108282056,-384.87406162248715,-384.37901492882986,-383.884136036407,-383.3893901409779,-382.89474248698644,-382.40015825387746,-381.90560244033844,-381.41103974548463,-380.91643444596355,-380.4217502678543,-379.9269502521978,-379.43199661280187,-378.9368505849021,-378.44147226306114,-377.94582042649483,-377.449852349792,-376.9535235967329,-376.4567877945725,-375.95959638578705,-375.4618983538425,-374.9636399189867,-374.46476419947714,-373.9652108328654,-373.46491555110276,-372.9638097021403,-372.46181970943974,-371.95886645925106,-371.4548646036912,-370.9497217653923,-370.4433376267769,-369.9356028837004,-369.4263980391385,-368.9155920075981,-368.4030404947659,-367.8885841092541,-367.3720461537473,-366.85323003086023,-366.3319161839099,-365.8078584735762,-365.28077986684445,-364.7503672829563,-364.21626539989285,-363.6780691708845,-363.135314728786,-362.5874682600477,-362.03391229943344],\"T\":[25.0,27.77777777777777,30.555555555555543,33.333333333333314,36.111111111111086,38.888888888888914,41.666666666666686,44.44444444444446,47.22222222222223,50.0,52.77777777777777,55.55555555555554,58.333333333333314,61.111111111111086,63.888888888888914,66.66666666666663,69.44444444444446,72.22222222222223,75.0,77.77777777777777,80.55555555555554,83.33333333333331,86.11111111111109,88.88888888888891,91.66666666666663,94.44444444444446,97.22222222222223,100.0,102.77777777777777,105.55555555555554,108.33333333333331,111.11111111111109,113.88888888888891,116.66666666666663,119.44444444444446,122.22222222222223,125.0,127.77777777777777,130.55555555555554,133.33333333333331,136.1111111111111,138.8888888888889,141.66666666666663,144.44444444444446,147.22222222222223,150.0,152.77777777777777,155.55555555555554,158.33333333333331,161.1111111111111,163.8888888888889,166.66666666666663,169.44444444444446,172.22222222222223,175.0,177.77777777777777,180.55555555555554,183.33333333333331,186.1111111111111,188.8888888888889,191.66666666666663,194.44444444444446,197.22222222222223,200.0,202.77777777777777,205.55555555555554,208.33333333333331,211.1111111111111,213.8888888888889,216.66666666666663,219.44444444444446,222.22222222222223,225.0,227.77777777777777,230.55555555555554,233.33333333333331,236.1111111111111,238.8888888888889,241.66666666666663,244.44444444444446,247.22222222222229,250.0,252.77777777777771,255.55555555555554,258.33333333333337,261.1111111111111,263.8888888888889,266.66666666666663,269.44444444444446,272.2222222222222,275.0,277.7777777777777,280.55555555555554,283.33333333333337,286.1111111111111,288.8888888888888,291.66666666666663,294.44444444444446,297.2222222222223,300.0]},\"selected\":{\"id\":\"2109\"},\"selection_policy\":{\"id\":\"2108\"}},\"id\":\"2094\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2076\",\"type\":\"BasicTicker\"},{\"attributes\":{\"line_alpha\":0.2,\"line_cap\":\"round\",\"line_color\":\"orange\",\"line_width\":5,\"x\":{\"field\":\"T\"},\"y\":{\"field\":\"H0\"}},\"id\":\"2117\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2106\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"coordinates\":null,\"data_source\":{\"id\":\"2113\"},\"glyph\":{\"id\":\"2115\"},\"group\":null,\"hover_glyph\":null,\"muted_glyph\":{\"id\":\"2117\"},\"nonselection_glyph\":{\"id\":\"2116\"},\"view\":{\"id\":\"2119\"}},\"id\":\"2118\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_cap\":\"round\",\"line_color\":\"orange\",\"line_width\":5,\"x\":{\"field\":\"T\"},\"y\":{\"field\":\"H0\"}},\"id\":\"2115\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.1,\"line_cap\":\"round\",\"line_color\":\"orange\",\"line_width\":5,\"x\":{\"field\":\"T\"},\"y\":{\"field\":\"H0\"}},\"id\":\"2116\",\"type\":\"Line\"},{\"attributes\":{\"bottom_units\":\"screen\",\"coordinates\":null,\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"group\":null,\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2085\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"2107\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2083\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2082\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"Temperature\",\"@T \\u00b0C\"],[\"G\\u00b0,CO2(aq)\",\"@G0 kJ/mol\"],[\"H\\u00b0,CO2(aq)\",\"@H0 kJ/mol\"]]},\"id\":\"2059\",\"type\":\"HoverTool\"},{\"attributes\":{\"label\":{\"value\":\"H\\u00b0,CO2(aq)\"},\"renderers\":[{\"id\":\"2118\"}]},\"id\":\"2132\",\"type\":\"LegendItem\"},{\"attributes\":{\"overlay\":{\"id\":\"2085\"}},\"id\":\"2081\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2080\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"line_cap\":\"round\",\"line_color\":\"midnightblue\",\"line_width\":5,\"x\":{\"field\":\"T\"},\"y\":{\"field\":\"G0\"}},\"id\":\"2096\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2069\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2084\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"2065\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2129\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"2113\"}},\"id\":\"2119\",\"type\":\"CDSView\"},{\"attributes\":{\"line_alpha\":0.2,\"line_cap\":\"round\",\"line_color\":\"midnightblue\",\"line_width\":5,\"x\":{\"field\":\"T\"},\"y\":{\"field\":\"G0\"}},\"id\":\"2098\",\"type\":\"Line\"},{\"attributes\":{\"source\":{\"id\":\"2094\"}},\"id\":\"2100\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2130\",\"type\":\"Selection\"},{\"attributes\":{\"line_alpha\":0.1,\"line_cap\":\"round\",\"line_color\":\"midnightblue\",\"line_width\":5,\"x\":{\"field\":\"T\"},\"y\":{\"field\":\"G0\"}},\"id\":\"2097\",\"type\":\"Line\"},{\"attributes\":{\"tools\":[{\"id\":\"2079\"},{\"id\":\"2080\"},{\"id\":\"2081\"},{\"id\":\"2082\"},{\"id\":\"2083\"},{\"id\":\"2084\"},{\"id\":\"2059\"}]},\"id\":\"2086\",\"type\":\"Toolbar\"},{\"attributes\":{\"label\":{\"value\":\"G\\u00b0,CO2(aq)\"},\"renderers\":[{\"id\":\"2099\"}]},\"id\":\"2112\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"2104\",\"type\":\"AllLabels\"},{\"attributes\":{\"data\":{\"G0\":[-385.9771767699132,-386.30687257624396,-386.64265510839425,-386.9843416950836,-387.3317660669607,-387.6847761600494,-388.04323228308175,-388.4070055742092,-388.77597669620354,-389.1500347254892,-389.5290762028274,-389.9130043167122,-390.30172819930215,-390.6951623148727,-391.0932259279476,-391.4958426383583,-391.90293997304025,-392.3144490268058,-392.73030414485623,-393.15044264146917,-393.57480454983624,-394.0033323990366,-394.43597101456726,-394.87266733963094,-395.3133702743612,-395.75803053106705,-396.20660050352944,-396.65903414858127,-397.1152868788791,-397.5753154653095,-398.03907794823084,-398.50653355645034,-398.9776426332383,-399.45236656858646,-399.9306677371364,-400.4125094412002,-400.8978558583662,-401.3866719933151,-401.8789236333882,-402.3745773076211,-402.8736002489135,-403.3759603590605,-403.8816261764186,-404.3905668459617,-404.9027520915664,-405.4181521903086,-405.93673794866055,-406.4584806804032,-406.9833521861546,-407.5113247343873,-408.042371043831,-408.5764642671742,-409.113577975973,-409.65368614669757,-410.1967631478451,-410.74278372806316,-411.2917230052244,-411.8435564564141,-412.3982599087782,-412.9558095312072,-413.5161818268195,-414.0793536262193,-414.6453020815099,-415.214004661053,-415.78543914494986,-416.359583621258,-416.9364164829304,-417.5159164254869,-418.0980624454324,-418.6828338394396,-419.2702102043167,-419.86017143779924,-420.45269774020124,-421.04776961697905,-421.6453678822668,-422.24547366345456,-422.8480684068955,-423.45313388484067,-424.0606522037222,-424.67060581391644,-425.28297752115634,-425.89775049977544,-426.5149083080042,-427.13443490558166,-427.75631467397733,-428.3805324395841,-429.0070735002947,-429.6359236559557,-430.2670692432773,-430.9004971758854,-431.53619499033476,-432.17415089905484,-432.81435385139036,-433.45679360414044,-434.1014608032813,-434.748347078922,-435.39744515599267,-436.0487489837325,-436.7022538877712,-437.3579567495334],\"H0\":[-413.79894079361713,-413.13177745643833,-412.4792480169194,-411.83979388024886,-411.21206928556694,-410.5949061278658,-409.9872855272911,-409.38831468692047,-408.79720792321655,-408.2132710185576,-407.6358882345542,-407.06451147418625,-406.4986511871224,-405.9378687015248,-405.38176972613826,-404.829998819856,-404.28223466492994,-403.7381860101409,-403.1975881758793,-402.6602000320046,-402.1258013755163,-401.59419064740285,-401.0651829385073,-400.5386082422353,-400.01430991933785,-399.49214334486896,-398.9719747124964,-398.45367997523897,-397.9371439042401,-397.4222592507243,-396.9089259976622,-396.3970506901375,-395.88654583456173,-395.377329358487,-394.86932412369725,-394.36245748631353,-393.85666089846234,-393.3518695466276,-392.84802202259954,-392.3450600232519,-391.8429280759299,-391.34157328658034,-390.8409451080514,-390.3409951263272,-389.84167686262117,-389.3429455895683,-388.8447581598047,-388.34707284551234,-387.84984918753156,-387.3530478528128,-386.85663049906196,-386.3605596455004,-385.8647985487405,-385.36931108282056,-384.87406162248715,-384.37901492882986,-383.884136036407,-383.3893901409779,-382.89474248698644,-382.40015825387746,-381.90560244033844,-381.41103974548463,-380.91643444596355,-380.4217502678543,-379.9269502521978,-379.43199661280187,-378.9368505849021,-378.44147226306114,-377.94582042649483,-377.449852349792,-376.9535235967329,-376.4567877945725,-375.95959638578705,-375.4618983538425,-374.9636399189867,-374.46476419947714,-373.9652108328654,-373.46491555110276,-372.9638097021403,-372.46181970943974,-371.95886645925106,-371.4548646036912,-370.9497217653923,-370.4433376267769,-369.9356028837004,-369.4263980391385,-368.9155920075981,-368.4030404947659,-367.8885841092541,-367.3720461537473,-366.85323003086023,-366.3319161839099,-365.8078584735762,-365.28077986684445,-364.7503672829563,-364.21626539989285,-363.6780691708845,-363.135314728786,-362.5874682600477,-362.03391229943344],\"T\":[25.0,27.77777777777777,30.555555555555543,33.333333333333314,36.111111111111086,38.888888888888914,41.666666666666686,44.44444444444446,47.22222222222223,50.0,52.77777777777777,55.55555555555554,58.333333333333314,61.111111111111086,63.888888888888914,66.66666666666663,69.44444444444446,72.22222222222223,75.0,77.77777777777777,80.55555555555554,83.33333333333331,86.11111111111109,88.88888888888891,91.66666666666663,94.44444444444446,97.22222222222223,100.0,102.77777777777777,105.55555555555554,108.33333333333331,111.11111111111109,113.88888888888891,116.66666666666663,119.44444444444446,122.22222222222223,125.0,127.77777777777777,130.55555555555554,133.33333333333331,136.1111111111111,138.8888888888889,141.66666666666663,144.44444444444446,147.22222222222223,150.0,152.77777777777777,155.55555555555554,158.33333333333331,161.1111111111111,163.8888888888889,166.66666666666663,169.44444444444446,172.22222222222223,175.0,177.77777777777777,180.55555555555554,183.33333333333331,186.1111111111111,188.8888888888889,191.66666666666663,194.44444444444446,197.22222222222223,200.0,202.77777777777777,205.55555555555554,208.33333333333331,211.1111111111111,213.8888888888889,216.66666666666663,219.44444444444446,222.22222222222223,225.0,227.77777777777777,230.55555555555554,233.33333333333331,236.1111111111111,238.8888888888889,241.66666666666663,244.44444444444446,247.22222222222229,250.0,252.77777777777771,255.55555555555554,258.33333333333337,261.1111111111111,263.8888888888889,266.66666666666663,269.44444444444446,272.2222222222222,275.0,277.7777777777777,280.55555555555554,283.33333333333337,286.1111111111111,288.8888888888888,291.66666666666663,294.44444444444446,297.2222222222223,300.0]},\"selected\":{\"id\":\"2130\"},\"selection_policy\":{\"id\":\"2129\"}},\"id\":\"2113\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"coordinates\":null,\"data_source\":{\"id\":\"2094\"},\"glyph\":{\"id\":\"2096\"},\"group\":null,\"hover_glyph\":null,\"muted_glyph\":{\"id\":\"2098\"},\"nonselection_glyph\":{\"id\":\"2097\"},\"view\":{\"id\":\"2100\"}},\"id\":\"2099\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2103\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2108\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"TEMPERATURE [\\u00b0C]\",\"coordinates\":null,\"formatter\":{\"id\":\"2106\"},\"group\":null,\"major_label_policy\":{\"id\":\"2107\"},\"ticker\":{\"id\":\"2072\"}},\"id\":\"2071\",\"type\":\"LinearAxis\"},{\"attributes\":{\"coordinates\":null,\"formatter\":{\"id\":\"2103\"},\"group\":null,\"major_label_policy\":{\"id\":\"2104\"},\"ticker\":{\"id\":\"2076\"}},\"id\":\"2075\",\"type\":\"LinearAxis\"},{\"attributes\":{\"coordinates\":null,\"group\":null,\"text\":\"STANDARD THERMODYNAMIC PROPERTIES OF CO2(AQ)\\nALONG WATER SATURATION PRESSURE\"},\"id\":\"2061\",\"type\":\"Title\"},{\"attributes\":{\"axis\":{\"id\":\"2071\"},\"coordinates\":null,\"group\":null,\"ticker\":null},\"id\":\"2074\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2072\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"2060\"]},\"title\":\"Bokeh Application\",\"version\":\"2.4.2\"}};\n const render_items = [{\"docid\":\"349beb0e-88bc-4a19-b040-6e40f5ce22c8\",\"root_ids\":[\"2060\"],\"roots\":{\"2060\":\"dd207dc1-66ce-4e6e-ab43-ec4c534614ee\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n let attempts = 0;\n const timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);", "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2060" } }, "output_type": "display_data" } ], "source": [ "hovertool = HoverTool()\n", "hovertool.tooltips = [(\"Temperature\", \"@T °C\"), (\"G°,CO2(aq)\", \"@G0 kJ/mol\"), (\"H°,CO2(aq)\", \"@H0 kJ/mol\")]\n", "\n", "p = figure(\n", " title=\"STANDARD THERMODYNAMIC PROPERTIES OF CO2(AQ)\\nALONG WATER SATURATION PRESSURE\", \n", " x_axis_label='TEMPERATURE [°C]', \n", " y_axis_label=r\"\",\n", " sizing_mode=\"scale_width\")\n", "\n", "p.add_tools(hovertool)\n", "\n", "p.line(\"T\", \"G0\", source=data, legend_label=\"G°,CO2(aq)\", line_width=5, line_cap=\"round\", line_color=\"midnightblue\")\n", "p.line(\"T\", \"H0\", source=data, legend_label=\"H°,CO2(aq)\", line_width=5, line_cap=\"round\", line_color=\"orange\")\n", "\n", "show(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That's it - you can repeat the same process with any other database in Reaktoro (not just SUPCRTBL!). In the next section, we will learn how to calculate the thermodynamic properties of reactions. Keep reading!" ] } ], "metadata": { "interpreter": { "hash": "e4e8b2f3ae27709963f14fd23a6560d362beea55eaec742263828e04d814e23c" }, "kernelspec": { "display_name": "Python 3.9.7 64-bit ('reaktoro-jupyter-book': conda)", "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.9.9" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }