Both the polynomial must meet and give same value at t=4 and should look like this

Similar documents
Both the polynomial must meet and give same value at t=4 and should look like this

For the final value of T=800 K, the integration time span will vary from

Non-linear regression tutorial

Step 2: After opening the file, you should see following window. Select all the code, right click and then copy the code

Chapter 3: Rate Laws Excel Tutorial on Fitting logarithmic data

Polymath 6. Overview

Introduction to CS graphs and plots in Excel Jacek Wiślicki, Laurent Babout,

Data Table from an Equation

MICROSOFT EXCEL TUTORIAL

Following a tour is the easiest way to learn Prism.

Microsoft Word for Report-Writing (2016 Version)

Chemistry 30 Tips for Creating Graphs using Microsoft Excel

x, with a range of 1-50 (You can use the randbetween command on excel)

Pre-Lab Excel Problem

Chemistry 1A Graphing Tutorial CSUS Department of Chemistry

Graphing on Excel. Open Excel (2013). The first screen you will see looks like this (it varies slightly, depending on the version):

lab MS Excel 2010 active cell

1 Introduction to Excel Databases April 09

4) Study the section of a worksheet in the image below. What is the cell address of the cell containing the word "Qtr3"?

POLYMATH Example for the Numerical Solution of ODEs

Unsteady-State Diffusion in a Slab by Robert P. Hesketh 3 October 2006

Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts. Microsoft Excel 2013 Enhanced

Open Excel by following the directions listed below: Click on Start, select Programs, and the click on Microsoft Excel.

Which of the following toolbar buttons would you use to find the sum of a group of selected cells?

BioFuel Graphing instructions using Microsoft Excel 2003 (Microsoft Excel 2007 instructions start on page mei-7)

Combining a Bar Graph with a Line Graph 1

EXCEL 2003 DISCLAIMER:

Finding the axis of symmetry, vertex, and roots of a parabola

Microsoft Excel Tutorial

Creating an Excel resource

Data Should Not be a Four Letter Word Microsoft Excel QUICK TOUR

Working with Data in Microsoft Excel 2010

ECE 304: Using EXCEL Preliminaries...3 Construction of Spreadsheet...3 Figure 1:...3 FORMAT CELLS menu with selected font settings...

Microsoft Word 2011 Tutorial

Frequency tables Create a new Frequency Table

Appendix A. HINTS WHEN USING EXCEL w

PowerSchool Handbook Federal Survey Card Report

NUMERICAL COMPUTING For Finance Using Excel. Sorting and Displaying Data

Microsoft Excel 2010 Tutorial

Microsoft Excel Using Excel in the Science Classroom

Math 227 EXCEL / MEGASTAT Guide

Metrics Tutorial. Table of Contents. 1. Introduction

SPREADSHEET (Excel 2007)

Math 2524: Activity 1 (Using Excel) Fall 2002

Physics 211 E&M and Modern Physics Spring Lab #1 (to be done at home) Plotting with Excel. Good laboratory practices

