diff --git a/README.md b/README.md
index 51d474b..493be28 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,29 @@
# Chemical Engineering - Analysis Notebooks
Literate Programming Examples for Chemical Engineering Analysis
-# Click this button to begin: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/mewilhel/AnalysisNotebooks/master)
+## Authors
+
+## Copyright Information
+
+## Intended Use and Goals
+
+## Overview of Content
+
+This repository contains a series of supplemental notebooks used in XXX.
+
+The course made use of Dorfman and Daotidis's "Numerical Methods and Chemical Engineering Applications" as a primary textbook. A list of the chapters of Dorfman and Daotidis which correspond to each tutorial is provided below. We should however note that the enclosed material was design to be used in a stand alone fashion and may be readily integrated into other courses.
+
+- Tutorial \#0 (Introduction to Matlab/Julia) - N/A
+- Tutorial \#1 (Linear Algebraic Systems) - Chapter 2
+- Tutorial \#2 (Nonlinear Algebraic Systems) - Chapter 3
+- Tutorial \#3 (ODEs, Initial Value Problems) - Chapter 4
+- Tutorial \#4 (ODEs, Boundary Value Problems) - Chapter 6
+- Tutorial \#5 (Partial Differential Equations) - Chapter 7
+- Tutorial \#6 (Optimization) - N/A
+
+The Ju
+
+## Extendability
+
+## References
+- Dorfman, Kevin D., and Prodromos Daoutidis. Numerical Methods with Chemical Engineering Applications. Cambridge University Press, 2017.
diff --git a/tutorial/julia/Tutorial 5 - Partial Differential Equations/Initial Value PDEs.ipynb b/tutorial/julia/Tutorial 5 - Partial Differential Equations/Initial Value PDEs.ipynb
index 8e56613..bf9179b 100644
--- a/tutorial/julia/Tutorial 5 - Partial Differential Equations/Initial Value PDEs.ipynb
+++ b/tutorial/julia/Tutorial 5 - Partial Differential Equations/Initial Value PDEs.ipynb
@@ -6,8 +6,6 @@
"source": [
"# Initial Boundary Value PDEs \n",
"\n",
- "*Supplemental material (Julia) for Chapters 7 of \"Numerical Methods and Chemical Engineering Applications\" by Dorfman and Daoutidis*\n",
- "\n",
"
\n",
"\n",
"# Learning Objectives\n",
@@ -27,59 +25,30 @@
"source": [
"# Simulating a graded catalyst bed\n",
"\n",
- "Process engineers are often engaged in tasks centered around increasing the economic productivity of process equipment while ensuring safe operation. For the commodity chemical industry, increased conversion of reactant to product remains a desired outcome. One of the most common used continuously operating reactor in this sector is that of the catalytic packed bed reactor. In this configuration, a tubular reactor is employed. This tube is packed with catalyst covered particles and the reactant flows over the catalyst bed. In many cases, a large number of tubes will be used in parallel cooled by the same jacket. We'll just consider the single tube variant here. A simplifed depiction is given below. \n",
- "\n",
- "\n",
- "\n",
- "\n",
- "One important industrial chemical is that ortho-xylene which is used to produce phthalic anhydride a common plastizer. \n",
- "The desired reaction is:\n",
- "\n",
- "\n",
- "However, two underdesirable side reactions are also known to occur:\n",
+ "A suction pyrometer is a commonly used instrument for measuring gas phase temperatures in extemely hot environments (one example given [here](https://pubmed.ncbi.nlm.nih.gov/24248279/)). In these environments, it's quite typical to observe a large amount of radiative heat flux. This will typically dominate the heat transfer between the gas phase and an object. As a consequence, directly immersing a measurement device, such as a thermocouple or resistance temperature detector (RTD) into the process gas, will yield meaningless results. Moreover, an object left in this environment for a long period of time will increase in temperature until it too emits a significant amount of thermal radiation. So simply shielding a sensor isn't a viable solution either. This issue is circumvented by using a suction pyrometer. This device consistes of a small jacketing tube attached to a sensor (thermocouple or RTD) and a vacuum pump. By drawing gas through the tube, the jacket is cooled preventing emission, and allowing for a valid reading from the internal sensor. A picture is included below:\n",
"\n",
- "\n",
+ "\n",
"\n",
- "\n",
+ "The key design considerations behind the suction pyrometer are the superficial velocity and Biot number needed to ensure that the temperature rise of the process gas in the jacket is minimal. We'll construct a basic model of heat transfer in this tube and use it to determine adequate settings for reading our temperature range of interest. \n",
"\n",
- "The reactor is typically operated such at a hotspot occurs in the reactor, the reactor is stable (and in turn safe), and a high degree of selectivity and conversion is achieved. A number of process parameters including pressure, temperature, residence time, cooling rate, and feed composition may be manipulated to improve reactor productivity, selectivity, conversion, or overall profitability. We'll build a simulation (based on the model in this [paper](https://pubs.acs.org/doi/abs/10.1021/ie4005699).) to investigate the how using a graded catalyst may impact reactor performance. That is to say a reactor in which differing zones are loaded with catalyst of differing activity levels. This can allow the operator to raise the effective reactor temperature while preventing thermal runaway and maintaining adequate selectivity.\n",
+ "We'll consider a constant heat capacity gas which we're measuring using a 1ft (0.3048 m) by 0.25 inch (0.00635 m) diameter tube. Heat transfer at the wall surface is proportional to the temperature difference and characterized by the Biot number.\n",
"\n",
"## A basic descriptive model\n",
"\n",
- "A two-dimensional steady-state pseudohomogeneous packed bed reactor equations consist of a mass balance and an energy balance:\n",
- "\n",
- "\\\\[u_s\\frac{\\partial \\mathbf{c}}{\\partial z} = \\frac{D}{R}\\frac{\\partial}{\\partial R}\\left(R\\frac{\\partial \\mathbf{c}}{\\partial R}\\right) + \\sum_{i}{\\nu_{ij}r_i(\\mathbf{c},T)} \\\\]\n",
- "\n",
- "\\\\[u_s \\rho_{f} \\left(\\sum_{i}{C_{p,i}c_i}\\right) \\frac{\\partial T}{\\partial z} = \\frac{\\Lambda}{R}\\frac{\\partial}{\\partial R}\\left(R\\frac{\\partial T}{\\partial R}\\right) + \\sum_{i}{(-\\Delta H_{i})r_i(\\mathbf{c},T)} \\\\]\n",
- "\n",
- "were OX is denotes ortho-xylene, PA denotes phthalic anhydride and \n",
- "\n",
- "\\\\[j \\in \\{c_{OX,1}, c_{PA,1}, c_{H_2 O,1}, c_{O_2,1}, c_{CO_2,1}, c_{N_2}\\}\\\\].\n",
- "\n",
- "For a full review of different packed bed reactor models, the reader is directed to [this reference](https://ris.utwente.nl/ws/portalfiles/portal/6073612/t0000040.pdf).\n",
+ "A two-dimensional steady-state energy balance is given by:\n",
"\n",
- "
\n",
- "Form of the above equations: The above equations are coupled convection-diffusion equations. One of the most commonly encountered forms in fluid mechanics.\n",
- "
\n",
- "\n",
- "
\n",
- "Limiting cases: Consider briefly under what conditions we might assume that these equations reduce to the Poisson or Laplace equations below.\n",
- "
\n",
+ "\\\\[u_s C_{p} \\frac{\\partial T}{\\partial z} = \\frac{\\Lambda}{R}\\frac{\\partial}{\\partial R}\\left(R\\frac{\\partial T}{\\partial R}\\right), \\\\]\n",
"\n",
- "1. **Poisson Equation**: \\\\[\\nabla^2 x = f(x)\\\\]\n",
- "2. **Laplace Equation**: \\\\[\\nabla^2 x = 0\\\\]\n",
+ "**Limiting cases:** Consider briefly under what conditions we might assume that this equation reduces to the Poisson or Laplace equations below.\n",
"\n",
- "Next, we assume a sufficient cooling flow exists to hold the reactor wall temperature constant at a fixed value of $T^c$. Then we can write a symmetry and cooling boundary condition:\n",
+ "1. **Poisson Equation:** \\\\[\\nabla^2 x = f(x) \\\\]\n",
+ "2. **Laplace Equation:** \\\\[\\nabla^2 x = 0 \\\\] \n",
"\n",
- "\\\\[\\left.\\frac{dT}{dR}\\right\\vert_{R=0} = 0 \\qquad \\qquad \\left.\\frac{dT}{dR}\\right\\vert_{R=R_t} = -Bi(T - T^c) \\\\]\n",
- "\n",
- "
\n",
- "Note: The wall boundary condition ($R = R_t$) is of the Robin type and the symmetry condition ($R = 0$) is of the Neumann type.\n",
- "
\n",
+ "Next, we assume a sufficient cooling flow exists to hold the reactor wall temperature constant at a fixed value of . Then, we can write a symmetry and cooling boundary condition:\n",
"\n",
- "We further assume that the reactor wall is impermeable to all species (and note that similar symmetry conditions should also hold):\n",
+ "\\\\[\\left.\\frac{\\partial T}{\\partial R}\\right\\vert_{R=0} = 0 \\qquad \\qquad \\left.\\frac{\\partial T}{\\partial R}\\right\\vert_{R=R_t} = -Bi(T - T^c) \\\\]\n",
"\n",
- "\\\\[\\left.\\frac{d\\mathbf{c}}{dR}\\right\\vert_{R=0} = 0 \\qquad \\qquad \\left.\\frac{d\\mathbf{c}}{dR}\\right\\vert_{R=R_t} = 0 \\\\]"
+ "Note that the symmetry condition (at $R = 0$) is of the Neumann type and the wall boundary condition (at $R = R_t$) is of the Robin type. "
]
},
{
@@ -88,43 +57,15 @@
"source": [
"## Further model development\n",
"\n",
- "- Assume the inlet stream is well-mixed.\n",
- "\\\\[\\begin{align} \\mathbf{c}(z=0) &= \\mathbf{c}_{in} \\\\\n",
- " T(z=0) &= T_{in} \\end{align}\\\\]\n",
- " \n",
- "
\n",
- "Note: The inlet conditions are examples of Dirichlet boundary conditions.\n",
- "
\n",
- "\n",
- "
\n",
- "Activity! If the type of the boundary condition isn't immediate obvious take a moment and see if you can rearrange these equations into one of the below forms. \n",
- "
\n",
- "\n",
- "1. **Dirichlet Boundary Condition**: \\\\[x = a\\\\] \n",
- "2. **Neumann Boundary Condition**: \\\\[\\hat{n}\\cdot\\nabla x = f(x)\\\\]\n",
- "3. **Robin Boundary Condition**: \\\\[\\hat{n}\\cdot\\nabla x + \\alpha x = f(x)\\\\]\n",
+ "Assume the inlet stream is well-mixed and at known temperature:\n",
"\n",
- "- All reactions are treated as pseudo-first-order. Each reaction rate may be written with relation to it's partial pressure which in turn is related to the concentration assuming an ideal gas equaton of state.\n",
+ "\\\\[\\mathbf T(z=0)=\\mathbf T_{in}. \\\\]\n",
"\n",
- "\\\\[r_1 = (\\sigma P_{O_2}\\rho_s) k_1 P_{OX} = k_1 (\\sigma \\rho_s)/(R_g T)^2 c_{O_2} c_{OX} \\\\]\n",
- "\\\\[r_2 = (\\sigma P_{O_2}\\rho_s) k_2 P_{PA} = k_2 (\\sigma \\rho_s)/(R_g T)^2 c_{O_2} c_{PA} \\\\]\n",
- "\\\\[r_3 = (\\sigma P_{O_2}\\rho_s) k_3 P_{OX} = k_3 (\\sigma \\rho_s)/(R_g T)^2 c_{O_2} c_{OX} \\\\]\n",
- "\n",
- "The rate constant can be calculated using the Arrhenius relationship as such\n",
- "\n",
- "\\\\[k_i = k_i^r \\exp{\\frac{E^r_i(T - T^r)}{T R_g T^r}}, \\qquad i = \\{1, 2, 3\\} \\\\]\n",
- "\n",
- "Individual component rates of change may then be written as:\n",
- "\n",
- "\\\\[\\begin{align} r_{OX} &= -r_1 + r_3 \\\\\n",
- "r_{PA} &= r_1 - r_2 \\\\\n",
- "r_{H_2 O} &= 3r_1 + 2r_2 + 5r_3 \\\\\n",
- "r_{O_2} &= -3r_1 - 7.5r_2 + 10.5r_3 \\\\\n",
- "r_{CO_2} &= 8r_2 + 8r_3 \\\\\n",
- "r_{N_2} &= 0\n",
- "\\end{align}\\\\]\n",
- "\n",
- "We omit a further discussion of model parameters in favor of including stating there values in the included code."
+ "This is because boundary conditions are known in the radial dimension and the system is fully specified at the reactor entrance for all variables (initial temperature).\n",
+ " \n",
+ "
\n",
+ "Note: This problem is treated as an IBVP and not a 2D BVP.\n",
+ "
"
]
},
{
@@ -146,17 +87,12 @@
"metadata": {},
"source": [
"### Method of Lines Derivation - Interior\n",
- "Applying these rules to the mass balance for the interior nodes, we have \n",
- "\n",
- "\\\\[ \\left.\\frac{\\partial \\mathbf{c}}{\\partial z}\\right\\vert_{R=R_j} = u_s^{-1}\\left(\\frac{D}{R}\\frac{\\partial \\mathbf{c}}{\\partial R} + \\frac{\\partial^2 \\mathbf{c}}{\\partial R^2} + \\sum_{i}{\\nu_{ij}r_i(\\mathbf{c},T)}\\right) \\qquad j = 2, \\ldots, N_{r-1}\\\\]\n",
- "\n",
- "\\\\[ \\left.\\frac{d \\mathbf{c}_j}{d z}\\right\\vert_{R=R_j} = u_s^{-1}\\left(\\frac{D}{R}\\frac{\\mathbf{c}_{j+1} - \\mathbf{c}_{j-1}}{2\\Delta R} + D\\frac{\\mathbf{c}_{j+1} - 2\\mathbf{c}_{j} + \\mathbf{c}_{j-1}}{\\Delta R^2} + \\sum_{i}{\\nu_{ij}r_i(\\mathbf{c},T)}\\right) \\qquad j = 2, \\ldots, N_{r-1}\\\\]\n",
+ "Applying these rules to the energy balance for the interior nodes, where is the number of spatial nodes for discretizing the dimension, we have\n",
"\n",
- "Accordlingly, the temperature balance becomes\n",
+ "\\\\[\\frac{\\partial T}{\\partial z} = \\left(u_s C_P\\right)^{-1}\\left(\\frac{\\Lambda}{R}\\frac{\\partial}{\\partial R}\\left(R\\frac{\\partial T}{\\partial R}\\right)\\right) \\\\]\n",
"\n",
- "\\\\[\\left.\\frac{\\partial T}{\\partial z}\\right\\vert_{R=R_j} = \\left(u_s\\sum_{i}{f_{i}c_{pj}}\\right)^{-1}\\left(\\frac{\\Lambda}{R}\\frac{\\partial}{\\partial R}\\left(R\\frac{\\partial T}{\\partial R}\\right) + \\sum_{i}{(-\\Delta H_{i})r_i(\\mathbf{c},T)}\\right) \\qquad j = 2, \\ldots, N_{r-1} \\\\]\n",
"\n",
- "\\\\[ \\left.\\frac{d T}{d z}\\right\\vert_{R=R_j} = \\left(u_s\\sum_{i}{f_{i}c_{pj}}\\right)^{-1}\\left(\\frac{D}{R}\\frac{T_{j+1} - T_{j-1}}{2\\Delta R} + D\\frac{T_{j+1} - 2T_{j} + T_{j-1}}{\\Delta R^2} + \\sum_{i}{\\nu_{ij}r_i(\\mathbf{c},T)}\\right) \\qquad j = 2, \\ldots, N_{r-1}\\\\]"
+ "\\\\[\\left.\\frac{d T}{d z}\\right\\vert_{R=R_j} = \\left(u_s C_{p}\\right)^{-1}\\left(\\frac{D}{R}\\frac{T_{j+1} - T_{j-1}}{2\\Delta R} + D\\frac{T_{j+1} - 2T_{j} + T_{j-1}}{\\Delta R^2}\\right) \\qquad j = 2, \\ldots, N_{r-1} \\\\]"
]
},
{
@@ -164,20 +100,17 @@
"metadata": {},
"source": [
"### Method of Lines Derivation - Center\n",
- "The discretization at the center node yeilds:\n",
- "\\\\[ \\frac{d \\mathbf{c}_1}{d z} = u_s^{-1}\\left(\\frac{D}{R}\\frac{\\mathbf{c}_{2} - \\mathbf{c}_{0}}{2\\Delta R} + D\\frac{\\mathbf{c}_{2} - 2\\mathbf{c}_{1} + \\mathbf{c}_{0}}{\\Delta R^2} + \\sum_{i}{\\nu_{ij}r_i(c_1,T_1)}\\right)\\\\]\n",
+ "The discretization at the center node ($R=0, j=1$) yields: \n",
"\n",
- "from the boundary condition we have \\\\[\\frac{d \\mathbf{c}_1}{d R} = 0 \\rightarrow \\frac{\\mathbf{c}_{2} - \\mathbf{c}_{0}}{2\\Delta R} = 0 \\rightarrow \\mathbf{c}_{0} = \\mathbf{c}_{2}\\\\]. Substituting this in yeilds:\n",
+ "\\\\[\\frac{d T_1}{d z} = \\left(u_s C_P\\right)^{-1}\\left(\\frac{\\Lambda}{R}\\frac{T_{2} - T_{0}}{2\\Delta R} + \\Lambda \\frac{T_{2} - 2T_{1} + T_{0}}{\\Delta R^2}\\right).\\\\]\n",
"\n",
- "\\\\[ \\frac{d \\mathbf{c}_1}{d z} = u_s^{-1}\\left(\\frac{2D}{\\Delta R^2}(\\mathbf{c}_{2} - \\mathbf{c}_{1}) + \\sum_{i}{\\nu_{ij}r_i(\\mathbf{c}_1,T_1)}\\right)\\\\]\n",
+ "From the boundary condition we have \n",
"\n",
- "Accordingly for the energy balance we have:\n",
+ "\\\\[\\left.\\frac{\\partial T}{\\partial R}\\right|_{R=0} = 0 \\Rightarrow \\frac{T_{2} - T_{0}}{2\\Delta R} = 0 \\Rightarrow T_{0} = T_{2} \\\\]\n",
"\n",
- "\\\\[ \\frac{d T_1}{d z} = \\left(u_s\\sum_{i}{f_{i}c_{pj}}\\right)^{-1}\\left(\\frac{\\Lambda}{R}\\frac{T_{2} - T_{0}}{2\\Delta R} + \\Lambda \\frac{T_{2} - 2T_{1} + T_{0}}{\\Delta R^2} + \\sum_{i}{(-\\Delta H_{i})r_i(\\mathbf{c}_1,T_1)}\\right)\\\\]\n",
+ "Substituting this into the previous expression yields:\n",
"\n",
- "from the boundary condition we have \\\\[\\frac{d T_1}{d R} = 0 \\rightarrow \\frac{T_{2} - T_{0}}{2\\Delta R} = 0 \\rightarrow T_{0} = T_{2}\\\\]. Substituting this in yeilds:\n",
- "\n",
- "\\\\[ \\frac{d T_1}{d z} = \\left(u_s\\sum_{i}{f_{i}c_{pj}}\\right)^{-1}\\left(\\frac{2\\Lambda}{\\Delta R^2}(T_{2} - T_{1}) + \\sum_{i}{(-\\Delta H_{i})r_i(\\mathbf{c}_1,T_1)}\\right)\\\\]\n",
+ "\\\\[\\frac{d T_1}{d z} = \\left(u_s C_P\\right)^{-1}\\left(\\frac{2\\Lambda}{\\Delta R^2}(T_{2} - T_{1})\\right). \\\\]\n",
"\n",
"
\n",
"Activity! This derivation proceeded by solving obtaining algebraic equations from the boundary condition, solving them analytically for the fictive node value, and then substituting this expression in. We could have instead solved a system of coupled differential and algebraic equations (referred to as a differential-algebraic system of equations or DAEs). In many cases, the algebraic equations formed may not have an analytic (closed form) solution and we must resort to solving DAEs. What type of boundary condition(s) may lead algebraic equations with no analytic solution?\n",
@@ -190,639 +123,380 @@
"source": [
"### Method of Lines Derivation - Wall\n",
"The discretization at the wall node yeilds:\n",
- "\\\\[ \\frac{d \\mathbf{c}_R}{d z} = u_s^{-1}\\left(\\frac{D}{R}\\frac{\\mathbf{c}_{R+1} - \\mathbf{c}_{R-1}}{2\\Delta R} + D\\frac{\\mathbf{c}_{R+1} - 2\\mathbf{c}_{R} + \\mathbf{c}_{R-1}}{\\Delta R^2} + \\sum_{i}{\\nu_{ij}r_i(\\mathbf{c}_R,T_R)}\\right)\\\\]\n",
- "\n",
- "from the boundary condition we have \n",
- "\n",
- "\\\\[\\frac{d \\mathbf{c}_R}{d R} = 0 \\rightarrow \\frac{\\mathbf{c}_{R+1} - \\mathbf{c}_{R-1}}{2\\Delta R} = 0 \\rightarrow \\mathbf{c}_{R+1} = \\mathbf{c}_{R-1}.\\\\] \n",
- "\n",
- "Substituting this in yeilds:\n",
- "\n",
- "\\\\[ \\frac{d \\mathbf{c}_R}{d z} = u_s^{-1}\\left(\\frac{2D}{\\Delta R^2}(\\mathbf{c}_{R-1} - \\mathbf{c}_{R}) + \\sum_{i}{\\nu_{ij}r_i(\\mathbf{c}_R,T_R)}\\right)\\\\]\n",
"\n",
- "Accordingly for the energy balance we have:\n",
+ "\\\\[\\frac{d T_{N_r}}{d z} = \\left(u_s C_p\\right)^{-1}\\left(\\frac{\\Lambda}{R}\\frac{T_{N_{r+1}} - T_{N_{r-1}}}{2\\Delta R} + \\Lambda \\frac{T_{N_{r+1}} - 2T_{N_r} + T_{N_{r-1}}}{\\Delta R^2}\\right) \\\\]\n",
"\n",
- "\\\\[ \\frac{d T_R}{d z} = \\left(u_s\\sum_{i}{f_{i}\\mathbf{c}_{pj}}\\right)^{-1}\\left(\\frac{\\Lambda}{R}\\frac{T_{R+1} - T_{R-1}}{2\\Delta R} + \\Lambda \\frac{T_{R+1} - 2T_{R} + T_{R-1}}{\\Delta R^2} + \\sum_{i}{(-\\Delta H_{i})r_i(\\mathbf{c}_R,T_R)}\\right)\\\\]\n",
+ "From the boundary condition we have\n",
"\n",
- "from the boundary condition we have \n",
+ "\\\\[\\left.\\frac{\\partial T}{\\partial R}\\right|_{R=R_t} = 0 \\Rightarrow \\frac{T_{N_{r+1}} - T_{N_{r-1}}}{2\\Delta R} = -Bi(T_{N_r} - T^c) \\Rightarrow T_{N_{r+1}} = T_{N_{r-1}} -2Bi\\Delta R (T_{N_r} - T^c). \\\\]\n",
"\n",
- "\\\\[\\frac{d T_R}{d R} = 0 \\rightarrow \\frac{T_{R+1} - T_{R-1}}{2\\Delta R} = -Bi(T_R - T^c) \\rightarrow T_{R+1} = T_{R-1} -2Bi\\Delta R (T_R - T^c).\\\\]\n",
- " \n",
- "Substituting this in yeilds:\n",
+ "Substituting this in yields:\n",
"\n",
- "\\\\[ \\frac{d T_R}{d z} = \\left(u_s\\sum_{i}{f_{i}c_{pj}}\\right)^{-1}\\left(\\frac{Bi\\Lambda}{R}(T_{C} - T_{R}) + \\frac{2\\Lambda}{\\Delta R^2}(T_{R-1} - T_{R} + Bi\\Delta R (T_{C} - T_{R})) + \\sum_{i}{(-\\Delta H_{i})r_i(\\mathbf{c}_R,T_R)}\\right)\\\\]\n",
+ "\\\\[\\frac{d T_{N_r}}{d z} = \\left(u_s C_p\\right)^{-1}\\left(\\frac{Bi\\Lambda}{R}(T^c - T_{N_r}) + \\frac{2\\Lambda}{\\Delta R^2}(T_{N_{r-1}} - T_{N_r} + Bi\\Delta R (T^c - T_{N_r}))\\right). \\\\]\n",
"\n",
- "We now need to interlace the variables letting \\\\[ y = \\{T_1, c_{OX,1}, c_{PA,1}, c_{H_2 O,1}, c_{O_2,1}, c_{CO_2,1}, c_{N_2}, \\ldots, T_{N_R}, c_{OX,N_R}, c_{PA,N_R}, c_{H_2 O,N_R}, c_{O_2,N_R}, c_{CO_2,N_R}, c_{N_2,N_R}\\}\\\\]\n",
- "\n",
- "We'll now use a nonlinear equation solving package in Julia to write a simple a fixed-step size implicit Euler integration method (progressively, solving the below equation for $y_{z+1}$)\n",
- "\n",
- "\\\\[ y_{z+1} - y_z - \\Delta z f(z_{k+1}) = 0 \\\\]\n",
+ "We'll now use a ODE solver readily available in DifferentialEquations.jl to integrate the above system of differential equations.\n",
"\n",
"
\n",
- "Activity! Take some time to look over the code for the residual. Where does the right-hand side of the ODE system appear? Note how the physical property calculations are implemented.\n",
- "
\n"
+ "Activity! Manipulate the code below, to determine the superficial velocity at which a temperature rise of 2K is observed in the tube for gas temperatures ranging from 900 to 1000.\n",
+ "
\n",
+ "Note: If this is your first time using DifferentialEquations.jl or Plots.jl some time may be spent precompiling. So taking a coffee break after clicking run on the below cell wouldn't be ill-advised.\n",
+ "
\n",
- "Activity! In the below box, compute the average temperature, concentrations, and then conversion at each spatial position. Next try, to modifying the activity_profile and re-running the example. Can you pick out can clear trend in the behavior of the system with respect to temperature/conversion with respect to activity profile?\n",
- "
"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "If you manipulated this example substantially, you may have discovered that some of the simulation results you reached were not physically meaningful. Large oscillations may be observed or even negative values. This is actually expected behavior for many PDE systems which may require specialized discretization methods to be dealt with (such as those encountered in [this reference]((https://ris.utwente.nl/ws/portalfiles/portal/6073612/t0000040.pdf))). Alternatively, one can formulate this simulation as an optimization problem (which can accept constraints such as nonnegative concentration). This later approach can be of particular interest when we are attempting to choose design/process parameters from a broad set of possibility in which many options are invalid."
+ "plot(sol, label=\"Centerline Temperature\", legend=:bottomright, vars = 1)"
]
},
{
diff --git a/tutorial/julia/Tutorial 5 - Partial Differential Equations/pyrometer_pde_pic.png b/tutorial/julia/Tutorial 5 - Partial Differential Equations/pyrometer_pde_pic.png
new file mode 100644
index 0000000..3b8f136
Binary files /dev/null and b/tutorial/julia/Tutorial 5 - Partial Differential Equations/pyrometer_pde_pic.png differ
diff --git a/tutorial/julia/Tutorial 5 - Partial Differential Equations/react1edited.png b/tutorial/julia/Tutorial 5 - Partial Differential Equations/react1edited.png
deleted file mode 100644
index 04bd482..0000000
Binary files a/tutorial/julia/Tutorial 5 - Partial Differential Equations/react1edited.png and /dev/null differ
diff --git a/tutorial/julia/Tutorial 5 - Partial Differential Equations/react2edited.png b/tutorial/julia/Tutorial 5 - Partial Differential Equations/react2edited.png
deleted file mode 100644
index e489b5d..0000000
Binary files a/tutorial/julia/Tutorial 5 - Partial Differential Equations/react2edited.png and /dev/null differ
diff --git a/tutorial/julia/Tutorial 5 - Partial Differential Equations/react3edited.png b/tutorial/julia/Tutorial 5 - Partial Differential Equations/react3edited.png
deleted file mode 100644
index 8a264dc..0000000
Binary files a/tutorial/julia/Tutorial 5 - Partial Differential Equations/react3edited.png and /dev/null differ
diff --git a/tutorial/matlab/Tutorial 5 - Partial Differential Equations/M5_PDEsystems.mlx b/tutorial/matlab/Tutorial 5 - Partial Differential Equations/M5_PDEsystems.mlx
index 482556f..4bc1301 100644
Binary files a/tutorial/matlab/Tutorial 5 - Partial Differential Equations/M5_PDEsystems.mlx and b/tutorial/matlab/Tutorial 5 - Partial Differential Equations/M5_PDEsystems.mlx differ