#!/usr/bin/env python # coding: utf-8 # # Homework 20 # ### Problem 1 # # Solve the following ODE $$\frac{dy}{dt} = ye^{-t}$$ to $t=6$. Plot the resulting function $y(t)$. The initial condition is $y_0=1$. # In[ ]: # ### Problem 2 # # Solve the following rate equation for a coal particle in a furnace. # $$ \frac{dT}{dt} = \left(\frac{hA}{m c_p}(T_f - T) + \frac{\sigma A}{m c_p}(T_f^4-T^4)\right).$$ # # The initial particle temperature is $T_0=500$ K. # # Use D=100 $\mu$m, tend = 0.05 s. # # The following data is given: # # | Variable | Value | Units | # |----------|--------|------- | # | $\rho_p$ | 1000 | kg/m$^3$ | # | $c_p$ | 1380 | J/kg$\cdot$K | # | $k$ | 0.1 | W/m$\cdot$K | # | $Nu$ | 2 | -- | # | $\sigma$ | 5.67E-8| W/m$^2$K$^4$ | # | $T_f$ | 1500 | K | # # Also, the area, mass and Nusselt number $Nu$ are given, respectively, by: # $$ A = \pi D^2, $$ # $$ m = \frac{\pi}{6}D^3\rho_p,$$ # $$ Nu = \frac{hD}{k}.$$ # # Plot the particle temperature as a function of time. Label and format your plot (include units). # In[ ]: # ### Problem 3 # # We are performing a chemical reaction as follows. # # $$\mbox{Rxn 1: }\phantom{xxx} A+B\rightarrow C $$ # $$\mbox{Rxn 2: }\phantom{xxx} B+C\rightarrow D $$ # # Here, symbols $A$, $B$, $C$, $D$ denote species concentrations in mol/L. The initial concentrations are $A_0=1$, $B_0=1$, $C_0=0$, $D_0=0$. Also, $k_1=1\,L/mol*s$, and $k_2=1.5\,L/mol*s$. The concentrations obey the following rate equations: # $$ \frac{dA}{dt} = -k_1AB,$$ # $$ \frac{dB}{dt} = -k_1AB - k_2BC,$$ # $$ \frac{dC}{dt} = k_1AB - k_2BC,$$ # $$ \frac{dD}{dt} = k_2BC.$$ # # Solve for the concentrations of $A$, $B$, $C$, and $D$ as functions of time to $t=3$ s. # # Also, once the species concentrations are found, compute the selectivity defined as $S=C/(C+D)$ as a function of time. (S is initially undefined (since C and D are zero), but you can set it equal to 1 at t=0 since C forms before D. # # Plot the concentrations of A, B, C, and D, and also selectivity S, as functions of time on the same plot. Label the axes as "time (s)" and “concentration (mol/L)”. Include a legend so we can see what the curves correspond to. # # What can you do to maximize your selectivity? Consider $k_1$, $k_2$ and initial concentrations. # In[ ]: # In[ ]: