A First Course on Kinetics and Reaction Engineering Example S3.1

Similar documents
A First Course on Kinetics and Reaction Engineering Example 4.6

A First Course on Kinetics and Reaction Engineering Example 9.4

A First Course on Kinetics and Reaction Engineering Example 13.3

A First Course on Kinetics and Reaction Engineering Example 15.2

A First Course on Kinetics and Reaction Engineering Example 13.2

A First Course on Kinetics and Reaction Engineering Example 14.3

A First Course on Kinetics and Reaction Engineering Supplemental Unit S4. Numerically Fitting Models to Data

A First Course on Kinetics and Reaction Engineering Example S5.1

A First Course on Kinetics and Reaction Engineering Example 1.4

A First Course on Kinetics and Reaction Engineering Example S6.2

A First Course on Kinetics and Reaction Engineering Example 33.2

A First Course on Kinetics and Reaction Engineering Example 15.4

A First Course on Kinetics and Reaction Engineering Example 23.1

A First Course on Kinetics and Reaction Engineering Example 26.3

A First Course on Kinetics and Reaction Engineering Example 38.2

A First Course on Kinetics and Reaction Engineering Example 33.1

A First Course on Kinetics and Reaction Engineering Example 30.1

LAB 5 INSTRUCTIONS LINEAR REGRESSION AND CORRELATION

Ratio of Polynomials Fit One Variable

A First Course on Kinetics and Reaction Engineering Supplemental Unit S5. Solving Initial Value Differential Equations

A First Course on Kinetics and Reaction Engineering Example 29.3

A First Course on Kinetics and Reaction Engineering Example 38.1

Data Assimilation. Matylda Jab lońska. University of Dar es Salaam, June Laboratory of Applied Mathematics Lappeenranta University of Technology

Lecture 2. The Simple Linear Regression Model: Matrix Approach

MATLAB BASICS. Instructor: Prof. Shahrouk Ahmadi. TA: Kartik Bulusu

STAT 3022 Spring 2007

Simulink Modeling Tutorial

SF1901 Probability Theory and Statistics: Autumn 2016 Lab 2 for TCOMK

Ratio of Polynomials Fit Many Variables

1 Overview of Simulink. 2 State-space equations

A First Course on Kinetics and Reaction Engineering Unit 4. Reaction Rates and Temperature Effects

Any of 27 linear and nonlinear models may be fit. The output parallels that of the Simple Regression procedure.

MATLAB Ordinary Differential Equation (ODE) solver for a simple example 1. Introduction

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

MEAM 520. More Velocity Kinematics

The roots are found with the following two statements. We have denoted the polynomial as p1, and the roots as roots_ p1.

Math 98 - Introduction to MATLAB Programming. Spring Lecture 3

Math Assignment 3 - Linear Algebra

BIOE 198MI Biomedical Data Analysis. Spring Semester Lab 6: Least Squares Curve Fitting Methods

CHEE 222: PROCESS DYNAMICS AND NUMERICAL METHODS

Statistical Test of the Global Warming Hypothesis

Passing-Bablok Regression for Method Comparison

Chapter 2: Numeric, Cell, and Structure Arrays

Automatic Control II Computer exercise 3. LQG Design

Empirical Application of Simple Regression (Chapter 2)

AMS 315/576 Lecture Notes. Chapter 11. Simple Linear Regression

Stat 5303 (Oehlert): Tukey One Degree of Freedom 1

A two-dimensional FE truss program

Representing Polynomials

SOLUTIONS to Exercises from Optimization

Colliding Pucks on a Carom Board

Chapter Goals. To understand the methods for displaying and describing relationship among variables. Formulate Theories.

Lab 1: Dynamic Simulation Using Simulink and Matlab

Simple Linear Regression

Measuring the fit of the model - SSR

Linear System Theory

Inferences on Linear Combinations of Coefficients

State Feedback Controller for Position Control of a Flexible Link

BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012

16.3 One-Way ANOVA: The Procedure

CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN

Matlab Exercise 0 Due 1/25/06

Introduction to Occupancy Models. Jan 8, 2016 AEC 501 Nathan J. Hostetter

Math/Phys/Engr 428, Math 529/Phys 528 Numerical Methods - Summer Homework 3 Due: Tuesday, July 3, 2018

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,

Laboratory 11 Control Systems Laboratory ECE3557. State Feedback Controller for Position Control of a Flexible Joint

Math 343 Lab 7: Line and Curve Fitting

Applied Regression Modeling: A Business Approach Chapter 3: Multiple Linear Regression Sections

Basic Statistics Exercises 66

Predici 11 Quick Overview

New Mexico Tech Hyd 510

Advanced Machine Learning Practical 4b Solution: Regression (BLR, GPR & Gradient Boosting)

EGR 111 Heat Transfer

