Classroom Tips and Techniques: Nonlinear Curve Fitting. Robert J. Lopez Emeritus Professor of Mathematics and Maple Fellow Maplesoft

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

Classroom Tips and Techniques: Branch Cuts for a Product of Two Square-Roots

Integration by Parts in Maple

Classroom Tips and Techniques: Maple Meets Marden's Theorem. Robert J. Lopez Emeritus Professor of Mathematics and Maple Fellow Maplesoft

Introduction. Classroom Tips and Techniques: The Lagrange Multiplier Method

Classroom Tips and Techniques: Drawing a Normal and Tangent Plane on a Surface

Classroom Tips and Techniques: Stepwise Solutions in Maple - Part 2 - Linear Algebra

Visualizing Regions of Integration in 2-D Cartesian Coordinates

Classroom Tips and Techniques: Solving Algebraic Equations by the Dragilev Method

Classroom Tips and Techniques: The Lagrange Multiplier Method

Classroom Tips and Techniques: Plotting Curves Defined Parametrically

Classroom Tips and Techniques: Least-Squares Fits. Robert J. Lopez Emeritus Professor of Mathematics and Maple Fellow Maplesoft

Classroom Tips and Techniques: Notational Devices for ODEs

Maple Quick Start. Maplesoft, a division of Waterloo Maple Inc.

A Maple Package for Solving and Displaying

Polymath 6. Overview

MapleSim User's Guide

Maple User Manual Copyright Maplesoft, a division of Waterloo Maple Inc

Maple Quick Start. Introduction. Talking to Maple

Quantifying Motion in Three Dimensions with ProAnalyst

ArcView QuickStart Guide. Contents. The ArcView Screen. Elements of an ArcView Project. Creating an ArcView Project. Adding Themes to Views

Set 5, Total points: 100 Issued: week of

2.2 Graphs Of Functions. Copyright Cengage Learning. All rights reserved.

Deductive reasoning can be used to establish area formulas.

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010

Functions. Copyright Cengage Learning. All rights reserved.

Choose the file menu, and select Open. Input to be typed at the Maple prompt. Output from Maple. An important tip.

Working with Analytical Objects. Version: 16.0

Using LoggerPro. Nothing is more terrible than to see ignorance in action. J. W. Goethe ( )

CURVES OF CONSTANT WIDTH AND THEIR SHADOWS. Have you ever wondered why a manhole cover is in the shape of a circle? This

WHICH GRAPH REPRESENTS THE FOLLOWING PIECEWISE DEFINED FUNCTION FILE

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

Computational Physics PHYS 420

Voluntary State Curriculum Algebra II

To Plot a Graph in Origin. Example: Number of Counts from a Geiger- Müller Tube as a Function of Supply Voltage

Dealing with Data in Excel 2013/2016

USING TEMATH S VISUALIZATION TOOLS IN CALCULUS 1

High School Geometry. Correlation of the ALEKS course High School Geometry to the ACT College Readiness Standards for Mathematics

Geography. Getting Started Guide

Chapter 12: Quadratic and Cubic Graphs

Advanced Curve Fitting. Eric Haller, Secondary Occasional Teacher, Peel District School Board

Graded Assignment 2 Maple plots

Getting Started with the MapleSim FMI Connector

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

Scott Foresman Investigations in Number, Data, and Space Content Scope & Sequence Correlated to Academic Language Notebooks The Language of Math

CS 450 Numerical Analysis. Chapter 7: Interpolation

Using Excel for Graphical Analysis of Data

Welcome to Microsoft Excel 2013 p. 1 Customizing the QAT p. 5 Customizing the Ribbon Control p. 6 The Worksheet p. 6 Excel 2013 Specifications and

Interpolation & Polynomial Approximation. Cubic Spline Interpolation II

QuintusVisuals 1.2 for TIBCO Spotfire User's Manual

Combining a Bar Graph with a Line Graph 1

Proof of Constant Width of Spheroform with Tetrahedral Symmetry

Four equations are necessary to evaluate these coefficients. Eqn

A Simple First-Model Using the Berkeley-Madonna Program

Introduction to Applied and Pre-calculus Mathematics (2008) Correlation Chart - Grade 10 Introduction to Applied and Pre-Calculus Mathematics 2009

User s Guide Version 4

Concept of Curve Fitting Difference with Interpolation

Unit 1 Day 4 Notes Piecewise Functions

WHAT YOU SHOULD LEARN

Iwrite this realizing it is my final Technology

Graphs of Equations. MATH 160, Precalculus. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Graphs of Equations

Friday, 11 January 13. Interpolation

Mathematica CalcCenter

Science. Getting Started Guide

Pure Math 30: Explained!

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips

Unit Map: Grade 3 Math

An introduction to interpolation and splines

PHYC 500: Introduction to LabView. Exercise 1 (v 1.3) M.P. Hasselbeck, University of New Mexico

Mathematics - LV 5 (with QuickTables)

Trading View Chart Setup

Using Excel for Graphical Analysis of Data

Getting Started with Amicus Document Assembly

Math 370 Exam 1 Review Name. Use the vertical line test to determine whether or not the graph is a graph in which y is a function of x.

Middle School Math Course 3

NURBS: Non-Uniform Rational B-Splines AUI Course Denbigh Starkey

STEPHEN WOLFRAM MATHEMATICADO. Fourth Edition WOLFRAM MEDIA CAMBRIDGE UNIVERSITY PRESS

Surface Modeling With TINs

Introduction to Matlab

Flank Millable Surface Design with Conical and Barrel Tools

