NUMERICAL METHODS FOR CHEMICAL ENGINEERS
WITH MATLAB APPLICATIONS
by
A. Constantinides and N. Mostoufi
Prentice Hall PRT
Upper Saddle River, New Jersey (1999).

Brief Description

The programs contained on this CD-ROM have been written in the MATLAB 5.0 language and will execute in the MATLAB command environment (Version 5.0 or higher) in all three operating systems (WINDOWS, Macintosh, and UNIX). There are 21 examples, 29 methods, and 13 other function scripts on this CD-ROM. A list of the programs is given in the section of the book entitled "Programs on the CD-ROM." Complete discussions of all programs are given in the corresponding chapters of the text.

MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment. It is assumed that the user has access to MATLAB. If not, MATLAB may be purchased from:

The MathWorks, Inc.
24 Prime Park Way
Natick, MA 07160
Phone: 508-647-7101
http://www.mathworks.com

The Student Edition of MATLAB may be obtained from:

Prentice Hall, Inc.
One Lake Street
Upper Saddle River, NJ 07458
http://www.phptr.com

An introduction to MATLAB fundamentals is given in Appendix A of this book.

Program Installation for WINDOWS

To start the installation, do the following:

1. Insert the CD-ROM in your CD-ROM drive (usually d: or e:)
2. Choose Run from the WINDOWS Start menu, type d:\setup (or e:\setup) and click OK.
3. Follow the instructions on screen.
4. When the installation is complete, run MATLAB and set the MATLAB search path as described below.

This installation procedure copies all the MATLAB files to the user's hard disk (default directory is C:\Program Files\Numerical Methods). It also places a shortcut, called Numerical Methods, on the Start Programs menu of WINDOWS (see Fig. 1). This shortcut accesses all twenty-one examples from the seven chapters of the book (but not the methods). In addition, the shortcut provides access to the readme file (in three different formats: pdf, html, and doc). Choosing an example from the shortcut enables the user to view the MATLAB script of that example with the MATLAB Editor. Files have been installed on the hard disk with the "read-only" attribute in order to prevent the user from inadvertently modifying the program files (see Editing the Programs, below). To execute any of the examples see Executing the Programs, below.

Figure 1 Arrangement of the Numerical Methods programs in the Start menu.

Program Installation for Macintosh

To start the installation, do the following:

1. Insert the CD-ROM in the CD-ROM drive on a Macintosh computer.
4. Open the folder named MAC on the CD-ROM. This contains a compressed file (zip file) named NUMMETH.ZIP.
3. Copy the file NUMMETH.ZIP to your computer and uncompress it using zipit or StuffIt Expander. This will create a folder named Numerical Methods which contains all the programs of this book.
4. When the installation is complete, run MATLAB and set the MATLAB search path as described below.

Program Installation for UNIX Systems

To start the installation, do the following:

1. Insert the CD-ROM in the CD-ROM drive on a UNIX workstation.
2. Open the folder named UNIX on the CD-ROM. This contains a compressed file (tar file) named nummeth.tar.
3. Copy the file nummeth.tar to your computer and uncompress it using the tar command:

tar xf nummeth.tar

This will create a folder named Numerical Methods which contains all the programs of this book.
4. When the installation is complete, run MATLAB and set the MATLAB search path as described below.

Setting the Matlab Search Path

It is important that the search path used by MATLAB is set correctly so that the files may be found from any directory that MATLAB may be running. In the MATLAB Command Window choose File, Set Path. This will open the Path Browser. From the menu of the Path Browser choose Path, Add to Path. Add the directories of your hard disk where the Numerical Methods programs have been installed (the default directory for the WINDOWS installation is C:\Program Files\Numerical Methods\Chapter1, etc.). The path should look as in Fig. 2, provided that the default directory was not modified by the user during setup.

Executing the Programs

To execute any of the examples, simply enter the name of that example in the MATLAB Command Window:

>>Example1_1

To get a brief description of any program, type help followed by the name of the program:

>>help Example1_1

To get descriptions of the programs, in each chapter type help followed by the name of the chapter:

>>help chapter1

Editing the Programs

The setup procedure installs the files on the hard disk with the "read-only" attribute in order to prevent the user from inadvertently modifying the program files. If any of the program files are modified, they should be saved with a different name. To modify any of the MATLAB language programs, use the MATLAB Editor. Read the comments at the beginning of each program before making changes.

 

 

Figure 2 The correct MATLAB search path that includes all seven chapters of the Numerical Methods software.

 

WARNING: The original MATLAB Version 5.2 had a "bug." The command

linspace(0,0,100)

which is used in LI.m, NR.m, and NRpoly.m in Chapter 1, will not work properly in the MATLAB installations of Version 5.2 which have not yet been corrected. A patch which corrects this problem is available on the website of Math Works, Inc.:

http://www.mathworks.com

If you have Version 5.2, you are strongly encouraged to download and install this patch, if you have not done so already.