Answers for Doloresm2007

College Math Professor
algebra_nonlinear_project.doc

Curve-fitting Project - Nonlinear Models

For this assignment, two sets of data will be analyzed. For this part of the project, you will be supplied with the data. You will carry out quadratic regression for the first data set and exponential regression for the second data set.

Quadratic Regression (QR):

Data: On a particular day in July, 2012, the outdoor temperature was recorded at 7 times of the day, and the following table was compiled.

Time of day (hour)

x

Temperature (degrees F.

y

5

70

8

75

11

86

14

91

17

91

20

84

23

77

REMARKS: The times are the hours since midnight. For instance, 5 means 5 am, and 14 means 2 pm.

The temperature is low in the morning, reaches a peak in the afternoon, and then decreases.

Tasks for Quadratic Regression Model (QR):

(QR-1) Plot the points (x, y) to obtain a scatterplot. Note that the trend is definitely non-linear. Use an appropriate scale on the horizontal and vertical axes and be sure to label carefully.

(QR-2) Find the quadratic polynomial of best fit and graph it on the scatterplot. State the formula for the quadratic polynomial.

(QR-3) Find and state the value of r2, the coefficient of determination. Discuss your findings. (r2 is calculated using a different formula than for linear regression. However, just as in the linear case, the closer r2 is to 1, the better the fit.) Is a parabola a good curve to fit to this data?

(QR-4) Use the quadratic polynomial to make an outdoor temperature estimate. Each class member will compute a temperature estimate for a different time of day. Your number 27, multiply it by 0.5 and add to 6 to get a time x in hours; that is, compute x = 0.5n + 6. The value of x is the time you will substitute into the quadratic polynomial to make a temperature estimate. For instance, if your n is 15, then x = 0.5(15) + 6 = 13.5 hours (1:30 pm), and then you would substitute x = 13.5 into your polynomial equation to get the corresponding outdoor temperature estimate for 1:30 pm. State your results clearly -- the time of day and the corresponding outdoor temperature estimate.

(QR-5) Using algebra, find the maximum temperature predicted by the quadratic model and find the time when it occurred. Show work.

Solutions:

(QR-1): Graphed on the next page.

(QR-2): I chose the following 4 points:

X

5

11

17

23

Y

70

86

91

77

Each of the points must satisfy the standard quadratic equation for the same coefficients. So we get the following system:

image1.wmf

77

23

23

91

17

17

86

11

11

70

5

5

3

2

2

1

3

2

2

1

3

2

2

1

3

2

2

1

=

+

+

=

+

+

=

+

+

=

+

+

c

c

c

c

c

c

c

c

c

c

c

c

Where c1, c2, and c3 are the coefficients we’re looking for.

So now we convert this system into a matrix equation:

image2.wmf

ú

ú

ú

ú

û

ù

ê

ê

ê

ê

ë

é

=

ú

ú

ú

û

ù

ê

ê

ê

ë

é

·

ú

ú

ú

ú

û

ù

ê

ê

ê

ê

ë

é

77

91

86

70

529

23

1

289

17

1

121

11

1

25

5

1

3

2

1

c

c

c

Now we multiply both sides of the matrix equation by the transverse of the first matrix. So now we have:

image3.wmf

ú

ú

ú

ú

û

ù

ê

ê

ê

ê

ë

é

·

ú

ú

ú

û

ù

ê

ê

ê

ë

é

=

ú

ú

ú

û

ù

ê

ê

ê

ë

é

·

ú

ú

ú

ú

û

ù

ê

ê

ê

ê

ë

é

·

ú

ú

ú

û

ù

ê

ê

ê

ë

é

77

91

86

70

529

289

121

25

23

17

11

5

1

1

1

1

529

23

1

289

17

1

121

11

1

25

5

1

529

289

121

25

23

17

11

5

1

1

1

1

3

2

1

c

c

c

After multiplying, we get: This gives us the following system:

image4.wmf

ú

ú

ú

û

ù

ê

ê

ê

ë

é

=

ú

ú

ú

û

ù

ê

ê

ê

ë

é

·

ú

ú

ú

û

ù

ê

ê

ê

ë

é

79188

4614

324

378628

18536

964

18536

964

56

964

56

4

3

2

1

c

c

c

image5.wmf

79188

378628

18563

964

4614

18536

964

56

324

964

56

4

3

2

1

3

2

1

3

2

1

=

+

+

=

+

+

=

+

+

c

c

c

c

c

c

c

c

c

Using a systems of three equations calculator technology, we get:

image6.wmf

208

.

0

267

.

6

475

.

43

3

2

1

-

=

=

=

c

c

c

So the quadratic equation of best fit (estimated by choosing the four points) is:

image7.wmf

475

.

43

267

.

6

208

.

0

2

+

+

-

=

x

x

y

(QR-3): The formula for the coefficient of determination for a quadratic regression is :

image8.wmf

(

)

(

)

å

å

-

-

=

2

2

2

mean

obs

mean

est

y

y

y

y

R

So we will create the following table to assist in the calculation of R2:

image9.wmf

x

image10.wmf

y

image11.wmf

(

)

2

mean

obs

y

y

-

image12.wmf

est

y

image13.wmf

(

)

2

mean

est

y

y

-

5

70

144

69.61

153.51

8

75

49

80.299

2.8934

11

86

16

87.244

27.5

14

91

81

90.445

71.318

17

91

81

89.902

62.442

20

84

4

85.615

13.068

23

77

25

77.584

19.501

image14.wmf

(

)

å

-

2

mean

est

y

y

= 350.234 So with this, we get R2 =
image15.wmf

88

.

0

400

234

.

350

=

image16.wmf

(

)

å

-

2

mean

obs

y

y

= 400

Alternatively, by use of Excel, we also retrieve the following as our quadratic equation of best fit:

image17.wmf

804

.

40

4497

.

6

2116

.

0

2

+

+

-

=

x

x

y

(QR-4): If my n is 27, the we compute

image18.wmf

(

)

6

27

5

.

0

+

=

x

to get
image19.wmf

5

.

19

=

x

, which is 7:30pm.

So using the polynomial equation:

image20.wmf

804

.

40

4497

.

6

2116

.

0

2

+

+

-

=

x

x

y

, we get the following result:

image21.wmf

11225

.

86

804

.

40

)