Candy is Dandy Project (Project #12)

PowerSchool Handbook Federal Survey Form Report

Chapter 5 Accumulating Change: Limits of Sums and the Definite Integral

Steady Flow: Lid-Driven Cavity Flow

Microsoft Excel 2007 Creating a XY Scatter Chart

WEEK NO. 12 MICROSOFT EXCEL 2007

Using Graphical Analysis This exercise will familiarize you with using Graphical Analysis in Beer s Law and kinetics.

Microsoft Excel 2007

Intermediate Microsoft Excel 2010

Microsoft Excel 2007 Beginning The information below is devoted to Microsoft Excel and the basics of the program.

Optimization in One Variable Using Solver

GOOGLE SHEETS TUTORIAL

W7 DATA ANALYSIS 2. Your graph should look something like that in Figure W7-2. It shows the expected bell shape of the Gaussian distribution.

plus ltd Reports- PIVOT Essentials # Quick Instructions- (ie Click On [CO]) Notes / screenshots Runs your PM data into Excel

0 Graphical Analysis Use of Excel

Beginner s Guide to Microsoft Excel 2002

Unit 2 Fine-tuning Spreadsheets, Functions (AutoSum)

Working with Excel CHAPTER 1

Export Desktop Motion Analyzer profiles to Motion Analyzer Online: SolidWorks Motion Study Move Profile

Working with Excel involves two basic tasks: building a spreadsheet and then manipulating the

Skills Exam Objective Objective Number

1.1 Opening/Closing the file The first step to using Excel is launching the program and knowing how to close it when you re finished.

Making Excel Work for Your Tribal Community

Spreadsheet View and Basic Statistics Concepts

7. Apply a Range of Table Features

IHS Enerdeq Desktop International Training Guide

Unit 2 Fine-tuning Spreadsheets, Functions (AutoSum)

KINETICS CALCS AND GRAPHS INSTRUCTIONS

Chapter 4. Microsoft Excel

Statistics and Graphics Functions

VCell Tutorial. FRAP with binding

Introduction to the workbook and spreadsheet

File Management Tutorial

For more info and downloads go to: Gerrit Stols

Scottish Improvement Skills

Using Spreadsheets, Selection Sets, and COGO Controls SPECTRA PRECISION SURVEY OFFICE TUTORIAL

If you finish the work for the day go to QUIA and review any objective you feel you need help with.

New Perspectives on Microsoft Excel Module 5: Working with Excel Tables, PivotTables, and PivotCharts

User Manual Mail Merge

Reference Services Division Presents. Excel Introductory Course

How to use Excel Spreadsheets for Graphing

Microsoft Office Word 2013 Intermediate. Course 01 Working with Tables and Charts

STAT 311 (3 CREDITS) VARIANCE AND REGRESSION ANALYSIS ELECTIVE: ALL STUDENTS. CONTENT Introduction to Computer application of variance and regression

A cell is highlighted when a thick black border appears around it. Use TAB to move to the next cell to the LEFT. Use SHIFT-TAB to move to the RIGHT.

Classroom Tips and Techniques: Interactive Plotting of Points on a Curve

Excel Tables & PivotTables

2. create the workbook file

9 Tables Part I. Session 45: Creating Tables Session 46: Modifying the Layout of Tables Session 47: Formatting the Design of Tables. Unit.

HOW TO USE THE EXPORT FEATURE IN LCL

Module 4 : Spreadsheets

1. Select a cell in the column you want to sort by. In this example, we will sort by Last Name.

Exercise 4a: Creating and Editing XY Plots

ICT & MATHS. Excel 2003 in Mathematics Teaching

Opening a Document: Printer Selection:

The Dreamweaver Interface

Transcription:

Polymath Regression tutorial on Polynomial fitting of data The following table shows the raw data for experimental tracer concentration from a reactor which you need to fit using Polymath (refer Example 16-1, Table E16-1.1, Elements of chemical reaction engineering, 5 th edition) Time (t) 0 0.5 1 2 3 4 5 6 7 8 9 10 12 14 C_tracer (C) 0 0.6 1.4 5 8 10 8 6 4 3 2.2 1.6 0.6 0 The polynomial fit is of the form: C(t) = ao + a1t + a2t 2 + a3t 3 + a4t 4 + ant n The given C(t) data is first increasing and then decreasing with time. So, we will use two polynomials to fit the C-curve, one for the ascending portion, C1(t), and another for the descending portion, C2(t). We will split our data into two parts, an increasing and a decreasing part, and regress both the data sets separately. Split the data at its maximum, and that happens at t = 4, when C(t) is 10. Our data now looks like this: T1 0 0.5 1 2 3 4 C1 0 0.6 1.4 5 8 10 and T2 4 5 6 7 8 9 10 12 14 C2 10 8 6 4 3 2.2 1.6 0.6 0 Both the polynomial must meet and give same value at t=4 and should look like this Match C(t) C1(t) C2(t) t=4 time We will first regress the first portion of C(t) curve and then regress the second portion

Step 1: First, launch Polymath which you can download from http://www.polymathsoftware.com You will see a window that looks like this. Step 2: To regress the data in Polymath, first click on the Program tab present on the toolbar. This will bring up a list of options from which you need to select. In this case we want to perform polynomial fitting, so select "REG Regression". The shortcut button for Regression solver is also present on the menu bar ( ) as shown by red circle in below screenshot

The following window will appear Step 3: Before inserting the data into the spreadsheet, it is recommended to change the column name with the name of the variable mentioned in the data table. This would make it easy to comprehend the polymath output. To change the column name of C01, double click on the column name C01 or right click on C01 and select Column Name A dialog box will appear where column name can be changed Change the column name from C01 to T1 and press OK. You will find that column name is changed to T1

Similarly, rename C02 to C1 as shown below. By default Polymath select Regression method as Linear and Polynomial. If it is not so, then, click on the Regression tab on the right side of the window, and select the "Nonlinear" regression tab under the "Report" and "Store Model" check boxes (shown by red rectangle) The window should look like this:

Step 4: To input the data for T1, select the first cell (row 01, column time) and enter the first data as shown below: Similarly, enter the remaining data of T1 in subsequent rows. Repeat this procedure to input the data for C1. After entering the data, the spreadsheet would look like this

Step 5: Clicking the refresh button (shown below by red circle) on the left of the green excel sign updates the file. Now, you will find that Dependent variable, Independent variable and Polynomial degree is updated (shown by blue rectangle). By default, Polymath select the first column as independent variable, second column as dependent variable, and Polynomial degree as 1 Linear. The window should look like this: Step 6: You can also change the dependent variable, independent variable by selecting from the drop down menu next to variable name. In this case we want to change the polynomial degree only. Let s try to fit the data by Polynomial degree 3. Select the Polynomial degree as 3 as shown below

Step 7: Now select what you want polymath to output by checking the boxes on the right side of the window. The options are Graph, Residuals, Report, and Store Model. Click on the pink arrow to have Polymath perform the regression. If you selected "Report" you will see a screen that details the results from the regression analysis. The report includes the model, the values of the model parameters, the statistical confidence of the parameters, and several other statistics. The above report shows that 3 degree polynomial fits well to the 1 st set of data as is evident from R^2 =0.999 If you checked the graph option, a new window will appear like this. The graph shows the model that we fit to the data.

Step 8: To enter the second set of data in the spreadsheet, change C03 to T2 and C04 to C2, enter the data in corresponding column and then you need to select the dependent and independent variable as C2 and T2 from the drop down menu (shown by red circle in the screenshot). Select the polynomial degree as 3 as was done earlier. Your window will appear like this

Run the model by clicking the pink arrow and generate the report. The report shows R^2 value to be 0.998 which is a good fit To improve the accuracy of the fitting of the second data set, we can use higher order polynomial. Let s regress using a 5th Order polynomial, which is the maximum polynomial degree one can use in Polymath under Linear and Polynomial Tab

Step 9: Go back to the main window and change the polynomial degree to 5 and run the program to generate the report From the above report you can see that R^2 has improved to 0.999 from 0.998. So, 5 th order polynomial fits better for the decreasing portion of the C(t) curve.

If you checked the graph option, your graph will appear like this Thus, by splitting data in to two parts, you can obtain a fit with R^2=0.999 The polynomial equation is given by For 1 st data set,t 4 min, C1(t)= 0.0039 + 0.274t + 1.57t 2 0.255t 3 For 2 nd data set, t 4 min and t 14 min, C2(t)= 13.669 + 20.808t 6.156t 2 + 0.771t 3 0.0446t 4 + 0.00098t 5 The complete equation for C(t) curve can be written as C(t) = If(t 4 and t 0)then C1 else if (t 4 and t 14)then C2 else 0

Step 10: Now you have obtained equation for both increasing and decreasing part of C(t) curve. Let s combine both part and obtain a complete and continuos graph. We will do this using Polymath DEQ solver. We will fool Polymath by defining a dummy dependent variable (A) varying with t and then enter the C1(t), C2(t) and C(t) equation to get the desired curve So, With A(0) = 0 da dt = 1 C1 = 0.0038746+0.2739782*t+1.574621*t^2-0.2550041*t^3 C2 = -13.66907+20.80834*t-6.156193*t^2+0.7712896*t^3-0.0446773*t^4+0.0009834*t^5 C = If (t<=4 and t>=0) then C1 else if (t>=4 and t<=14) then C2 else 0 t(0) = 0 t(f) = 14 Click on Program tab and select DEQ Differential Equations

This will open up a blank window as shown below Step 11: Enter the differential equation and explicit equation in the window. For more details on how to enter equations and initial values, refer to Polymath ODE tutorial at http://umich.edu/~elements/5e/software/polymath.html After you have entered all your equations, check the box corresponding to Graph option and uncheck the box corresponding to Report (as we want only graph). Click on the pink arrow to run Polymath program.

You will obtain the following graph Step 12: To select the variable you want to plot, double click on the graph or click on graph button present on left panel (shown below). This will open up a dialogue box. You can select independent variable from drop- down menu and dependent variable by checking/unchecking the boxes next to the variables. So uncheck the box for A and check the box for C. After you are done, hit Close button

Step 13: To edit graph properties right click on graph and select Format or click on brush button present on the left panel. This will open up a dialogue box with different tabs such as Curves, Titles, Fonts, axis format, margin etc. In this tutorial we will edit some of the graph properties. In the Titles tab, enter the graph title as C(t) curve In the X,Y axis tab select 0 for X axis and 0.0 for Y axis using drop down menu In the Scale and Margins tab, put 0 as min value of Y axis. Apply the changes and close thr dialogue box. You will obtain the following graph