ChE 365. 2022F. FE. Name: SmallAssignment: You will have to implement Python scripts which solve chemical engineeringproblems using numerical methods and tools covered in ChE 365. Each of you will...

1 answer below »
This may not be shared on the site or anywhere on the internet. Just need the Python code with comments about everything you did so I can follow it. Problems 1,2 3 all require Numerical methods and a background of Chemical Engineering. If the tutor can not solve the problems using the numerical method required please do not accept the assignment.


ChE 365. 2022F. FE. Name: Small Assignment: You will have to implement Python scripts which solve chemical engineering problems using numerical methods and tools covered in ChE 365. Each of you will receive an email with the problem statement and parameters. Submission: The solution has to be submitted on Canvas as two files: 1. A ZIP file which includes the python and data files. The working scripts (use a separate script for each of the problem), the scripts should be well-documented and tested. Non-working script giving an error on execution will result in zero for the problem. 2. A PDF file with the report (one for all problems). The report should include the problem statements, short description of the numerical methods, summary of the results from different methods, the plots (where applicable), and the conclusion regarding implemented solutions. The report should not include the code. The final scripts and report should be uploaded on Canvas by the deadline. Late submissions will not be accepted, and you will receive zero for the exam! Please name your scripts and reports using your last name, e.g. if your name is John Doe, your script for the Problem 1 should be: “Doe-P1.py” and report should be “Doe-Report.pdf”. Grading: The exam will be graded based on the two components: 1. The code itself. The code will be graded for (1) correctness, (2) readability, (3) efficiency. Note that for all the tasks that require plots, the axis and all the curves should be clearly labeled, a legend should be included. 2. The code report and presentation. Each student will meet with me (or a proctor) on WebEx to present the project (10-15 minutes). The presentation will be graded based on the answers to the following or similar questions: (1) I will ask you to explain me what certain parts of your code do (2) I will ask the details on the numerical methods used in the script, be they implemented by the student, or used from the numpy/scipy libraries. This can include questions on alternative methods for solving the same problem (covered in ChE 365). (3) I will ask to implement minor changes in the code, or explain how to modify the code to implement some additional features (4) I will ask to predict changes in the code behavior upon some hypothetical changes Exam format: This is an “open book” exam. You can use any resources on the Internet to help you solve your problem. However, you must summarize the list of resources you used in the report. Furthermore, you cannot copy the code from existing sources, except your own codes for the in-class activities or the examples I provided. Copied parts of the code will be considered as plagiarism. The oral part of your exam is “closed book”: you cannot use any resources other than your own code and report while presenting and answering questions. You are not allowed to discuss your project with other people from the class or anyone except the instructor. Furthermore, you are not allowed to show or share the code, and the assignment itself or posting it on online resources, such as Chegg. This will be considered as cheating, and will result is zero for the exam. 1 ChE 365. 2022F. FE. Name: Small Problem 1. The table gives the experimental Pxy data for VLE of a binary mixture at a constant temperature. Assume that the VLE is described by modified Raoult’s law yiP = xiγiP sat i (i = 1, 2) (1) where P is the equilibrium pressure, yi is the mole fraction in the vapor phase, xi is the mole fraction in the liquid phase, γi is the activity coefficient, P sat i is the vapor pressure for the species i. Obviously x1 + x2 = 1 and y1 + y2 = 1. The excess Gibbs free energy is given by the 2-parameter Margules equation GE RT = (A21x1 + A12x2)x1x2, (2) so that the activity coefficients are given as ln γ1 = x 2 2 [A12 + 2 (A21 − A12)x1] ln γ2 = x21 [A21 + 2 (A12 − A21)x2] (3) It is useful to remember that the logarithms of the activity coefficients satisfy the summability relation: GE RT = x1 ln γ1 + x2 ln γ2. (4) 1. Perform the data reduction to calculate the parameters of the Margules equation, A12, A21, from the linear regression for the G E RTx1x2 data. 2. Plot the data for ln γ1, ln γ2, GE RT , and G E RTx1x2 as a function of x1 on the same plot. Use markers for values based on the experimental data and lines for the model predictions. 3. The integral criterion for thermodynamic consistency of the VLE data is given by: 1∫ 0 ln ( γ1 γ2 ) dx1 = 0 (5) Calculate the integral in Eq. 5 using Simpson’s 1/3 rule (implement your own algorithm and verify with an algorithm from scipy). 4. Fit the ln ( γ1 γ2 ) data with a 4th degree polynomial. Plot the data as markers and the fit as a line. Using the polynomial fit, calculate the integral in Eq. 5 analytically. P (kPa) x1 y1 50.69 0.0 0.0 52.37 0.0316 0.0592 53.95 0.1067 0.1597 55.83 0.1899 0.2426 56.73 0.3393 0.299 56.1 0.4303 0.3317 54.29 0.6225 0.403 52.74 0.6583 0.4334 50.52 0.7352 0.4902 47.49 0.8124 0.5284 45.52 0.8525 0.6058 41.41 0.9091 0.6677 36.75 0.9542 0.7751 32.49 0.982 0.8956 29.34 1.0 1.0 2 ChE 365. 2022F. FE. Name: Small Problem 2. The isothermal compressibility of a fluid, βT , is defined as βT ≡ − 1 V ( ∂V ∂P ) T , (6) where V is the volume, P is the fluid pressure, and T is the absolute temperature. Consider a fluid confined in a pore, assuming that it is a uniform macroscopic system, we can relate the pressure in the pore P to the chemical potential of the fluid µ through the Gibbs-Duhem relation at constant temperature dP = n dµ. (7) Using n = N/V (molar density) and Eq. 7, Eq. 6 can be rewritten as βT = 1 n2 ( ∂n ∂µ ) T,N = 1 n2 ( ∂n ∂µ ) T,V . (8) The last expression in the right hand side of Eq. 8 can be calculated by numerical differentiation of the adsorption isotherm, i.e. density n as a function of the chemical potential µ. The table gives the data for argon adsorption in a silica pore at 87.3 K, use numerical derivative to calculate isothermal compressibility βT of confined argon as a function of chemical potential. Use the following methods: 1. Forward finite difference. 2. Based on the second-order Lagrange interpolation polynomials for each of the three consecutive points. 3. Fit the n = n(µ) data with a polynomial function of the order m, calculate the derivative of the resulting polynomial. Try two different values of m. Plot all four results on the same axis, compare the results from different methods. µ (J/mol) n (mol/m3) 0.0 28161.6 294.1 30178.9 502.9 30684.2 664.7 30996.9 797.0 31226.6 908.8 31442.7 1005.7 31604.1 1091.2 31724.1 1167.6 31833.8 1236.7 31933.6 1299.9 32042.4 1357.9 32125.8 1411.7 32215.0 1461.7 32272.1 1508.6 32971.5 1552.5 32412.6 1562.1 32460.8 1633.2 32478.9 1670.4 32508.7 3 ChE 365. 2022F. FE. Name: Small Problem 3. The problem of growth and evaporation of aerosols has multiple application in industry and in nature. The latter, in particular includes the evolution of atmospheric aerosols. Consider condensation of a supersaturated vapor on a surface of a microscopic spherical particle of radius R0. The growth of the spherical liquid droplet is governed by the kinetic (free molecular) flux of the vapor molecules towards the droplet. The resulting equation for the radius of the droplet R as a function of time t reads: dR dt = C { 1− 1 s exp [ `K R ]} . (9) where C ≡ αvTn0 4nl . (10) The parameter s describes the deviation on the vapor from the chemical equilibrium with the condensate, the saturation ratio s ≡ n0 n∞ . (11) The parameter `K is the characteristic Kelvin length defined as `K ≡ 2γ nlkBT . (12) Here α is the molecular accommodation coefficient, vT is the mean thermal velocity of the molecules, n0 is the unperturbed vapor number density far from the droplet, nl is the number density of the liquid phase, n∞ is the number density of the saturated vapor at the flat surface, γ is the vapor- liquid surface tension, kB is the Boltzmann constant, T is the absolute temperature. Solve the initial value problem, given by Eq. 9 the natural initial condition R |t=0= R0 . (13) 1. Solve it using Euler’s method 2. Solve it using solve ivp function, compare the resulting solution with the solution from part 1 graphically. 3. Unfortunately the problem given by Eqs. 9 and Eq. 13 cannot be solved in the closed form to test the numerical solution. However, if the exponent in Eq. 9 is linearized, it can be solved. Linearize the exponent and write the closed-form solution for Eqs. 9 and Eq. 13. 4. Apply the methods implemented above to the linearized equation, and compare the results to the closed-form solution. The parameters for the problem are the following: C = 1, s = 2.25, `K = 0.65, R0 = 1, tinitial = 0, tfinal = 10, δt = 0.5 4 Page i Applied Numerical Methods with Python for Engineers and Scientists Steven C. Chapra Tufts University, Professor Emeritus David E. Clough University of Colorado, Boulder, Professor Emeritus Page ii APPLIED NUMERICAL METHODS WITH PYTHON FOR ENGINEERS AND SCIENTISTS Published by McGraw Hill LLC, 1325 Avenue of the Americas, New York, NY 10121. Copyright ©2022 by McGraw Hill LLC. All rights reserved. Printed in the United States of America. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written consent of McGraw Hill LLC, including, but not limited to, in any network or other electronic storage or transmission, or broadcast for distance learning. Some ancillaries, including electronic and print components, may not be available to customers outside the United States. This book is printed on acid-free paper. 1 2 3 4 5 6 7 8 9 LWI 26 25 24 23 22 21 ISBN 978-1-265-01796-5 MHID 1-265-01796-4 Cover Image: VisualCommunications/E+/Getty Images All credits appearing on page or at the end of the book are considered to be an extension of the copyright page. The Internet addresses listed in the text were accurate at the time of publication. The inclusion of a website does not indicate an endorsement by the authors or McGraw Hill LLC, and McGraw Hill LLC does not guarantee the accuracy of the information presented at these sites. mheducation.com/highered Page iii Dedication: Steven C. Chapra To Cynthia K. Chapra in gratitude for her love, support, and for allowing this nerd the time and space to play with his computer. David E. Clough To my parents, John and Eunice Clough, for providing a loving, supportive home and a launching pad for my career as an educator. Page iv ABOUT THE AUTHORS Steve Chapra is the Emeritus Professor and Louis Berger Chair in the Civil and Environmental Engineering Department at Tufts University. His other books include Surface Water-Quality Modeling, Numerical Methods for Engineers, and Applied Numerical Methods with MATLAB. Dr. Chapra received engineering degrees from Manhattan College and the University of Michigan. Before joining Tufts, he worked for the U.S. Environmental Protection Agency and the National Oceanic and Atmospheric Administration and taught at Texas A&M University, the University of Colorado, and Imperial College London. His general research interests focus on surface water-quality modeling and advanced computer applications in environmental engineering. He is a Fellow and Life Member of the American Society of Civil Engineering (ASCE) and has received several awards for his scholarly and academic contributions, including the Rudolph Hering Medal (ASCE) for his research, and the Meriam-Wiley Distinguished Author Award (American Society for Engineering Education). He has also been recognized as an outstanding teacher and advisor among the engineering faculties at Texas A&M University, the University of Colorado, and Tufts University. As a strong proponent of continuing education, he has taught over 90 workshops for professionals on numerical methods, computer programming, and environmental modeling. David Clough joined the faculty of the Department of Chemical and Biological Engineering at the University of Colorado in 1975 after a brief career with DuPont in Wilmington, Delaware. He retired from Colorado in 2017 and holds the position of Professor Emeritus. He remains active at Colorado by assisting faculty and students in teaching and research. Notably, he teaches a series of workshops on process modeling and computer simulation as part of the senior design course sequence. Dr. Clough received degrees in chemical engineering from Case Western Reserve University and the University of Colorado. He has extensive experience in applied computing, process automation, and
Answered 2 days AfterDec 16, 2022

Answer To: ChE 365. 2022F. FE. Name: SmallAssignment: You will have to implement Python scripts which solve...

Rakesh answered on Dec 19 2022
31 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here