Chemical Engineering Computing Kyambogo University Lecture 7
Chemical Engineering Computing Kyambogo University Lecture 7
FACULTY OF ENGINEERING
DEPARTMENT OF MINING, CHEMICAL & PETROLEUM ENGINEERING
BACHELOR OF SCIENCE IN CHEMICAL ENGINEERING
Course Code and Name: SCE 2202 COMPUTING FOR CHEMICAL ENGINEERING II
Course Level: YR II, SEM II (2023/2024)
Course Credit: 3 CU
Lecturer: Dr. Dan Egesa
Assisting Lecturer: Joshua Ocoun (Eng.)
NOTE: when this symbol ‘%’ is used, in a Matlab, it indicates a statement describing the problem.
It can also indicate units of the described parameters. Whenever it’s used the words turn to green.
Matlab is a programming language, and therefore it’s very sensitive. Any mis-spelling of a
function name, will cause it not to work.
When you start a script, write;
‘function’.
Note that the ‘f’ should be in lower case. If it’s in the Upper case, Matlab will not understand that
you have written a script. If there is any error in the word, ‘function’ e.g ‘fuction’, ‘Function’,
‘fnction’… etc. Matlab will understand nothing of what you have written. It’s imperative that you
pay close attention to what you have written, even in other Matlab operators.
Example:
Find the Specific volume of n-Pentane at 600K and 16atm in a side draw stream of a distillation
column.
Soln:
We can use Equations of state to solve for this. In this case we can Redlich-Kwong equation of
State.
Matlab provides all the calculations upto the final value of v and therefore it can take a
lot of pages for the case of printing out. To prevent this, always put a semi-colon ‘;’ at the
end of each line, to suppress the other calculations, and only provide the final solution.
In our case we did not do that.
Go back to editor and include the semi-colon. Then rewrite the command.
Summary:
‘specvol’ defines the problem whose unknown quantity you want to find.
‘feval’ evaluates the defined problem
‘fzero’ operates when the expression in the problem sums to zero
Assignment 10:
A kingfisher-2009 Petroleum assay contains, Propane, n-butane, n-pentane and benzene
as shown in the table below.
Compound %wt
Propane 0.1168
n-butane 0.4064
n-pentane 0.1485
Benzene 0.0175
Using either, RK-Soave or Peng Robinson, tabulate the specific volume of each of the
given components in the mixture stream for a temperature range of 200K to 500K and a
corresponding pressure range of 2bars to 10bars, using MATLAB
From your tabulation, suggest the optimum/best conditions (T and P) at which the mixture
can be separated by distillation.