10/11/2015 1 Nonlinear Regression Chemical Engineering Majors Authors: Autar Kaw, Luke Snyder

Slides:



Advertisements
Similar presentations
Newton’s Divided Difference Polynomial Method of Interpolation
Advertisements

1 Direct Method of Interpolation Electrical Engineering Majors Authors: Autar Kaw, Jai Paul
Differentiation-Discrete Functions
5/19/ Runge 4 th Order Method Mechanical Engineering Majors Authors: Autar Kaw, Charlie Barker
7/2/ Differentiation-Discrete Functions Industrial Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
8/8/ Euler Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
8/8/ Linear Regression Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder
8/8/ Gauss Quadrature Rule of Integration Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
8/15/ Differentiation-Discrete Functions Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
8/18/ Nonlinear Regression Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder
9/14/ Trapezoidal Rule of Integration Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
1 Spline Interpolation Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul
9/22/ Runge 2 nd Order Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
10/11/ Differentiation-Discrete Functions Chemical Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
REGRESI 1. 2 Regresi adalah Diberikan sejumlah n buah data Yg dimodelkan oleh persamaan Model yg paling baik (best fit) secara umum adalah model yg meminimalkan.
1 Lagrangian Interpolation Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
1 Newton’s Divided Difference Polynomial Method of Interpolation Chemical Engineering Majors Authors: Autar Kaw, Jai.
Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data 1.
1 Newton’s Divided Difference Polynomial Method of Interpolation Major: All Engineering Majors Authors: Autar Kaw,
5/30/ Runge 4 th Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
11/16/ Euler Method Electrical Engineering Majors Authors: Autar Kaw, Charlie Barker
11/17/ Shooting Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
12/1/ Trapezoidal Rule of Integration Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
1 Lagrangian Interpolation Computer Engineering Majors Authors: Autar Kaw, Jai Paul
1 Direct Method of Interpolation Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
12/17/ Linear Regression Dr. A. Emamzadeh. 2 What is Regression? What is regression? Given n data points best fitto the data. The best fit is generally.
1/16/ Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
1/19/ Runge 4 th Order Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
1 Direct Method of Interpolation Computer Engineering Majors Authors: Autar Kaw, Jai Paul
2/12/ Linear Regression Electrical Engineering Majors Authors: Autar Kaw, Luke Snyder
1 Direct Method of Interpolation Mechanical Engineering Majors Authors: Autar Kaw, Jai Paul
2/28/ Runge 4 th Order Method Computer Engineering Majors Authors: Autar Kaw, Charlie Barker
1 Newton’s Divided Difference Polynomial Method of Interpolation Mechanical Engineering Majors Authors: Autar Kaw,
1 Spline Interpolation Method Mechanical Engineering Majors Authors: Autar Kaw, Jai Paul
6/13/ Linear Regression Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker Presented by: دکتر ابوالفضل.
6/13/ Linear Regression Civil Engineering Majors Authors: Autar Kaw, Luke Snyder
Trapezoidal Rule of Integration
Gauss Quadrature Rule of Integration
Computer Engineering Majors Authors: Autar Kaw, Charlie Barker
Differentiation-Discrete Functions
Differentiation-Discrete Functions
Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder
Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder
Direct Method of Interpolation
Spline Interpolation Method
Lagrangian Interpolation
Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
Newton’s Divided Difference Polynomial Method of Interpolation
Trapezoidal Rule of Integration
Trapezoidal Rule of Integration
Spline Interpolation Method
Computer Engineering Majors Authors: Autar Kaw, Luke Snyder
Lagrangian Interpolation
Lagrangian Interpolation
REGRESI.
Gauss Quadrature Rule of Integration
Industrial Engineering Majors Authors: Autar Kaw, Charlie Barker
Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder
Direct Method of Interpolation
Major: All Engineering Majors Authors: Autar Kaw, Luke Snyder
Industrial Engineering Majors Authors: Autar Kaw, Luke Snyder
Lagrangian Interpolation
Mechanical Engineering Majors Authors: Autar Kaw, Luke Snyder
Electrical Engineering Majors Authors: Autar Kaw, Charlie Barker
Spline Interpolation Method
Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Differentiation-Discrete Functions
Chemical Engineering Majors Authors: Autar Kaw, Luke Snyder
Newton’s Divided Difference Polynomial Method of Interpolation
Lagrangian Interpolation
Presentation transcript:

10/11/ Nonlinear Regression Chemical Engineering Majors Authors: Autar Kaw, Luke Snyder Transforming Numerical Methods Education for STEM Undergraduates

Nonlinear Regression

Nonlinear Regression Some popular nonlinear regression models: 1. Exponential model: 2. Power model: 3. Saturation growth model: 4. Polynomial model:

Nonlinear Regression Given n data pointsbest fit to the data, whereis a nonlinear function of. Figure. Nonlinear regression model for discrete y vs. x data

Regression Exponential Model

Exponential Model Givenbest fitto the data. Figure. Exponential model of nonlinear regression for y vs. x data

Finding constants of Exponential Model The sum of the square of the residuals is defined as Differentiate with respect to a and b

Finding constants of Exponential Model Rewriting the equations, we obtain

Finding constants of Exponential Model Substitutingback into the previous equation The constantcan be found through numerical methods such as the bisection method or secant method. Nonlinear equation in terms of Solving the first equation foryields

