NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group

Similar documents
Excel for Scientists and Engineers Numerical Method s. E. Joseph Billo

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

FINITE-DIMENSIONAL LINEAR ALGEBRA

TABLE OF CONTENTS INTRODUCTION, APPROXIMATION & ERRORS 1. Chapter Introduction to numerical methods 1 Multiple-choice test 7 Problem set 9

Preface. 2 Linear Equations and Eigenvalue Problem 22

Applied Numerical Analysis

Adaptive Filtering. Squares. Alexander D. Poularikas. Fundamentals of. Least Mean. with MATLABR. University of Alabama, Huntsville, AL.

A THEORETICAL INTRODUCTION TO NUMERICAL ANALYSIS

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

NUMERICAL MATHEMATICS AND COMPUTING

Linear Algebra and Probability

NUMERICAL METHODS FOR ENGINEERING APPLICATION

Numerical Methods for Engineers

Computational Methods

I. Numerical Computing

Signals and Systems Laboratory with MATLAB

Numerical Analysis. A Comprehensive Introduction. H. R. Schwarz University of Zürich Switzerland. with a contribution by

AND NONLINEAR SCIENCE SERIES. Partial Differential. Equations with MATLAB. Matthew P. Coleman. CRC Press J Taylor & Francis Croup

Numerical Methods. Scientists. Engineers

MATHEMATICAL OBJECTS in

Numerical Methods with MATLAB

NUMERICAL METHODS USING MATLAB

OPEN CHANNEL FLOW. Computer Applications. Numerical Methods and. Roland Jeppson. CRC Press UNIVERSITATSB'BUOTHEK TECHNISCHE. INFORMATlONSBiBUOTHEK

Index. function 292. Excep for Scientists and Engineers: Numerical Methods by E. Joseph Billo Copyright John Wiley & Sons, Inc.

MATHEMATICAL METHODS INTERPOLATION

Numerical Methods for Engineers and Scientists

Generalized Linear. Mixed Models. Methods and Applications. Modern Concepts, Walter W. Stroup. Texts in Statistical Science.

FUNDAMENTALS of SYSTEMS BIOLOGY From Synthetic Circuits to Whole-cell Models

Preliminary Examination in Numerical Analysis

Dynamic Systems. Simulation of. with MATLAB and Simulink. Harold Klee. Randal Allen SECOND EDITION. CRC Press. Taylor & Francis Group

MATLAB for Engineers

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems

Numerical Mathematics

Review for Exam 2 Ben Wang and Mark Styczynski

University of Texas-Austin - Integration of Computing

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

PARTIAL DIFFERENTIAL EQUATIONS

Contents. Preface for the Instructor. Preface for the Student. xvii. Acknowledgments. 1 Vector Spaces 1 1.A R n and C n 2

Name of the Student: Unit I (Solution of Equations and Eigenvalue Problems)

NUMERICAL COMPUTATION IN SCIENCE AND ENGINEERING

MULTIVARIABLE CALCULUS, LINEAR ALGEBRA, AND DIFFERENTIAL EQUATIONS

Preface to Second Edition... vii. Preface to First Edition...

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

We wish to solve a system of N simultaneous linear algebraic equations for the N unknowns x 1, x 2,...,x N, that are expressed in the general form

Advanced. Engineering Mathematics

Control Systems. LMIs in. Guang-Ren Duan. Analysis, Design and Applications. Hai-Hua Yu. CRC Press. Taylor & Francis Croup

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES

Finite Difference Methods (FDMs) 1

Conceptual Questions for Review

Applied Linear Algebra in Geoscience Using MATLAB

Preface to the Second Edition. Preface to the First Edition

Table 1 Principle Matlab operators and functions Name Description Page reference

Introduction to Numerical Analysis

GATE Engineering Mathematics SAMPLE STUDY MATERIAL. Postal Correspondence Course GATE. Engineering. Mathematics GATE ENGINEERING MATHEMATICS

