5_numerical methods for chemical engineers with matlab applications

Upload: gonzalo1959

Post on 03-Apr-2018

229 views

Category:

Documents


1 download

TRANSCRIPT

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    1/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    2/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    3/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    4/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    5/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    6/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    7/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    8/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    9/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    10/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    11/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    12/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    13/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    14/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    15/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    16/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    17/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    18/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    19/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    20/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    21/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    22/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    23/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    24/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    25/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    26/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    27/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    28/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    29/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    30/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    31/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    32/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    33/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    34/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    35/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    36/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    37/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    38/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    39/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    40/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    41/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    42/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    43/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    44/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    45/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    46/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    47/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    48/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    49/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    50/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    51/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    52/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    53/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    54/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    55/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    56/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    57/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    58/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    59/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    60/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    61/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    62/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    63/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    64/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    65/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    66/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    67/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    68/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    69/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    70/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    71/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    72/100

    450 Linear and Nonlinear Regression Analysis Chapter 7According to Him melblau and Bischoff [I]: "Process analysis is the application of scientificmethods to the recognition and definition of problems and the development of procedures fortheir solution. In more detail, this means (1) mathem atical specification of the problem for thegiven physical solution, (2) detailed analysis to obtain mathem atical models, and (3) synthesisand presentation of results to ensure full comprehension."

    In the heart of successful p rocess analysis is the step of mathematical modeling. Theobjective of modeling is to construct, from theoretical and empirical knowledge of a process,a mathematical formulation that can be used to predict the behavior of this process. Completeunderstanding of the m echanism of the chemical, physical, o r biological aspects of the processunder investigation is not usually possible. How ever, som e information on the mechan ism ofthe system may b e available; therefore, a combination of empirical and theoretical methodscan be used. According to Box and Hunter [2]: "No m odel can give a precise description ofwhat happens. A working theoretical model, how ever, supplies information on the systemunder study over important ranges of the variables by means of equations w hich reflect at leastthe major features of the mechanism."

    Th e engineer in the process industries is usually conce rned w ith the operation of existingplants and the development of new processes. In the first case, the control, improvem ent, andoptimization of the operation are the engineer's m ain objectives. In order to achieve this, aquantitative representation of the process, a model, is needed that would g ive the relationshipbetween the various parts of the system. In the design of new processes, the engineer drawsinformation fro m theory and the literature to construct mathem atical models that may be usedto simulate the process (see Fig. 7.1). The development of mathem atical models oftenrequiresthe implementation of an experimental program in orde r to obtain the necessary informationfor the verification of the models. The experimental program is originally designed based onthe theoretical considerations coupled with a priori knowledge of the process and issubsequen tly modified based on the results of regression analysis.

    Regression analysis is the application of mathematical and statistical methods for theanalysis of the experimental data and the fitting of the mathematical models to these data bythe estimation of the unknown param eters of the models. The series of statistical tests, whichnorma lly accom pany regression analysis, serve in model identification, model verification, andefficient design of the experimen tal program.

    Strictly speaking, a mathematical model of a dynamic system is a set of equations thatcan be used to calculate how the state of the system evolves throug h time under the action ofthe control variables, given the state of the system at som e initial time. The sta te of thesystem is described by a set of variables known as state variables. The first stage in thedevelopm ent of a mathematical model is to identify the state and control variables.

    Th e control variables are those that can be directly controlled by the experimenter andthat influence the way the system changes from its initial state to that of any later time.Exam ples of control variables in a chem ical reaction system m ay be the temperature, pressure,and/or concentration of some of the componen ts. Th e state variables are those that describethe state of the system and that are not under direct control. Th e concentrations of reactantsand products are state variables in chemical system s. Th e distinction between state and control

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    73/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    74/100

    452 Linear and Nonlinear Regression Analysis Chapter 7where x = independent variable

    y = vector of state (dependent) variablesI3 = vector of control variablesb = vector of parameters whose values must be determined

    In this chapter, we concern ourselves w ith the methods of e stimating the parameter vector busing regression analysis. For this purpose, we assume that the vector of control variables 8is fixed; therefore, the mathematical mode l simplifies to

    In their integrated form , the a bove set of perform ance equations convert to

    For regression analysis, mathem atical models are classified as linear or nonlinear withrespect to the unkno wn parameters. For example, the following differential equation:

    which we classified earlier as linear with respect to the dependent variable (see Chap. 5 ) , isnonlinear with respect to the parameter k. This is clearly show n by the integrated form of Eq.(7.4):

    where y is highly nonlinear w ith respect to k.Most mathematical models encountered in engineering and the sciences are nonlinearin the parameters. Attempts at linearizing these models, by rearranging the equations and

    regrouping the variables, were common practice in the precomputer era, when graph paper andthe straightedge were the tools for fitting mode ls to experimental data. Such primitivetechniques have been replaced by the implementation of linear and nonlinear regressionmethods on the com puter.

    Th e theory of linearreg ressio n has been expounded by statisticians and econom etricians,and a rigorous statistical analysis of the regression results has been developed. Nonlinearregression is an extension of the linear regression methods used iteratively to anive at thevalues of the parameters of the nonlinear models. The statistical analysis of the nonlinearregression results is also an extension of that applied in linear analysis but does not possessthe rigorous theoretical basis of the latter.

    In this chapte r, after giving a brief review of statistical terminology, we develop the basicalgorithm of linear regression and then show how this is extended to nonlinear regression. Wedevelop the methods in m atrix notation so that the algorithms are equally applicable to fittingsingle or multiple variables an d to using single or multiple sets of experimental data.

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    75/100

    7.2 Review of Statistical Terminology Used in Regression Analysis 453

    It is assumed that the reader has a rudimentary knowledge of statistics. This section serves asa review of the statistical definitions and termino logy needed for understanding the applicationof linear and nonlinear regression analysis and the statistical treatment of the results of thisanalysis. For am or ec om pl ete discussion of statistics, the reader should consult a standard texton statistics, such as Bethea [31 and O stle et al. 141.

    7.2.1 Population and Sample S tatisticsA population is defined as a grou p of similar items, or events, from w hich a samp le is drawnfor test purposes; the population is usually assumed to be very large, sometimes infinite. Asample is a random selection of items from a population, usually made for evaluating avariable of that population. Th e variable und er investigation is a characteristic property of thepopulation.A random variable is defined as a variable that can assume any value from a set ofpossible values. A statistic or statistical parameter is any quantity computed from a sam ple;it is characteristic of the sam ple, and it is used to estimate the characteristics of the populationvariable.

    Degrees offreedom can be defined as the number of ob servations made in excess of theminimum theoretically necessary to estimate a statistical parameter or any unkn own qu antity.Le t us use the notation N to designate the total num ber of items in the population understudy, where 0 s N 5 m, and n o specify the nu mber of items contained in the sample taken

    from that population, where 0 i n 5 N. Th e variable being investigated will be designated asX; it may have discrete values, or it may be a continuous function , in the range -m

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    76/100

    454 Linear and Nonlinear Regression Analysis Chapter 7The frequency at which each value of the variable (age, in the above exam ple) may occur

    in the population is not the same ; some values (ages) w ill occur mo re frequently than others.Designating m, as the number of times the value of x, occurs , we can define the concept ofprobability of occurrence as

    number of occurrences of xJtotal number of observations

    For a discrete random variable, p(xj) is called the probub ility function, and it has thefollowing properties:

    0 < p(xl ) < 1

    The shape of a typical probability function is shown in Fig. 7 . 2~ .For a continuous random variable, the probability of occurrence is measured by the

    continuous function p(x), w hich is called the probubility density function, so thatP r { x < X F- x + d x ) = p ( x ) d x (7.8)

    The probability density function has the following properties:

    Th e smooth cutlie obtained from plottingp(x ) versus x (Fig. 7 . 3 ~ )s called the continuousprobab ility density distribution.

    Th e clrmulative distribu tionfu nction is defined as the probability that a random variableX will not exceed a given value x, that is:

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    77/100

    7.2 Review of Statistical Termino logy U sed in Regress ion Ana lysis 455The equivalent of Eq. (7.10)for a discrete random variable is

    The cumulative distribution functions for discrete and continuous random variables areillustrated in Figs. 7.2b and 7.3b, respectively.

    It is obvious from the integral of Eq. (7 .10) hat the cumulative distribution function isobtained from calculating the area under the density distribution function. The three areasegments show n in Fig. 7.3a correspond to the following three probabilities:

    P r { X s x a ] = [ p ( x ) d x (7.12)

    Figure 7.2 (a) Probability function and (b )cumulative distribution function for discreterandom variable.

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    78/100

    456 Linear and Nonlinear Regression Analysis Chapter 7-P r { X > x n J = p ( x ) d x1 (7 . 1 4 )X1

    The population mean, or expected value, of a discrete random variable i s defined as

    and that of a continuous random variable as -p = E [ X ] = x p ( x ) d xS

    ~-

    Figure 7.3 (a) Probability density function and (b)cumulative distribution functionfor a continuous random variable.

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    79/100

    7.2 Review of Statistical Terminology Used in Regression Analysis 457

    The usefulness of the concept of expectation, as defined above, is that it corresponds to ourintuitive idea of average, or equivalently to the center of gravity of the probability densitydistribution along then-ax is. It is easy to show that combining Eqs. (7 .15)and (7 .6 )yields thearithmetic average of the random variable for the entire population:

    In addition, the integral of Eq. (7 .16)can be recognized from the field of mechanics as thefirstnoncentral mo ment of X.The sample mean, or arithmetic average, of a sample of observations is the valueobtained by dividing the sum of observations by their total number:

    Th e expected value of the sample mean is given by

    that is, the sam ple mean is an unbiased estimate of the population mean.In MATLAB the built-in function m ean(x ) calculates the mean value of the vector x

    [Eq. (7 .18) ] . If x is a m atrix, m ean(x )returns a vector of mean values of each column.The population variance is defined as the expected value of the square of the deviation

    of the random variable X from its expectation:

    For a discrete random variable, Eq. (7.20) is equivalent toM

    oZ = C ( x , - L d 2 p ( x , )j = l

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    80/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    81/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    82/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    83/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    84/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    85/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    86/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    87/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    88/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    89/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    90/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    91/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    92/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    93/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    94/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    95/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    96/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    97/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    98/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    99/100

  • 7/28/2019 5_numerical Methods for Chemical Engineers With Matlab Applications

    100/100