Math 1483 - Quiz 5

<=/Solutions\=>

Remember, ALT+7 gives a new text cell, be sure to explain your answers, if needed!

Problem 1

There are four data sets given below.  I have used an Iconize function so that you do not have to actually look a the 200 points in each data set.  Simply execute the command to store data sets to the variables as you would on any other command.

These data sets need to be modeled by functions. Your choices of functions are as follows:

L(x)  = m x + b
Q(x) = a (x^2)+b x + c
C(x) = a (x^3)+ b (x^2)+ c x + d
E(x) = a + b* (c^t)

The first is the definition of the linear function, the second is the quadratic function, the third a cubic equation, and lastly, the fourth is  an exponential function.

DataSet1 = ;
DataSet2 = ;
DataSet3 = ;
DataSet4 = ;

Part 1

Plot each data set on its own graph.

DataSet1ListPlot = ListPlot[DataSet1]

DataSet2ListPlot = ListPlot[DataSet2]

DataSet3ListPlot = ListPlot[DataSet3]

DataSet4ListPlot = ListPlot[DataSet4]

Part 2

For each of the graphs in Part 1, determine which of the functions, L(x), Q(x), C(x), and E(x) would be the best model.  You will use each model once, so each data set will have its own model.

DataSet1 is cubic, so C(x) will be the model.
DataSet2 is clearly quadratic, so Q(x) is the correct model.
DataSet3 appears to be linear, so L(x).
DataSet4 is last, and although it might be quadratic, we have already used that for DataSet2, so the exponential model, E(x), is the last choice.

Part 3

Find the best fit model for DataSet1 using the  corresponding function for which you selected in Part 2.

DataSet1BestFitCubic = LinearModelFit[DataSet1,{1,t,t^2,t^3},t]

The best fit cubic is C(x) = 2.014210613152774` -1.5425674793177881` t-0.461596994091566` (t^2)+0.0883145800826442` (t^3).

Part 4

Plot your best fit model and DataSet1 together on the same graph.  Make sure the curve fits the data reasonably well.

DataSet1BestFitCubicPlot=Plot[DataSet1BestFitCubic[t],{t,0,10}, PlotStyle->{Red, Thickness[0.004]},PlotLegends->{"Best Fit Cubic",LegendMarkers->Automatic}];

Show[DataSet1BestFitCubicPlot,DataSet1ListPlot]

Part 5

Find the best fit model for DataSet 2 using the  corresponding function for which you selected in Part 2.

DataSet2BestFitQuadratic = LinearModelFit[DataSet2,{1,t,t^2},t]

The best fit quadratic is Q(x) = 1.840635748585261` -1.8800879788624578` t+0.1992878923687855` (t^2).

Part 6

Plot your best fit model and DataSet2 together on the same graph.  Make sure the curve fits the data reasonably well.

DataSet2BestFitQuadraticPlot=Plot[DataSet2BestFitQuadratic[t],{t,0,10}, PlotStyle->{Red, Thickness[0.004]},PlotLegends->{"Best Fit Quadratic",LegendMarkers->Automatic}];

Show[DataSet2BestFitQuadraticPlot,DataSet2ListPlot]

Part 7

Find the best fit model for DataSet3 using the  corresponding function for which you selected in Part 2.

DataSet3BestFitLine = LinearModelFit[DataSet3,{1,t},t]

The best fit quadratic is Q(x) = 0.4004624179614758` +2.2022014123909437` t.

Part 8

Plot your best fit model and DataSet3 together on the same graph.  Make sure the curve fits the data reasonably well.

DataSet3BestFitLinePlot=Plot[DataSet3BestFitLine[t],{t,0,10}, PlotStyle->{Red, Thickness[0.004]},PlotLegends->{"Best Fit Line",LegendMarkers->Automatic}];

Show[DataSet3BestFitLinePlot,DataSet3ListPlot]

Part 9

Find the best fit model for DataSet4 using the  corresponding function for which you selected in Part 2.

For the exponential function, we have to use the FindFit command.

Model = A*B^t+CC;

fit = FindFit[DataSet4,Model,{A,B, CC},t];

DataSet4BestFitExponential = Function[{t},Evaluate[Model/.fit]]

So the best fit exponential function is E(t) = -2.1729919343605872`+0.051712048488874875` ((1.724638698412165`)^t) .

Part 10

Plot your best fit model and DataSet4 together on the same graph.  Make sure the curve fits the data reasonably well.

DataSet4BestFitExponentialPlot=Plot[DataSet4BestFitExponential[t],{t,0,10}, PlotStyle->{Red, Thickness[0.004]},PlotLegends->{"Best Fit Exponential",LegendMarkers->Automatic}];

Show[DataSet4BestFitExponentialPlot,DataSet4ListPlot]

Part 11

For the quadratic and cubic models you found for the data sets, compute the maximum and minimum values the functions obtain on the interval [0,10].  Be sure to specify at which t values these maximum and minimums occur.

FindMaximum[{DataSet2BestFitQuadratic[t], 0 ≤ t ≤ 10},t]

FindMinimum[{DataSet2BestFitQuadratic[t], 0 ≤ t ≤ 10},t]

FindMaximum[{DataSet1BestFitCubic[t], 0 ≤ t ≤ 10},t]

FindMinimum[{DataSet1BestFitCubic[t], 0 ≤ t ≤ 10},t]

The minimum and maximum values for the quadratic Q(x) on the interval [0,10] are -2.59357 at t=4.71702 and 1.84064 at t = 3.835353938527997`*^-8, respectively.
The minimum and maximum values for the Cubic C on the interval [0,10] are -6.26372 at t=4.71843 and 2.01421 at t = 4.89346×(10^(-8)), respectively.

Problem 2

Please write a sentence or two stating the positives of using Mathematica this semester.  Follow this with a sentence or two stating the negatives.  Keep in mind, if we did not use Mathematica, we would have had to do much of this work with a wee little TI-82, or maybe Desmos online (e.g., the nature of the course was to use technology to help solve problems, so technology was a requirement).

Problem 3

Simply rejoice, it has been a long semester.  Congratulate yourself for getting this far, good luck with the rest of your classes!