Example 1-Exponential Model t(hrs) Many patients get concerned when a test involves injection of a radioactive material. For example for scanning a gallbladder, a few drops of Technetium-99m isotope is used. Half of the techritium-99m would be gone in about 6 hours. It, however, takes about 24 hours for the radiation levels to reach what we are exposed to in day-to-day activities. Below is given the relative intensity of radiation as a function of time. Table. Relative intensity of radiation as a function of time.

Example 1-Exponential Model cont. Find: a) The value of the regression constantsand b) The half-life of Technium-99m c) Radiation intensity after 24 hours The relative intensity is related to time by the equation

Plot of data

Constants of the Model The value of λ is found by solving the nonlinear equation

Setting up the Equation in MATLAB t (hrs) γ

Setting up the Equation in MATLAB t=[ ] gamma=[ ] syms lamda sum1=sum(gamma.*t.*exp(lamda*t)); sum2=sum(gamma.*exp(lamda*t)); sum3=sum(exp(2*lamda*t)); sum4=sum(t.*exp(2*lamda*t)); f=sum1-sum2/sum3*sum4;

Calculating the Other Constant The value of A can now be calculated The exponential regression model then is

Plot of data and regression curve

Relative Intensity After 24 hrs The relative intensity of radiation after 24 hours This result implies that only radioactive intensity is left after 24 hours.

Homework 1. What is the half-life of technetium 99m isotope? 2. Compare the constants of this regression model with the one where the data is transformed. 3. Write a program in the language of your choice to find the constants of the model.

THE END

Polynomial Model Givenbest fit to a given data set. Figure. Polynomial model for nonlinear regression of y vs. x data

Polynomial Model cont. The residual at each data point is given by The sum of the square of the residuals then is

Polynomial Model cont. To find the constants of the polynomial model, we set the derivatives with respect to whereequal to zero.

Polynomial Model cont. These equations in matrix form are given by The above equations are then solved for

25 Example 2-Polynomial Model Below is given the FT-IR (Fourier Transform Infra Red) data of a 1:1 (by weight) mixture of ethylene carbonate (EC) and dimethyl carbonate (DMC). Absorbance P is given as a function of wavenumber m. Wavenumber, m ( ) Absorbance, P (arbitrary unit) Table. Absorbance vs Wavenumber data Figure. Absorbance vs. Wavenumber data

26 Example 2-Polynomial Model cont. Regress the data to a second order polynomial where and find the absorbance at The coefficientsare found as follows

27 Example 2-Polynomial Model cont. The necessary summations are as follows i Wavenumber, m ( ) Absorbance, P (arbitrary unit) m2m2 m3m × × × × × × × × × × × × × × × ×10 9 Table. Necessary summations for calculation of polynomial model constants

28 Example 2-Polynomial Model cont. Necessary summations continued: i m4m4 m × P m 2 × P × × × × × × × × × × × × × × × ×10 5 Table. Necessary summations for calculation of polynomial model constants.

29 Example 2-Polynomial Model cont. Using these summations we have Solving this system of equations we find The regression model is then

30 Example 2-Polynomial Model cont. With the model is given by Figure. Polynomial model of Absorbance vs. Wavenumber.

31 Example 2-Polynomial Model cont. To findwherewe have

Linearization of Data To find the constants of many nonlinear models, it results in solving simultaneous nonlinear equations. For mathematical convenience, some of the data for such models can be linearized. For example, the data for an exponential model can be linearized. As shown in the previous example, many chemical and physical processes are governed by the equation, Taking the natural log of both sides yields, Letand (implying)with We now have a linear regression model where

Linearization of data cont. Using linear model regression methods, Onceare found, the original constants of the model are found as

Example 3-Linearization of data t(hrs) Many patients get concerned when a test involves injection of a radioactive material. For example for scanning a gallbladder, a few drops of Technetium- 99m isotope is used. Half of the technetium-99m would be gone in about 6 hours. It, however, takes about 24 hours for the radiation levels to reach what we are exposed to in day-to-day activities. Below is given the relative intensity of radiation as a function of time. Table. Relative intensity of radiation as a function of time Figure. Data points of relative radiation intensity vs. time

Example 3-Linearization of data cont. Find: a) The value of the regression constantsand b) The half-life of Technium-99m c) Radiation intensity after 24 hours The relative intensity is related to time by the equation

Example 3-Linearization of data cont. Exponential model given as, Assuming,andwe obtain This is a linear relationship betweenand

Example 3-Linearization of data cont. Using this linear relationship, we can calculate and where

Example 3-Linearization of Data cont − − − − − − − − − − −2.8778− Summations for data linearization are as follows Table. Summation data for linearization of data model With

Example 3-Linearization of Data cont. Calculating Since also

Example 3-Linearization of Data cont. Resulting model is Figure. Relative intensity of radiation as a function of temperature using linearization of data model.

Example 3-Linearization of Data cont. The regression formula is then b) Half life of Technetium 99 is when

Example 3-Linearization of Data cont. c) The relative intensity of radiation after 24 hours is then This implies that onlyof the radioactive material is left after 24 hours.

Comparison Comparison of exponential model with and without data linearization: With data linearization (Example 3) Without data linearization (Example 1) A λ− − Half-Life (hrs) Relative intensity after 24 hrs ×10 − ×10 −2 Table. Comparison for exponential model with and without data linearization. The values are very similar so data linearization was suitable to find the constants of the nonlinear exponential model in this case.

Additional Resources For all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit egression.html

THE END