Chabot College Fall Course Outline for Mathematics 25 COMPUTATIONAL METHODS FOR ENGINEERS AND SCIENTISTS

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

Preface. Figures Figures appearing in the text were prepared using MATLAB R. For product information, please contact:

Using MATLAB and. Abaqus. Finite Element Analysis. Introduction to. Amar Khennane. Taylor & Francis Croup. Taylor & Francis Croup,

Numerical Analysis Solution of Algebraic Equation (non-linear equation) 1- Trial and Error. 2- Fixed point

Contents. I Basic Methods 13

Data Fitting and Uncertainty

Contents. Preface... xi. Introduction...

Monte-Carlo Methods and Stochastic Processes

Wiley. Methods and Applications of Linear Models. Regression and the Analysis. of Variance. Third Edition. Ishpeming, Michigan RONALD R.

Index. C 2 ( ), 447 C k [a,b], 37 C0 ( ), 618 ( ), 447 CD 2 CN 2

APPLIED NUMERICAL LINEAR ALGEBRA

Applied Linear Algebra in Geoscience Using MATLAB

Numerical Analysis. Introduction to. Rostam K. Saeed Karwan H.F. Jwamer Faraidun K. Hamasalh

Engineering. Green Chemical. S. Suresh and S. Sundaramoorthy. and Chemical Processes. An Introduction to Catalysis, Kinetics, CRC Press

Contents. Preface to the Third Edition (2007) Preface to the Second Edition (1992) Preface to the First Edition (1985) License and Legal Information

SOLUTION OF EQUATION AND EIGENVALUE PROBLEMS PART A( 2 MARKS)

Numerical Methods in Matrix Computations

MATHEMATICS. Course Syllabus. Section A: Linear Algebra. Subject Code: MA. Course Structure. Ordinary Differential Equations

Numerical Methods Lecture 2 Simultaneous Equations

Introduction to. Process Control. Ahmet Palazoglu. Second Edition. Jose A. Romagnoli. CRC Press. Taylor & Francis Group. Taylor & Francis Group,

Partial Differential Equations and the Finite Element Method

LECTURES IN BASIC COMPUTATIONAL NUMERICAL ANALYSIS

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Columbus State Community College Mathematics Department Public Syllabus

INTRODUCTORY REGRESSION ANALYSIS

Engineering. Mathematics. GATE 2019 and ESE 2019 Prelims. For. Comprehensive Theory with Solved Examples

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

BASIC EXAM ADVANCED CALCULUS/LINEAR ALGEBRA

Matrix Algorithms. Volume II: Eigensystems. G. W. Stewart H1HJ1L. University of Maryland College Park, Maryland

Reduction to the associated homogeneous system via a particular solution

Special Two-Semester Linear Algebra Course (Fall 2012 and Spring 2013)

Applied Linear Algebra

Linear and Nonlinear Models

FDM for parabolic equations

Part 1. The diffusion equation

M.Sc. Maths (Colleges) onwards

Mathematical Methods for Numerical Analysis and Optimization

Kernel-based Approximation. Methods using MATLAB. Gregory Fasshauer. Interdisciplinary Mathematical Sciences. Michael McCourt.

Module 6 : Solving Ordinary Differential Equations - Initial Value Problems (ODE-IVPs) Section 1 : Introduction

CONTENTS. ABOUTTHEAUTHORS xviii PART ONE MODELING, COMPUTERS, AND ERROR ANALYSIS 3

AIMS Exercise Set # 1

MATHEMATICS FOR ECONOMISTS. An Introductory Textbook. Third Edition. Malcolm Pemberton and Nicholas Rau. UNIVERSITY OF TORONTO PRESS Toronto Buffalo

Numerical Methods for the Solution of Differential Equations

Numerical Methods for Engineers

Applied Linear Algebra in Geoscience Using MATLAB

Transcription:

NUMERICAL METHODS lor CHEMICAL ENGINEERS Using Excel', VBA, and MATLAB* VICTOR J. LAW CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Croup, an informa business

Contents Preface Author Notes to the Instructor xiii xv xvii Chapter 1 Roots of a Single Nonlinear Equation 1 1.1 Introduction 1 1.2 Algorithms for Solving/(jc) 0 = 2 1.2.1 Plotting the Equation 2 1.2.2 Fixed-Point Iteration (Direct Substitution) 2 1.2.3 Bisection 4 1.2.4 Newton's Method 6 1.2.5 Secant Method 7 1.3 Using Excel to Solve Nonlinear Equations (Goal Seek) 8 1.4 A Note on In-Ceil Iteration 16 Exercises 16 References 20 Chapter 2 Visual Basic for Applications Programming 21 2.1 Introduction 21 2.2 Algorithm Design 21 2.3 VBA Coding 24 2.4 Example VBA Project 24 2.5 Getting Help and Documentation on VBA 29 2.6 VBA Statements and Features 29 2.6.1 Assignment Statement 30 2.6.2 Expressions 30 2.6.2.1 Numerical Expressions 30 2.6.2.2 Logical (Boolean) Expressions 31 2.7 Objects and OOP 31 2.8 Built-in Functions of VBA 33 2.9 Program Control 35 2.9.1 Branching 35 2.9.1.1 If-Then-Else 35 2.9.2 Looping 35 2.9.2.1 For...Next 35 2.9.2.2 While...Wend Statement 36 2.10 VBA Data Types 36 2.11 Subs and Functions 37

vjjj Contents 2.12 Input and Output 38 2.12.1 Getting Data from the Worksheet 38 2.12.2 Putting Data onto the Worksheet 39 2.13 Array Data Structures 39 2.13.1 Array Arguments 40 2.13.2 Dynamic Arrays in VBA 42 2.14 Alternative I/O Methods 43 2.14.1 Using Range.Select 43 2.14.2 Using Message Box 43 2.14.3 Using Input Box 43 2.15 Using Debugger 44 Exercises 50 References 54 Chapter 3 Linear Algebra and Systems of Linear Equations 55 3.1 Introduction 55 3.2 Notation 55 3.3 Vectors 56 3.4 Vector Operations 57 3.4.1 Vector Addition and Subtraction 57 3.4.1.1 Multiplication by a Scalar 57 3.4.2 Vector Transpose 57 3.4.3 Linear Combinations of Vectors 58 3.4.4 Vector Inner Product 58 3.4.5 Vector Norm 58 3.4.6 Orthogonal Vectors 59 3.4.7 Orthonormal Vectors 59 3.5 Matrices 60 3.6 Matrix Operations 60 3.6.1 Matrix Addition and Subtraction 60 3.6.2 Multiplication by a Scalar 60 3.6.3 Transposition of Matrices 61 3.6.4 Special Matrices 61 3.6.5 Matrix Multiplication 61 3.6.6 Matrix Determinant 62 3.6.7 Matrix Inverse 62 3.6.8 More Special Matrices 63 3.7 Solving Systems of Linear Algebraic Equations 63 3.7.1 Gaussian Elimination 63 3.7.2 Determinant Revisited 66 3.7.3 Gauss-Jordan Elimination 67 3.7.4 Rank of Matrix 68 3.7.5 Existence and Uniqueness of Solutions for Ax = b 69 3.8 Linear Equations and Vector/Matrix Operations in Excel... 69 3.9 More about Matrix.xla 71

