2.66667

2.7 | 4 ratings Rate this file 28 downloads (last 30 days) File Size: 3.08 KB File ID: #18145

Selection of Optimum Chemical Reactor Design

by Housam Binous

 

28 Dec 2007 (Updated 28 Dec 2007)

No BSD License  

Select optimum reactors' configuration

Download Now | Watch this File

File Information
Description

The program allows one to choose the best reactor setup among three alternatives: (1) a plug flow reactor with recycle, (2) a combination of a plug flow reactor and a stirred tank reactor in series and (3) two stirred tank reactors in series. This problem was solved graphically by O. Levenspiel in Chemical Reaction Engineering, 3rd Edition, Wiley, 1999 (Example 6.3 page 144). In the present program, we show how one can accurately solve the same problem with the numerical and graphical capabilities of Matlab. We find similar results and conclusions as the ones given by Professor Levenspiel. In fact, it is configuration (2) that gives the smallest size of reactors.

A similar treatment using Mathematica can be found in the following link:

http://library.wolfram.com/infocenter/MathSource/5474

Required Products Optimization Toolbox
MATLAB release MATLAB 7.0.1 (R14SP1)
Zip File Content  
Other Files INVREACT/diffreact.m,
INVREACT/InvReact.m,
INVREACT/jbfill.m,
INVREACT/ractor_setup.m,
INVREACT/zeroreact.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (8)
29 Dec 2007 Duane Hanselman

Not a function. Clears the command workspace. No user-settable parameters. No helpful comments. Of use to the author only.

30 Dec 2007 Housam Binous

This code should be very useful to people ready to read Example 6.3 in page 144 from the book by O. Levenspiel, Chemical Reaction Engineering, 3rd Edition, Wiley, 1999. Of course, it has no use to people with electrical engineering background such as Duanne Hanselman.

30 Dec 2007 Duane Hanselman

My review has nothing to do with "people with electrical engineering background." My review addresses the quality and usefulness of its MATLAB code only.

01 Jan 2008 John D'Errico

These submissions might be useful if the author tried, but they are just rather poor as is. There is sparse help and sparse explanations of what was done. Where this is any help, it is not provided in a standard format. The help for a function should be a single, contiguous block of comments at the top of the function. The help should explain what the arguments are, and what the function does.

If you read through the code, you will find it is liberally sprinkled with global variables, a poor way to teach students to program.

There are some good things to these codes. I found comment lines before each parameter was defined that explain what the variable means. Far better would be if those comments included the units on the variables. For example, I found this in the code:

% Volumetric Flow
v=0.1;

What are the units here? Furlongs per fortnight? As such, the comment is almost meaningless, of hardly any help at all.

This author could have written these codes so much more cleanly with little effort. As is, IMHO they lie somewhere between a 1 and a 2 rating. They teach students the wrong things. They teach poor programming habits.

01 Jan 2008 Housam Binous

My intention is not to teach good and fancy skills in programming but rather to show how a simple few line code written in a couple of hours with Matlab can solve a specific chemical engineering problem that might seem daunting to students. Again, I apologize to people who are more interested in syntax and style; I am not a programmer but a simple chemical engineer faculty trying to make use of Matlab.

01 Jan 2008 John D'Errico

Then make your codes more useful to those same students. As it is, you have improved your coding style over what it was a year or so ago. There is still room for improvement.

It is good that I sometimes see functions used in your codes where I would have seen scripts before.

It is good that you are now adding comments in some places in your code.

It is good that there are axis labels on your figures.

It is good that we see references provided.

These are all good things that you are doing.

What can be improved:

Use semi-colons after your lines. As I read through your codes again, I see that a significant fraction of the lines have no semi-colons, for no good reason. This just dumps out random, confusing garbage to the command window.

Provide units in your comments. When a student sees a number like 0.1, even if they know it is perhaps a rate or a mass, what are the units used here? The mere assumption that a number is in SI units is still not adequate to tell them anything.

Add comments before you call a function like fsolve. For example, I see the following line in your code:

Y=fsolve(@zeroreact,[2 6])

What is being solved for here? What are you solving? Add a comment that explains what you did.

HELP THE STUDENT!

Yes, I'd like to see better programming practices in general. The heavy use of global variables and scripts is a good example, as you encourage the student to do something that is poor. The bad habits that they learn from you will stay with them for years afterwards. On the other hand, if the only thing that you ever did "wrong" was to use a global variable, I'd still be willing to give a code a warm appraisal if the rest of it was good.

12 Feb 2008 zaidoon mohsin

Dear sir
I need you to send me nay papers articles and comments considering with matlab using in chemical engieering

06 Nov 2008 Jelassi Mohamed

Hello Mr.Binous,

I'm an old student from your institute (INSAT) and I would like to congratulate you about your effort in developing new modelling tools for students.

Thank you
E-mail: moha(dot)jelassi(at)gmail(dot)com.

Please login to add a comment or rating.
Updates
28 Dec 2007

belong to chemical engineering files

Tag Activity for this File
Tag Applied By Date/Time
chemistry Housam Binous 22 Oct 2008 09:40:44
physics Housam Binous 22 Oct 2008 09:40:44
stirred tank reactor Housam Binous 22 Oct 2008 09:40:44
plug flow reactor Housam Binous 22 Oct 2008 09:40:44
chemical reactor Housam Binous 22 Oct 2008 09:40:45
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com