I i=1 1 I(J 1) j=1 (Y ij Ȳi ) 2. j=1 (Y j Ȳ )2 ] = 2n( is the two-sample t-test statistic.

Example 1 (Characteristic Equation, Eigenvalue, and Eigenvector)

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

Statistical Modelling in Stata 5: Linear Models

Least square fit of a line/polynomial to input/output data

MECH : a Primer for Matlab s ode suite of functions

2 Solving Ordinary Differential Equations Using MATLAB

CLUe Training An Introduction to Machine Learning in R with an example from handwritten digit recognition

Quantitative Analysis of Financial Markets. Summary of Part II. Key Concepts & Formulas. Christopher Ting. November 11, 2017

Hypothesis Testing for Var-Cov Components

AMSC/CMSC 466 Problem set 3

Introduction to Matlab

Statistical methods. Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra

Red Hot Half-Life Modeling Nuclear Decay

Double Inverted Pendulum (DBIP)

NCSS Statistical Software. Harmonic Regression. This section provides the technical details of the model that is fit by this procedure.

632 CHAP. 11 EIGENVALUES AND EIGENVECTORS. QR Method

ACCELERATION. 2. Tilt the Track. Place one block under the leg of the track where the motion sensor is located.

ChE 505 Chapter 2N APPENDIX A

Experiment 1: Linear Regression

1 A Review of Correlation and Regression

Describing the Relationship between Two Variables

MATH 644: Regression Analysis Methods

Statistical View of Least Squares

Inference for the Regression Coefficient

Some general observations.

Transcription:

Example S3.1 Problem Purpose This example shows how to use the MATLAB script file, FitLinSR.m, to fit a linear model to experimental data. Problem Statement Assume that in the course of solving a kinetics problem, you have reached the point where you have data from eleven experiments, and that the data have been worked up to give the eleven data points listed in Table 1. The table shows that there are three set variables, x1 through x3 and one response variable, ŷ. Further assume that in order to solve this problem, you need to determine whether the linear model given in equation (1) offers a good representation of these data. That is, you need to fit equation (1) to these data, decide whether the fit is acceptable, and if it is acceptable, report the best values for the parameters m1, m2, m3 and b. Table 1 x1 x2 x3 ŷ 0 5 20 12.27 1 4 19 11.15 2 3 18 9.77 3 2 17 8.88 4 1 16 8.21 5 0 15 7.05 6 1 14 15.46 7 2 12 26.0 8 3 10 36.9 9 4 6 49.4 10 5 4 58.1 y = m 1 x 1 + m 2 x 2 + m 3 x 3 + b (1) Problem Analysis The model is a general linear equation, and it does have an intercept, so it can be fit to the data in its present form using the MATLAB script file FitLinSR.m that is provided with this supplemental unit. AFCoKaRE, Example S3.1 1

Problem Solution The first step is to import or enter the data and store them in the MATLAB workspace in the form of a matrix, x, and a column vector, y_hat. The first column in the matrix x should correspond to set variable x1, the second column should correspond to set variable x2 and the third column to set variable x3. There should be a fourth column in the matrix, x, that contains the value 1.0 in every row. The column vector, y_hat, should contain the measured values of the response variables. The matrix, x, and the column vector, y_hat, should each have 11 rows, with one row corresponding to each of the experimental data points, as shown in Listings 1 and 2. x = y_hat = 0 5 20 1 1 4 19 1 2 3 18 1 3 2 17 1 4 1 16 1 5 0 15 1 6 1 14 1 7 2 12 1 8 3 10 1 9 4 6 1 10 5 4 1 12.2700 11.1500 9.7700 8.8800 8.2100 7.0500 15.4600 26.0000 36.9000 49.4000 58.1000 Listing 1. Listing 2. The MATLAB script file, FitLinSR.m, does not require any modification before it can be used. All that is required is that FitLinSR.m is stored somewhere in the MATLAB search path. If it is, then simply typing FitLinSR at the MATLAB command prompt will execute the script, producing the output shown In Listing 3. From this you can see that the correlation coefficient, r 2, is equal to 0.9994 and the parameters have the following values and 95% confidence limits: θ1 = 2.88 ± 0.99, θ2 = 5.04 ± 0.51, θ3 = -1.12 ± 0.64 and θ4 = 9.29 ± 15.0. The order that the parameters and uncertainties are listed is the same as the order of the columns in the matrix x that was created earlier. In addition to this output, MATLAB also creates and displays four plots (they may be positioned one on top of the other, requiring you to drag them to new positions in order to see all of them). One is a parity plot and the other three are residuals plots in which the residuals are plotted separately against each of the set variables. AFCoKaRE, Example S3.1 2

>> FitLinSR r_squared = 9.9942e-01 m = 2.8836e+00 5.0418e+00-1.1181e+00 m_u = 9.9147e-01 5.0940e-01 6.4459e-01 b = 9.2882e+00 b_u = Listing 3. AFCoKaRE, Example S3.1 3

Figure 1. Parity plot for the fit of a linear model to the data in Table 1. The correlation coefficient is nearly equal to 1.0, so the fit appears to be very good, but we still should examine the parity plot, Figure 1, and the residuals plots, Figures 2, 3 and 4. As expected given the good correlation coefficient, the parity plot shows all of the data points to be very close to the diagonal line. Occasionally a parity plot will show systematic deviations (this one does not), but often it will not, even if there are systematic trends in the errors with respect to one of the set variables. For this reason, the residuals plots should always be checked even if the parity plot and correlation coefficient indicate a good fit. In this case, the residuals plots on the following pages show random scatter of the residuals with respect to each of the set variables. On first impression, the magnitude of the scatter in the residuals plots looks very large, but that is only because the vertical scale being used is very small. The scatter seen in these figures is the same as the scatter seen in Figure 1. The important feature of the residuals plots is that they do not indicate any systematic trend in the residuals as a function of any of the set variables. Overall, the correlation coefficient, parity plot and residuals plots all indicate that the linear model offers a very good representation of the experimental data. Therefore the model is acceptable with the parameter values and uncertainties given earlier. AFCoKaRE, Example S3.1 4

Figure 2. Residuals plotted against set variable x1. Figure 3. Residuals plotted against set variable x2. AFCoKaRE, Example S3.1 5

Figure 4. Residuals plotted against set variable x3. AFCoKaRE, Example S3.1 6