Data Resource Centre, University of Guelph CREATING AND EDITING CHARTS. From the menus choose: Graphs Chart Builder... 20/11/ :06:00 PM Page 1

Chapter 3: Rate Laws Excel Tutorial on Fitting logarithmic data

6th Grade Math. Parent Handbook

Basics: How to Calculate Standard Deviation in Excel

Hyperbola for Curvilinear Interpolation

ORDINARY DIFFERENTIAL EQUATIONS

DataSweet also has a whole host of improvements which are not covered in this document.

A Simple First-Model Using the Berkeley-Madonna Program

Multivariate Calibration Quick Guide

Handout 4 - Interpolation Examples

1. Open up PRO-DESKTOP from your programmes menu. Then click on the file menu > new> design.

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

Minnesota Academic Standards for Mathematics 2007

MetaTrader 4 for Android. User Manual

Honors Precalculus: Solving equations and inequalities graphically and algebraically. Page 1

Sixth Grade SOL Tracker Name:

Find three ordered pair solutions calculator

Cecil Jones Academy Mathematics Fundamentals

UNIT 1: NUMBER LINES, INTERVALS, AND SETS

In this first example, we build a question that asks for the derivative of sec(x) and uses Maple to grade the response.

Transcription:

Classroom Tips and Techniques: Nonlinear Curve Fitting Robert J. Lopez Emeritus Professor of Mathematics and Maple Fellow Maplesoft Introduction I was recently asked for help in fitting a nonlinear curve to data, and then drawing related graphs of the data and the fitting curve. This month's article summarizes all the advice about nonlinear least squares I generated in response to the user's questions. Initializations Problem Statement Table 1 contains, with simplified notation, the data and fitting function presented to me. The data points, were presented in the form of two vectors X and Y, and the fitting function was given as, with and as two parameters to be found. The fitting function is indeed nonlinear in these parameters.,, Table 1 The data for the nonlinear least squares fit

Graph of the Data Points Table 2 shows how the data can be entered in a syntax-free manner. Control-drag from Table 1 Context Menu: Assign Name Control-drag from Table 1 Context Menu: Assign Name Control-drag from Table 1 Context Menu: Assign Function Table 2 Syntax-free data-entry Figure 1, a graph of the points and their piecewise linear interpolant, can be obtained with the Curve Fitting Assistant, as per the steps articulated in Table 3. Enter the sequence and press the Enter key. Context Menu: Curve Fitting Interactive Curve Fitting In the Splines section, select degree-1 and press Plot On "Done" return Plot Press Done

Table 3 Use of the Curve Fitting Assistant to graph data points and their piecewise linear interpolant The points in Figure 1 were rendered as solid dots by using the Context Menu for the graph (click on one of the points) and selecting Symbol Circle (Solid). Figure 1 Data points and piecewise linear interpolant

If the Curve Fitting Assistant is not used, the graph in Figure 1 would have to be constructed by overlaying the separate graphs of the points and the interpolant. Least Squares The Fit command in the Statistics package decides if a linear or nonlinear algorithm is called. The fitting function is obtained with where the numeric value of the option "iterationlimit" was found by trial-and-error. Additional information about the fitting function and its calculation can be obtained by generating the module and interrogating it with

The module content is a sequence we have displayed elementwise by use of the for-loop. The values of the parameters, the minimum value of the sum of squares of deviations, and the individual residuals are amongst the items recovered from the calculation. In particular, the values of the parameters and can be accessed via That the product in the numerator of the fitting function is can be verified by the following evaluation. In Figure 2, we have graphed the least-squares fitting function, and added to it the graph of the data and their piecewise linear interpolant from Figure 1. The graph of the least-squares function is obtained with the Plot Builder, launched from the Context Menu. The graph in Figure 1 is added by simply copying and pasting. Of course, the alternative would be creating two separate plots and joining them with the display command in the plots package. Figure 2 The least-squares fitting function, the data points, and their piecewise linear interpolant.

First Principles The nonlinear fit can also be obtained by forming and minimizing the sum of squares of deviations differentiating to obtain the normal equations and solving numerically to obtain The value of at this solution is in agreement with the value found earlier. Alternatively, can be minimized with the Optimization assistant, as per Figure 3.

Figure 3 Minimization of sum of squares by the Optimization Assistant The Edit button is used to insert the Objective Function, and this can be referenced by its name,. On the left, select as solver the nonlinear simplex method. Setting the number of function evaluations to 200 will allow the Solve button to find the minimum. Functions of the Optimal Parameters After having provided this nonlinear least-squares solution, I was further asked how another function could make use of the optimal parameters in an expression such as The simplest way to form the desired function is shown in Table 4. The alternative would involve use of the unapply command.

Using the evaluation template from the Expression palette, form the equation Context Menu: Assign Function Table 4 Forming a function containing the optimal parameters Proof that the desired function has been generated is given by To evaluate this function at the nodes, we could use the new syntax for elementwise operations, as in Alternatively, in the Context Menu for, select "Map Command Onto," and in the pop-up, provide the name. Figure 4, a graph of and the points can be constructed from separate plots of the points and of (using the display command from the plots package), or it can be constructed interactively via the Context Menu.

Figure 4 Graph of and the points The interactive construction of Figure 4 begins with juxtaposing the two vectors and selecting Plots Plot Builder from the Context Menu. The domain for a plot of the six points is. The expression for can be dropped onto the graph of the points, with the Context Menu for the resulting composite graph used to re-adjust the plot window. Select Axes Properties, and in the dialog that appears, uncheck "Use Data Extents" so appropriate Range values can be inserted. Legal Notice: Maplesoft, a division of Waterloo Maple Inc. 2009. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.