5

.

19

(

4497

.

6

)

5

.

19

(

2116

.

0

2

=

+

+

-

=

y

So the outdoor temperature is approximated to be 86oF.

image22.wmf

(QR-5): To find the maximum temperature predicted by the quadratic model and the time that this temperature occurs, we must find the vertex of the function.

The X value of the vertex is:

image23.wmf

(

)

24

.

15

2116

.

0

2

4497

.

6

2

=

-

-

=

-

=

a

b

x

. This approximates to 3:15pm.

So:

image24.wmf

90

95

.

89

804

.

40

)

24

.

15

(

4497

.

6

)

24

.

15

(

2116

.

0

2

»

=

+

+

-

=

y

°F

Exponential Regression (ER)

Data: A cup of hot coffee was placed in a room maintained at a constant temperature of 69 degrees.

image25

image26

The temperature of the coffee was recorded periodically, and the following table was compiled.

Time Elapsed (minutes)

Coffee Temperature (deg F)

x

T

0

166

10

140.5

20

125.2

30

110.3

40

104.5

50

98.4

60

93.9

REMARKS: Common sense tells us that the coffee will be cooling off and its temperature will decrease and approach the ambient temperature of the room, 69 degrees.

So, the temperature difference between the coffee temperature and the room temperature will decrease to 0.

We will be fitting the data to an exponential curve of the form y = A e- bx. Notice that as x gets large, y will get closer and closer to 0, which is what the temperature difference will do.

So, we want to analyze the data where x = time elapsed and y = T - 69, the temperature difference between the coffee temperature and the room temperature.

Time Elapsed (minutes)

Temperature Difference (deg F)

x

y = T - 69

0

97

10

71.5

20

56.2

30

41.3

40

35.5

50

29.4

60

24.9

Tasks for Exponential Regression Model (ER)

(ER-1) Plot the points (x, y) in the second table to obtain a scatterplot. Note that the trend is definitely non-linear. Use an appropriate scale on the horizontal and vertical axes and be sure to label carefully.

(ER-2) Find the exponential function of best fit and graph it on the scatterplot. State the formula for the exponential function. It should have the form y = A e- bx where software has provided you with the numerical values for A and b.

(ER-3) Find and state the value of r2, the coefficient of determination. Discuss your findings.(r2 is calculated using a different formula than for linear regression. However, just as in the linear case, the closer r2 is to 1, the better the fit.) Is an exponential curve a good curve to fit to this data?

(ER-4) Use the exponential function to make a coffee temperature estimate. Each class member will compute a temperature estimate for a different elapsed time. Look at the Class Members list in our Webtycho classroom, and look for the number "n" next to your name. Take your number n, multiply it by 6 to get an elapsed time x; that is, compute x = 6n. The value of x is the time (in minutes) you will substitute into the exponential function to make a temperature estimate. For instance, if your n is 14, then x = 6(14) = 84 minutes, and then you would substitute x = 84 minutes into your exponential function to get y, the corresponding temperature difference between the coffee temperature and the room temperature. Since y = T - 69, we have coffee temperature T = y + 69. Take your y estimate and add 69 degrees to get the coffee temperature estimate. State your results clearly -- the elapsed time and the corresponding estimate of the coffee temperature.

(ER-5) Use the exponential function together with algebra to estimate the elapsed time when the coffee arrived at a particular target temperature. Report the time to the nearest tenth of a minute. Each class member will work with a different target temperature. Take your "n" value from ER-4 and add it to 69 to get your target temperature T. For instance, if your n is 14, then your target temperature T is 69 + 14 = 83 degrees, and your goal is to find out how long it took the coffee to cool to 83 degrees. Note that 14 is the temperature difference between the coffee and the room, what we are calling y. So, for this particular target temperature, the goal is finding how long it took for the temperature difference y to reach 14 degrees; that is, solving the equation 14 = A e- bx for x. In general, you are solving your equation y = A e- bx for x, where y = your particular temperature difference. Show algebraic work in solving your equation. State your results clearly -- your target temperature and the estimated elapsed time, to the nearest tenth of a minute.

(ER-1): See Previous Page

(ER-2): As seen in the Excel page, the exponential function of best fit is:

image27.wmf

x

e

y

023

.

0

976

.

89

-

=

.

(ER-3): As seen in the Excel page, the coefficient of determination is:

image28.wmf

9848

.

0

2

=

r

, which gives this a very strong positive correlation.

(ER-4): If my n is 27, then we compute

image29.wmf

(

)

27

6

=

x

to get
image30.wmf

162

=

x

minutes. So using the exponential regression:
image31.wmf

x

e

y

023

.

0

976

.

89

-

=

, we get the following result:

image32.wmf

)

