Programming for Chemical Engineers Using C, C++, and MATLAB®

Book description

Designed for chemical engineering students and industry professionals, Programming for Chemical Engineers Using C, C++, and MATLAB® shows how to write reusable computer programs by guiding the reader through the process of: establishing the theoretical concept; determining the applicable numerical methods; testing the algorithm through manual calculation; writing and debugging the computer program based on the algorithm; and validating the result, using statistical analysis. All programs in the book are written in the three most popular languages (C, C++, and MATLAB) currently used in the chemical engineering curriculum and in industry. Because the book is written by a chemical engineer, practitioners and students will learn to write programs for appropriate subject matter of interest to them.

Table of contents

  1. Title
  2. Copyright
  3. About the Author
  4. Acknowledgments
  5. Preface
  6. Table of Contents (1/2)
  7. Table of Contents (2/2)
  8. Introduction
    1. Purpose of this Book
    2. Computer Programming Languages Used
    3. How to Use this Book
    4. Special Note from the Author
  9. Part I: Using C and C++
    1. Chapter 1 Review on C Programming
      1. Constant and Variable Name Declaration
        1. Name Declaration
        2. Variable Name Declaration
      2. Basic Output and Input Statements
        1. Output Statements
        2. Input Statements
      3. Operators (1/2)
      4. Operators (2/2)
        1. Arithmetic Operators
        2. Assignment Operators
        3. Relational Operators
        4. Logical Operators
      5. Conditional Statements
        1. if - else Statement
        2. Nested if - else if Statement
        3. switch/case Conditional Statement
      6. Looping Statements
        1. for Loop Statement
        2. while Loop Statement
        3. do-while Loop Statement
      7. Arrays
      8. Creating Functions
      9. Laboratory Exercises
    2. Chapter 2 Numerical Computation
      1. Solving Simultaneous Linear Equations (1/3)
      2. Solving Simultaneous Linear Equations (2/3)
      3. Solving Simultaneous Linear Equations (3/3)
        1. Matrix Algebra
        2. Cramer’s Rule and Determinants
        3. Gauss-Jordan Method
        4. Numerical Method
        5. The Jacobi Method and Gauss-Seidel Methods
      4. Regression Analysis (1/3)
      5. Regression Analysis (2/3)
      6. Regression Analysis (3/3)
        1. Linear Regression
        2. Linear Regression for Nonlinear Relationships
        3. Polynomial Regression
      7. Validation Through Statistical Analysis
        1. Correlation Coefficient and Coefficient of Determination
        2. Standard Error of Estimate
        3. Significance Tests
      8. Interpolation Analysis
        1. Linear Interpolation
        2. Lagrange Polynomial Interpolation
      9. Linear Programming (1/2)
      10. Linear Programming (2/2)
        1. Simplex Method
      11. Laboratory Exercises
    3. Chapter 3 Physical Properties—Prediction and Approximation
      1. Phase Equilibrium (1/2)
      2. Phase Equilibrium (2/2)
        1. Binary System
        2. Antoine Equation
        3. Benzene-Toluene Equilibrium System
      3. Saturated Steam Data (1/3)
      4. Saturated Steam Data (2/3)
      5. Saturated Steam Data (3/3)
        1. Saturated Pressure
        2. Densities (ρ) and Specific Volumes (ν)
        3. Specific Enthalpy
        4. Specific Entropy
      6. Humidity
        1. Relative Humidity
        2. Absolute Humidity
        3. Dew Point (DP)
      7. Duhring’s Rule (Boiling Point Elevation)
        1. NaOH – Water System
      8. Enthalpy-Concentration
        1. NaOH–Water System
      9. Friction Factor
        1. Reynolds Number/Friction Factor Relationship
      10. Laboratory Exercises
    4. Chapter 4 Applications Using C
      1. Material Balance
        1. Multiple Reactors
        2. Condensation
      2. Energy Balance
        1. Multiple-Effect Evaporators
      3. Fluid Flow
        1. Pressure-Drop Determination
        2. Pipe Diameter Calculation
      4. Mass and Heat Transfer (1/5)
      5. Mass and Heat Transfer (2/5)
      6. Mass and Heat Transfer (3/5)
      7. Mass and Heat Transfer (4/5)
      8. Mass and Heat Transfer (5/5)
        1. Temperature Determination in Two-Dimensional Conduction
        2. Evaporation
        3. Distillation
      9. Optimization
        1. Process Design
        2. Plant Operation
      10. Laboratory Exercises
    5. Chapter 5 Overview of C++
      1. C and C++ Syntax (1/3)
      2. C and C++ Syntax (2/3)
      3. C and C++ Syntax (3/3)
        1. Basic Output and Input Stream
        2. Conditional Statements
        3. Looping Statements
        4. Arrays
        5. Functions
      4. Object-Oriented Programming (OOP) in C++
        1. Class
      5. Distillation Program Listing Revisited (1/2)
      6. Distillation Program Listing Revisited (2/2)
      7. Laboratory Exercises
  10. Part II: Using Matlab
    1. Chapter 6 Introduction to MATLAB®
      1. The MATLAB Environment
        1. MATLAB Desktop
        2. Command Window
        3. Command History Window
        4. Editor/Debugger
        5. Workspace
        6. Current Directory Window
        7. Array Editor
        8. Help Window
      2. Developing M-Files
      3. Variable and Constant Name Declaration
      4. Basic Output and Input Statements
        1. Output Statements
        2. Input Statements
      5. Operators
        1. Arithmetic and Assignment Operators
        2. Relational Operator
        3. Logical Operators
      6. Conditional Statements
        1. The if-else Statement
        2. The if-elseif Statement
        3. The switch/case Statement
      7. Looping Statements
        1. The for Loop Statement
        2. The while Loop Statement
      8. Scalars, Vectors, and Matrices (1/2)
      9. Scalars, Vectors, and Matrices (2/2)
        1. Initialization
        2. Manipulating Arrays
        3. Arithmetic Operation
      10. Creating Functions
      11. Plotting (1/2)
      12. Plotting (2/2)
        1. Basic 2D Plotting
        2. Axis Command Functions
        3. Titles and Labels
        4. Adding Lines to Graphs
        5. Setting Line Style and Width
        6. Basic 3D Plotting
      13. Laboratory Exercises
    2. Chapter 7 Matlab Functions for Numerical Computation
      1. The Matrix Method for Linear Equations
        1. The inv ( ) Function
        2. Matrix Left Division (\)
      2. Regression and Curve Fitting
        1. The polyfit ( ) Function
        2. The polyval ( ) Function
        3. Coefficient of Determination and Standard Error of Estimate
      3. Finding Roots
        1. The roots ( ) Function
        2. The fzero ( ) Function
      4. Interpolation (1/2)
      5. Interpolation (2/2)
        1. One-Dimensional Interpolation
        2. Two-Dimensional Interpolation
      6. Numerical Integration
        1. Trapezoidal Integration
        2. Quadrature
      7. Ordinary Differential Equations (ODE)
        1. The ode23 ( ) and ode45 ( ) Functions
      8. Laboratory Exercises
    3. Chapter 8 Applications Using Matlab
      1. Physical Properties Approximation (1/3)
      2. Physical Properties Approximation (2/3)
      3. Physical Properties Approximation (3/3)
        1. Saturated Steam Pressure-Temperature Relationship
        2. Binary System – Equilibrium Curve
        3. Enthalpy-Concentration Relationship for Magnesium Sulfate System
        4. Phase Diagram – Magnesium Sulfate System
      4. Chemical Engineering Sample Problems (1/5)
      5. Chemical Engineering Sample Problems (2/5)
      6. Chemical Engineering Sample Problems (3/5)
      7. Chemical Engineering Sample Problems (4/5)
      8. Chemical Engineering Sample Problems (5/5)
        1. Equation of State – Cubic Volume
        2. Compressibility Factor
        3. Simple Differential Distillation
        4. Two-Dimensional Conduction
        5. Reactor Tanks
        6. Reaction in Series
        7. Crystallization
      9. Laboratory Exercises
    4. Chapter 9 Interfacing MATLAB® with C
      1. Introduction to Mex-Files
        1. Components of MEX-files
        2. MATLAB Supported C/C++ Compilers
      2. Handling Scalars
        1. One Scalar Input and One Scalar Output
        2. Two Scalar Inputs and One Scalar Output
      3. Handling Vectors
        1. One Vector Input and One Scalar Output
      4. Handling Matrices (1/2)
      5. Handling Matrices (2/2)
        1. Multiple Matrix Inputs and One Vector Output
      6. Previous Evaporation Problems Revisited (1/3)
      7. Previous Evaporation Problems Revisited (2/3)
      8. Previous Evaporation Problems Revisited (3/3)
        1. Revisited Example Problem 4.7
        2. Revisited Example Problem 4.8
      9. Introduction to the MATLAB Engine
        1. Components of the MATLAB Engine
        2. Plotting Example
        3. Compiling Engine Programs
      10. Modified Distillation Program
      11. Laboratory Exercises
  11. Continuing on
  12. Appendix A: C/C++ Compilers
  13. Appendix B: MATLAB®
  14. Appendix C: C/C++ Functions and Statements
  15. Appendix D: MATLAB Functions and Commands
  16. Appendix E: MATLAB Graphical User Interface (GUI) Development Overview (1/4)
  17. Appendix E: MATLAB Graphical User Interface (GUI) Development Overview (2/4)
  18. Appendix E: MATLAB Graphical User Interface (GUI) Development Overview (3/4)
  19. Appendix E: MATLAB Graphical User Interface (GUI) Development Overview (4/4)
  20. Appendix F: Alternative Matrix Based Programming Languages
  21. Appendix G: Saturated Steam Table (1/3)
  22. Appendix G: Saturated Steam Table (2/3)
  23. Appendix G: Saturated Steam Table (3/3)
  24. Appendix H: IAPWS 95 C Program (by Stephen L. Moshier) (1/7)
  25. Appendix H: IAPWS 95 C Program (by Stephen L. Moshier) (2/7)
  26. Appendix H: IAPWS 95 C Program (by Stephen L. Moshier) (3/7)
  27. Appendix H: IAPWS 95 C Program (by Stephen L. Moshier) (4/7)
  28. Appendix H: IAPWS 95 C Program (by Stephen L. Moshier) (5/7)
  29. Appendix H: IAPWS 95 C Program (by Stephen L. Moshier) (6/7)
  30. Appendix H: IAPWS 95 C Program (by Stephen L. Moshier) (7/7)
  31. Appendix I: Antoine Equation Constants
  32. Appendix J: Student’s T-Distribution Table
  33. Appendix K: References
  34. Appendix L: Open Watcom Public License (1/2)
  35. Appendix L: Open Watcom Public License (2/2)
  36. Appendix M: About The CD-ROM (1/2)
  37. Appendix M: About The CD-ROM (2/2)
  38. Index (1/3)
  39. Index (2/3)
  40. Index (3/3)

Product information

  • Title: Programming for Chemical Engineers Using C, C++, and MATLAB®
  • Author(s): R. Kapuno
  • Release date: March 2008
  • Publisher(s): Jones & Bartlett Learning
  • ISBN: 9781449613051