The ~chbe301/matlab Directory


[Table of Contents |Chbe301 HomePage]


This list of the Chbe301 matlab functions should be very helpful in finding the names and brief descriptions of all the functions described in these notes. In order to get more information, help should be used to find out how the function is actually used. The help comments in the functions list all the arguments to the functions and the arrays returned by the functions. You may also find functions that deal with particular categories by using the lookfor command. If we use it to see how many of the functions deal with reactions, we find:

>>   lookfor reaction

kequil - sets the equilibrium reactions for gas phase reactions
tecon1.m: % tecon1: trial and error function for calculating reaction rates
tecon2.m: % tecon2: trial and error function for calculating reaction rates
enth2 - Finds enthalpy change for reactions in units of J/mol
Kvalp - Gives the chemical equilibrium ratio for a reaction & stream
reactr.m: % reactr: calculates reaction rates for competing reactions (use with react)
swgs.m: % swgs: Find the rate of the water gas shift reaction
BRUSSODE Stiff problem modelling a chemical reaction (the Brusselator).
HOUGEN Hougen-Watson model for reaction kinetics.


Index

I. chemeq
II. datbas
III. engmods
IV. humid
V. massmods
VI. misc
VII. pichelps
VIII. specmods
IX. utilities
X. vle


Matlab functions for Chbe 301:

I. chemeq/ Chemical Equilibrium Functions
View files or Download from this directory

 
chemeq
Determines character representation of one equation from stoichiometric coef.
chemeqs
Determines character representation of equations from stoichiometric coef.
halfeq
Produces half of a chemical equation.
kequil
Sets the equilibrium constants for specified reactions.
Kvalp
Gives the chemical equilibrium ratio for a reaction and stream.
reactee
Aid in determining equilibrium composition of a mixture

Back to local index.

 

II. datbas/ Data Base programs
View files or Download from this directory

sethcp
Loads thermo data into global variables for start301.
setvars
Sets Matlab arrays stored in the data file
start301
or in Section 3.1
Sets variable and makes mass and energy balance arrays global
create
Used to add data to databases
unpack
Unpacks data out of long vectors read from data file

Back to local index.

 

III. engmods/ Mass and Energy balance Modules
View files or Download from this directory

dsplaye
Used by showe to do most of the work.
enth1
Calculates the enthalpy change from t1 to t2.
enth2
Same thing as enth1, but uses a matrix multiply.
enth3
Determines the enthalpy change for multiple compounds.
HinkJ
Calculates enthalpies for compounds relative to elements.
mHinkJ
Calculates enthalpies for compounds relative to elements allowing multiple temperatures as well as compounds. mhinkj Same as mHinkJ,
mixe
The mixer function for energy balance.
reacte
The reactor function for energy balance: only one exit stream.
reacten
Extends reacte to allow multiple outlets.
sepe
The separator function for energy balance.
sepen
General purpose separator module.
setne
Sets stream information in ne.
showe
Displays the data in ne in a readable form.
splite
Energy balance splitter.

Back to local index.

 

IV. humid/ Humidity programs
View files or Download from this directory

humde
Gives the enthalpy of humid air.
humdv
Gives the volume of humid air.
humidity
Sets up data needed for the humidity functions.
masrat
Calculates the mass ratio of water to dry air for a given humidity and temperature of the air.
molrat
Calculates the molar ratio of water to dry air for a given humidity and temperature of the air.

Back to local index.

 

V. massmods/ Mass balance modules
View files or Download from this directory

showm
Gives a compact display of the flow rates in ns.
dsplay
Used by showm to do most of the work.
mix
Simulates the behavior of a mixer.
react
Simulates the behavior of a reactor.
See reactr as well
sep
Simulates the behavior of a separator.
See fraco and sept as well
split
Simulates the behavior of a splitter.

Back to local index.

 

VI. misc/ Miscellaneous functions used with mass and energy module
View files or Download from this directory

er28
Function for solving example 2.8.
ex516
Gives the function for solving example 5.16.
exr828
Function for solving problem 8.28.
g312
Solves example 3.12.
intcp
Creates "icp" variables
iter
Method of solving problem 5.33.
moltomas
or in moltomas
Converts mole fractions to mass fractions.
p312
Simulates a combination of units.
tplot1
Draws a graph of chemical properties.
tplot2
Draws a graph of chemical property data in a different form.
tplot3
Draws a graph of chemical property data, with more properties available.
tryf
Three functions that could be used to solve the flash

Back to local index.

 

VII. pichelps/ Pictures of the modules
View files or Download from this directory

picfraco
Fractionator; fraco.
picmix
Mass balance mixer; mix.
picmixe
Mass and energy balance mixer; mixe.
picphaseg
Phaseg.
picreact
Mass balance reactor; react.
picreacte
Mass and energy balance reactor; reacte.
picreacten
Another mass and energy balance reactor; reacten.
picreactr
Mass balance reactor; reactr.
picsep
Mass balance separator; sep.
picsepe
Mass and energy balance separator; sepe.
picsept
Fractionator; sept.
picsplit
Mass balance splitter; split.
picsplite
Mass and energy balance splitter; splite.

Back to local index.

 

VIII. specmods/ Modules that serve a special function

View files or Download from this directory

fraco
Gives the fraction of compounds sent to the distillate in a fractionator.
phase
Tries various fractions of solutes sent to a phase.
phaseg
Calculates solute distribution in 2-phase separation
reactr
Determines the reaction rates of two reactions.
sept
Analyzes a fractionator.

Back to local index.

 

IX. utilities/ Functions used by other programs
View files or Download from this directory

addcol
Catenates two or more arrays, adds columns.
at
Converts temperatures to Kelvin.
atk
Converts the given temperature to Kelvin.
baleq
Used in setstc to set up the global matrix stoic
cext
extends a character string to n columns
cgrp
Groups 1 to 8 strings into a matrix
charmx
Makes a character array from a numerical matrix.
csum
Used in dsplay and dsplaye to sum columns.
disetne
Displays inlet flows; used in isetner and isetnev.
goodmenu
Goodmenu calls menu but checks to make sure the response is reasonable
mgrp
Adds a vector to the bottom of a matrix.
nchar
Creates n copies of a character string.
prntmx
Prints the flow matrix for energy balances
rmbl
removes blanks from a character vector (text)
ssec1
Uses linear interpolation to approximate a root of f(x)=0.
ssec2
Calls ssec1 n times to find a root of f(x)=0.
vweg1
Wegstein procedure for finding roots of multiple equations.
vweg2
Program that executes vweg1.

Back to local index.

 

X. vle/ Vapor-liquid Equilibrium
View files or Download from this directory

bubpt
Determines the bubble point of a mixture.
dewpt
Determines the dew point of a mixture.
dewpt2
Determine the dew point of a binary mixture.
fbpdp
Shows the behavior of the functions used in bubble and dew point calculations.
flash
Finds the vapor fraction and the composition of the liquid and vapor in a mixture and lists a table of results.
flashr
Performs a flash calculation with a table of results.
flsh
Returns the ratio of distillate to feed flow for each compound in a flash.
kval
Finds the distribution coefficient. for a set of compounds.
teql
Finds the temperature of compounds when they would have a given vapor pressure.
vappr
Calculates the vapor pressure from the Antoine coefficients.
vapprvt
Just like vappr but does it for a vector of temperatures.

Back to local index.


[Table of Contents |Ceng301 HomePage]

This page last updated: 8/06/98