162

(

023

.

0

976

.

89

-

=

e

y

= 2.16
image33.wmf

»

2.2OF

So the coffee temperature is approximated to be

image34.wmf

2

.

71

69

2

.

2

=

+

=

T

OF

(ER-5): My target temperature is 69 + 27 = 96 OF. So we will solve for x in the exponential equation:

image35.wmf

x

e

y

023

.

0

976

.

89

-

=

to find out how long it took for the temperature difference to reach 27O.

So:

image36.wmf

976

.

89

976

.

89

976

.

89

27

023

.

0

x

e

-

=

image37.wmf

x

e

023

.

0

3

.

0

-

=

image38.wmf

x

e

023

.

0

ln

3

.

0

ln

-

=

image39.wmf

023

.

0

023

.

0

023

.

0

3

.

0

ln

-

-

=

-

x

image40.wmf

3

.

52

34

.

52

»

=

x

minutes.

_1416606996.unknown

_1416607109.unknown

_1416630888.unknown

_1416631035.unknown

_1416631301.unknown

_1416631373.unknown

_1416631174.unknown

_1416630993.unknown

_1416608032.unknown

_1416608133.unknown

_1416608162.unknown

_1416608218.unknown

_1416608098.unknown

_1416607320.unknown

_1416607013.unknown

_1416607088.unknown

_1416607004.unknown

_1416595840.unknown

_1416597814.unknown

_1416605062.unknown

_1416605141.unknown

_1416605226.unknown

_1416605410.unknown

_1416605110.unknown

_1416604911.unknown

_1416604951.unknown

_1416604454.unknown

_1416596195.unknown

_1416596596.unknown

_1416596091.unknown

_1416594733.unknown

_1416594968.unknown

_1416595778.unknown

_1416594913.unknown

_1416565232.unknown

_1416565481.unknown

_1416564092.unknown