Contents ix 3.10 SVD and Pseudo-Inverse of a Matrix 73 Exercises 76 Reference 80 Chapter 4 Numerical Differentiation and Integration 81 4.1 Numerical Differentiation 81 4.1.1 Approximation of a Derivative in One Variable 81 4.1.2 Approximation of Partial Derivatives 84 4.2 Numerical Integration 86 4.2.1 Trapezoidal Rule 86 4.2.2 Simpson's Rule 87 4.2.3 Gauss Quadrature 88 4.3 Curve Fitting for Integration 91 Exercises 93 Chapter 5 Ordinary Differential Equations (Initial Value Problems) 99 5.1 Introduction 99 5.1.1 General Statement of the Problem 99 5.2 Euler-Type Methods 99 5.2.1 Euler's Method for Single ODE 99 5.2.2 Stability of Numerical Solutions of ODEs 102 5.2.3 Euler Backward Method 102 5.2.4 Trapezoidal Method (Modified Euler) 103 5.2.5 Accuracy of Euler-Type Methods 105 5.3 RK Methods 105 5.3.1 Second-Order RK Method 106 5.3.2 Fourth-Order RK Method 107 5.4 Stiff ODEs 108 5.5 Solving Systems of ODE-IVPs 109 5.6 Higher-Order ODEs Ill Exercises 116 Chapter 6 Ordinary Differential Equations (Boundary Value Problems) 123 6.1 Introduction 123 6.2 Shooting Method 124 6.3 Split BVPs Using Finite Differences 125 6.4 More Complex Boundary Conditions with ODE-BVPs 127 Exercises 129 Reference 135 Chapter 7 Regression Analysis and Parameter Estimation 137 7.1 Introduction and the General Method of Least Squares 137

X Contents 7.2 Linear Regression Analysis 139 7.2.1 Straight Line Regression 139 7.2.2 Curvilinear Regression 142 7.3 How Good Is the Fit from a Statistical Perspective? 145 7.3.1 Residual Plots 145 7.3.2 Correlation Coefficient 146 7.3.3 Parameter Standard Deviations 146 7.3.4 Parameter Confidence Intervals 147 7.3.5 Using f-ratios (f-statistics) for Individual Parameter Significance 148 7.4 Regression Using Excel's Regression Add-In 153 7.5 Numerical Differentiation and Integration Revisited 155 Exercises 156 Chapter 8 Partial Differential Equations 161 8.1 Introduction 161 8.2 Parabolic PDEs 161 8.2.1 Explicit Method (Centered Difference in x, Forward Difference in 0) 163 8.2.2 Centered Difference in x, Backward Difference in 6 165 8.2.3 Crank-Nicholson Method (Centered Difference in x, Centered Difference in 6) 165 8.3 Thomas Algorithm for Tridiagonal Systems 167 8.4 Method of Lines 172 8.5 Successive Overrelaxation for Elliptic PDEs 173 Exercises 177 Chapter 9 Linear Programming, Nonlinear Programming, Nonlinear Equations, and Nonlinear Regression Using Solver 179 9.1 Introduction 179 9.2 Linear Programming 179 9.3 Nonlinear Programming 184 9.4 Nonlinear Equations 186 9.5 Nonlinear Regression Analysis 189 Exercises 191 Chapter 10 Introduction to MATLAB 195 10.1 Introduction 195 10.2 MATLAB Basics 196 10.2.1 MATLAB Colon Operator 201 10.2.2 MATLAB, M-Files, and Input from Command Window 202

Contents xi 10.3 MATLAB Programming Language Statements 204 10.3.1 If-Then-Else Statements 204 10.3.2 Looping Statements (For, While) 205 10.4 MATLAB Function Arguments 206 10.5 Plotting in MATLAB 207 10.5.1 Plotting Two Functions on the Same Graph 207 10.6 Example MATLAB Programs 208 10.7 Closing Comment Regarding MATLAB 216 Exercises 217 Appendix: Additional Features of VBA 219 A.l Introduction 219 A.2 Calling Excel Built-in Functions in VBA Macros 219 A.3 Calling Excel Add-In Functions in VBA Macros 220 A.4 Variant Data Type 221 A.5 VBA Function That Returns an Array 223 A.6 Creating Excel Add-Ins 225 Index 227