Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Problem Set 3 - Applied Calculus - Fall 2008 | MATH 115, Study notes of Calculus

Material Type: Notes; Professor: Seaton; Class: APPLIED CALCULUS; Subject: Mathematics; University: Rhodes College; Term: Fall 2008;

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-3ay
koofers-user-3ay 🇺🇸

10 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Applied Calculus
Fall 2008
Module 3: Curve Fitting
Problem 1: Root Growth, a One Parameter Linear
Model
Problem 2: Development Test Results, Two
Parameter Linear Model
Problem 3: Concentration of Chemical, Two
Parameter Non-linear Model
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Problem Set 3 - Applied Calculus - Fall 2008 | MATH 115 and more Study notes Calculus in PDF only on Docsity!

Applied Calculus

Fall 2008

Module 3: Curve Fitting

Problem 1: Root Growth, a One Parameter Linear

Model

Problem 2: Development Test Results, Two

Parameter Linear Model

Problem 3: Concentration of Chemical, Two

Parameter Non-linear Model

Introduction

In Module 1 we dealt with situation where a model could be fitted exactly to the data. It is always possible to find a model that fits the data exactly. This is not, however, the most appropiate way of modeling the data, especially if want to use the model to make predictions about future events. It is also inefficient, since there are as many parameters to calculate as there are data points. An efficient model is one with the fewest parameters that still manages to describe the behaviour of the data. The disadvantage of using a model with fewer parameters than data points is that it will not pass through all the data points, and so we find the model that is the ‘best fit’ for the data. The first problem shows you have to fit the ‘best’ model of the form y = mx to the data. Within this problem we look at various ways of selecting the ‘best’ model. In the second problem we fit the ‘best’ model of the form y = mx + b. In the final problem, and in the projects that your group will be assigned, you will first fit find and exact fit model, then a two parameter non-linear model and finally fit a model with more than two parameters. We will then compare the properties of these models. In the process of completing these problems, we will see how to find minimum and maximum values of functions, and see how to find derivatives of functions in several variables.

1 Problem 1

1.1 Statement of the Problem

A biologist is studying how fast the root of a particular specises of plant grows. The results of one experiment are below. The biologist believes that the ‘law’ of root growth is Growth = m × Days,

and has asked us to determine the value of m from the experimental data.

Day Growth (mm) 0 0 1 1. 2 3. 3 4. 4 6. 5 7. 6 7.

Instructions

  1. Plot these points on the graph paper provided.
  2. Draw a straight line that goes through the origin, and is as close to the other points as possible.
  3. Calculate the slope of the line

1.2 Calculate the Distance of the Line from the Points

Fill out the table below for your line:

xi yi mxi yi − mxi (yi − mxi)^2 0 0 0 0 0 1 1.

∑^6

i=

(yi − mxi)^2 =

V 2 (m) =

∑^6

i=

(yi − mxi)^2 =.........

Assignment (Task 1):

  • Complete this calculation of V 2 (m).
  • Type your answer into the subject line of an email to your professor. Your answers must be braced together, for example, if your value for m is 1.48 and the value for V 2 (m) is 1.88, type: {1.48,1.88}
  • Send the email. Do not type anything else.
  • You will lose your homework grade if you do not follow these directions.

2 Alternative Optimization Methods

In Problem 1, to find the “best” fitting line of the form y = mx we found the value of m that minimized the function

V 2 (m) =

(1. 2 − m)^2 + (3. 8 − 2 m)^2 + (4. 2 − 3 m)^2 + (6. 3 − 4 m)^2 + (7. 2 − 5 m)^2 + (7. 3 − 6 m)^2

It was claimed that V 2 (m) represented the total distance between the data points and the model (the y = mx line), so the lower this distance the better the fit. There are, however, alternative ways to measure the distance between a data set and a model.

2.1 Alternative Residuals

A residual is a distance from a single data point and the curve of the model. The total distance function is a combination of all the residuals. When deriving the function V 2 , we used ‘vertical’ residuals (i.e., residuals which are parallel to the y-axis). We could, however, use a horizontal residual (i.e., one parallel to the x-axis), or a perpendicular residual (i.e., one at right-angles to the model line). These three alternatives are illustrated below:

(xi, yi)

yi − mxi

(xi, mxi)

Vertical Residual

(xi, yi) xi^ −^

y mi ( y mi , yi)

Horizontal Residual

(xi, yi) (y √im−mx (^2) +1i) (xi, yi)

Perpendicular Residual

To calculate the total distance functions from these three residuals, we can square each residual distance, sum all these, and find the square root of this sum. The values of the seven residuals for these three possibilities are given below:

Data Point Vertical Horizontal Perpendicular (0, 0) 0 0 0

(1, 1 .2) 1. 2 − m 1 − (^1) m.^2 √^1 .m^2 − (^2) +1m

(2, 3 .8) 3. 8 − 2 m 2 − (^3) m.^83 √.^8 m− (^22) +1m

(3, 4 .2) 4. 2 − 3 m 3 − (^4) m.^24 √.^2 m− (^23) +1m

(4, 6 .3) 6. 3 − 4 m 4 − (^6) m.^36 √.^3 m− (^24) +1m

(5, 7 .2) 7. 2 − 5 m 5 − (^7) m.^27 √.^2 m− (^25) +1m

(6, 7 .3) 7. 3 − 6 m 6 − (^7) m.^37 √.^3 m− (^26) +1m

From this table we can easily write down the different total distance functions:

V 2 (m) =

(1. 2 − m)^2 + (3. 8 − 2 m)^2 + (4. 2 − 3 m)^2 + (6. 3 − 4 m)^2 + (7. 2 − 5 m)^2 + (7. 3 − 6 m)^2

H 2 (m) =

m

m

m

m

m

m

P 2 (m) =

  1. 2 − m √ m^2 + 1
  1. 8 − 2 m √ m^2 + 1
  1. 2 − 5 m √ m^2 + 1
  1. 3 − 6 m √ m^2 + 1

These functions are defined in the Mathematica file named M3 P1 OtherOFs.nb. We find the critical point of these functions, and use a test to confirm that the point is a local minimum. Note that each function gives a different optimal value for the slope of the of the straight line model.

2.2 Different ways of totaling the distance

Once the type of residual has been selected we have to have a scheme for combining the individual residuals into a ‘total distance’. The scheme we have been using is to square, add and square root the sum (we can call this as ‘pythagorean scheme’). Other schemes are:

  • Just sum the residuals.
  • Cube, sum, and cube root the sum.
  • Take the fourth power, sum, and take the fourth root of the sum.
  • Take the fifth power, sum, and take the fifth root of the sum.
  • etc.

In other words we can define the total distance function, for this set of data, by any one of the formulae below, for any whole value of p:

Vp(m) = [(1. 2 − m)p^ + (3. 8 − 2 m)p^ + · · · + (7. 2 − 5 m)p^ + (7. 3 − 6 m)p]

1 p

Hp(m) =

[(

m

)p

m

)p

  • · · · +

m

)p

m

)p] (^1) p

Pp(m) =

[(

  1. 2 − m √ m^2 + 1

)p

  1. 8 − 2 m √ m^2 + 1

)p

  • · · · +
  1. 2 − 5 m √ m^2 + 1

)p

  1. 3 − 6 m √ m^2 + 1

)p] (^1) p

Note that for odd values of p the functions Vp, Hp and Pp do not have a minimum. They either increase or decrease. They do, however, pass through the x-axis, meaning that there is a value of m for which the ‘total distance’ between data and model is zero (this is when the positive residuals cancel out the negative residuals). So, for odd values of p we find the optimal value of m by finding the zero of the distance function.

x

y (^) y = mx + b

(xi, yi)

yi − (mxi + b)

Vertical Residual

x

y (^) y = mx + b

x^ (xi, yi) i −^ yi m−b

Horizontal Residual

x

y (^) y = mx + b

(xi, yi)

yi√−mmx (^2) +1i−b

Perpendicular Residual

Hence, the list of objective functions, we have to choice from, is:

Vp(m, b) = [(95 − 20 m − b)p^ + (90 − 27 m − b)p^ + · · · + (109 − 44 m − b)p^ + (115 − 46 m − b)p] p^1

Hp(m, b) =

[( 20 − 95 −^ b m

)p

( 27 − 90 −^ b m

)p

  • · · · +

( 44 − 109 −^ b m

)p

( 46 − 115 −^ b m

)p] (^1) p

Pp(m, b) =

[( (^95) √− 20 m − b m^2 + 1

)p

( (^90) √ − 27 m − b m^2 + 1

)p

  • · · · +

( (^109) √ − 44 m − b m^2 + 1

)p

( (^115) √ − 46 m − b m^2 + 1

)p] (^1) p

Their values will change with both m and b. Their graphs are surfaces. Below is the graph of V 2 (m, b):

0

1

2 40

50

60

70

80

0

50

100

150

0

1

It is hard to see that this function does have a minimum value. However we can try

to solve the two of simultaneous equations

∂V 2

∂m

= 0 and

∂V 2

∂b

= 0. This will give us

points, if any exist, where both rate of change in the m-direction is zero, and the rate of change in the b-direction is zero.

Homework 3

  • Using the commands in the Mathematica workbook M3 P2 AffineModel.nb, an- swer the questions below.
  • The answers should by written in a word-document, named "your last name" M3 HW3.doc
  • You may work together with your fellow group members if you wish, but should submit individual copies of your work.
  1. Using the total distance function H 4 (m, b), find the optimal model for the test data, i.e.

Age (Months) Score 20 95 27 90 30 98 35 103 41 112 44 109 46 115

Provide a graphic evidence that the model is valid.

  1. Using the P 2 distance function, fit the best model of the form y = mx + b to the data about the growth of plant roots from Problem 1, i.e.

Day Growth (mm) 0 0 1 1. 2 3. 3 4. 4 6. 5 7. 6 7.

Comment on whether a model of the form y = mx or a model of the form y = mx + b is most suitable for this data.

4.3 Definition of Residuals to curves

The next three diagrams show how the different residuals are defined

y = f (x)

(xi, yi)

yi − f (xi)

(xi, f (xi))

Vertical Residual

y = f (x)

(xi, yi)

xi − f −^1 (yi) (f −^1 (yi), yi)

Horizontal Residual

(xi, yi) y = f (x) √ (xi − xˆ)^2 + (yi − yˆ)^2

(ˆx, yˆ)

Perpendicular Residual: The value of ˆx is the solution of yi − f (ˆx) = f ′(ˆx)(ˆx − xi), and the value of ˆy is f (ˆx).

Notice that in order to calculate either horizontal or perpendicular residuals one must first solve an equation. Consequently, these often involve practical difficulties, and vertical residuals are often the only ones that can be calculated.

4.4 Misleading Residuals

There are situations where using horizontal or vertical residuals can give inaccurate values to ‘the distance from point to curve’. These are illustrated below.

(xi, yi) Vertical residual gives an erroneously large distance.

5 Problem 4

5.1 Statement

The most critical stage of a 100m race is as the athlete accelerates out of the blocks. The athlete will be able to maintain the speed they manage to reach in this phase. Below are the values of an athlete’s acceleration in the first 0.8 seconds of a practice run. What is the athlete’s speed 0.8 seconds into the run?

Time (sec) Acceleration (m/s^2 ) 0 20. 0.1 20. 0.2 19. 0.3 17. 0.4 14. 0.5 9. 0.6 5. 0.7 1. 0.8 0

5.2 Fitting a four parameter

Suppose we want to fit a cubic model to the data, ie. a model of the form a(t) = at^3 + bt^2 + ct + d, then we will follow the same proceedure as before. We define the total distance function, and find where this function is a minimum.In this example if used the V 2 total distance function it would be defined as

V 2 (a, b, c, d) = [(20. 4 − a(0))^2 + (20. 3 − a(0.1))^2 + (19. 4 − a(0.2))^2 + (17. 3 − a(0.3))^2 + (14 − a(0.4))^2 + (9. 8 − a(0.5))^2 + (5. 3 − a(0.6))^2 + (1. 6 − a(0.7))^2 + (0 − a(0.8))^2 ]

(^12)

To minimize this function we find all four partial derivatives of V 2 , and find the locations when all four are simultaneously equal to zero. That is solve:

∂V 2 ∂a

∂V 2

∂b

∂V 2

∂c

∂V 2

∂d

We now need to run some type of test to classify the type of critical points we have found. Unfortunately the equivalent of the second derivative test is too complex for this course. We can’t even examine the graph of V 2 to see if the location looks like a minimum, because the graph of V 2 lies in five dimensional space. The only check we can perform is to plot the data and the new model and see if it is a reasonable fit.

5.3 Solution

When each of the stages is done on Mathematica (using file: M3_P4_acceleration.nb) we find that the model that minimizes the V 2 function is a(t) = 80. 8923 t^3 − 120. 209 t^2 +

  1. 8938 t + 20.0525 and if this plotted next to the data we find that it is a reasonable fit:

0.2 0.4 0.6 0.8 1

Time HsL

5

10

15

20

Acc Hm•s^2 L (^) Acceleration

So we cross our fingers and hope that this really is a minimum and not some four dimensional equivalent of a saddle point.

Homework 5:

  • Using the commands in the Mathematica workbook M3 P4 Acceleration.nb, answer the questions below.
  • The answers should by written in a word-document, named "your last name" M3 HW4.doc
  • You may work together with your fellow group members if you wish, but should submit individual copies of your work.
  1. Find the model of the form at^4 + bt^3 + c that is a best fit, using V 2 , of the data in this problem. Include a graph that supports your claim that your model is the one that fits the data best.