Assignment - Curve Fitting
Assignment - Curve Fitting
1. The pressure (P) of gas corresponding to various volumes (V) is measured and given
below: (Roll No.)
V (cm3) 50 60 70 90 100
P (Kg/cm2) 64.7 51.3 40.5 25.9 78
Fit the data to the equation: = . Use a transformation to linearize this equation and
then write a code in MATLAB to determine the parameters a and c. Based on your
analysis predict Pressure (P) at volume (V) = 78.5 cm3. Also Plot given points and curve
= in XY-plane.
2. An investigator has reported the data tabulated below for an experiment to determine the
growth rate of bacteria k (per d), as a function of oxygen concentration c (mg/L). Find
which degree of polynomial is the best fit for given data using MATLAB.
3. The data for temperature (T in oC) versus depth (z in m) during summer was measured for
Platte Lake, Michigan, USA. Find the best fit polynomial for this data using MATLAB.
x 1 2 3 4 5
y 0.5 2 2.9 3.5 4
Find the equation to model this data in MATLAB. Plot the best fit curve by continuous
line along with the given data points by ‘o’ on the same graph. Based on your analysis
predict y at x=2.6.
x 1 5 7 9 12
y 10 15 12 15 21
Use a transformation to linearize this equation and then write a code in MATLAB to
determine ‘a’. Plot the best fit curve by continuous line along with the given data points
by ‘o’ on the same graph. Print the equation on command prompt after getting the
coefficient.
x 1 2 3 4 5 6 7 8
y 1.0 1.2 1.8 2.5 3.6 4.7 6.6 9.1
Use a transformation to linearize this equation and then write a code in MATLAB to
determine a and b. Print the equation on command prompt after getting a & b and predict
the value of y at x=5.3. Plot given points and curve = in XY-plane
x 1 2 3 4 5
y 0.5 2 4.5 8 12.5
Use a transformation to linearize this equation and then write a code in MATLAB to
determine the parameters a and b. Plot the best fit curve by continuous line along with the
given data points by ‘o’ on the same graph. Print the equation on command prompt after
getting the coefficient.
8. A person runs the same track for five days and is timed as follows:
Days (x) 1 2 3 4 5
Time (y) 15.3 15.1 15 14.5 14
Find and plot the best polynomial fit curve by continuous line along with the given data
points by ‘o’ on the same graph. Print the equation on command prompt after getting the
coefficient.
x 1 2 5 10 20 30 40 50
y 98.2 91.7 81.3 64.0 36.4 32.6 17.1 11.3
Plot the curve by continuous line along with the given data points by ‘*’ on the same
graph. Print the equation on command prompt after getting the coefficient. Estimate y
when x=25.
x 1 2 3 4
y 1.7 1.8 2.3 3.2
Plot the best fit curve by continuous line along with the given data points by ‘+’ on the
same graph. Print the equation on command prompt after getting the coefficient. Estimate
y(2.4).
For linearization of this equation, use logarithm base-10. Write a code in MATLAB to
determine the parameters a and b. Plot the best fit curve by continuous line along with the
given data points by ‘+’ on the same graph. Print the equation on command prompt after
getting the coefficient.
Year 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
Population
1134.02 1150.2 1166.23 1186 1210.57 1213.37 1223 1267 1283 1299
(million)
Use a transformation to linearize this equation and then write a code in MATLAB to
determine the parameters p0 and k. Plot the best fit curve by continuous line along with
the given data points by ‘o’ on the same graph. Print the equation on command prompt
after getting the coefficient. Estimate the population of India in year 2020.
14. Find the best fit curve of appropriate order of polynomial for following data:
x 0 0.5 1.0 1.5 2.0 2.5
y 0 0.25 1.0 2.25 4.0 6.25
Which order of polynomial is best fir for this data? Plot the best fit curve by continuous
line along with the given data points by ‘*’ on the same graph. Print the equation on
command prompt after getting the coefficient.
x 1 2 5 10 20 30 40 50
y 98.2 91.7 81.3 64.0 36.4 32.6 17.1 11.3
Plot the best fit curve by continuous line along with the given data points by ‘o’ on the
same graph. Print the equation on command prompt after getting the coefficient. Estimate
y when x=25.
x 2 4 6 8 10
y 4.077 11.084 30.128 81.897 222.62
Plot the best fit curve by continuous line along with the given data points by ‘+’ on the
same graph. Print the equation on command prompt after getting the coefficient.
Plot the best fit curve by continuous line along with the given data points by ‘o’ on the
same graph. Print the equation on command prompt after getting the coefficient.
x 0 1 2 3 4
y -4 -1 4 11 20
Plot the best fit curve by continuous line along with the given data points by ‘o’ on the
same graph. Print the equation on command prompt after getting the coefficient.
19.The one-hour record is the farthest distance travelled by bicycle in 1 h. The table
below shows the world record distances and the dates they were accomplished.
Year 1996 1998 1999 2002 2003 2004 2007 2008 2009
Distance 78.04 79.14 81.16 82.6 83.72 84.22 86.77 87.12 90.6
(Km)
Determine the equation of the line of best fit. Plot the best fit curve by continuous line
along with the given data points by ‘*’ on the same graph. Print the equation on
command prompt after getting the coefficient.
20. The population of the world for selected years from 1750 to 2009 is given in the
following table:
Determine the exponential function that fits the data. Use the function to estimate the
population in 1980. Make a plot of the points and the function.
A 80 85 90 95 100
d 5026 5674 6362 7088 7854
Plot the best fit curve by continuous line along with the given data points by ‘+’ on the
same graph. Print the equation on command prompt after getting the coefficient.
22. The following table gives the viscosity of oil as a function of temperature.
Determine the equation of the line of best fit. Plot the best fit curve by continuous line
along with the given data points by ‘*’ on the same graph. Print the equation on
command prompt after getting the coefficient.
Plot the curve by continuous line along with the given data points by ‘o’ on the same
graph. Print the equation on command prompt after getting the coefficient. Estimate y
when x=7.
x 0 1 2 4
y 1.2 6.2 20.4 100.3
Plot the best fit curve by continuous line along with the given data points by ‘*’ on the
same graph. Print the equation on command prompt after getting the coefficient. Estimate
y(3).
26. Find the curve of best fit of type = for following data:
27. The population of the world for selected years from 1750 to 2009 is given in the
following table:
Determine the equation of the line of best fit. Plot the best fit curve by continuous line
along with the given data points by ‘o’ on the same graph. Print the equation on
command prompt after getting the coefficient.
28. Find the curve of best fit of type = for following data:
29. Find the curve of best fit of type = for following data:
x 3 3.5 4 4.5 5
y 1.49 1.21 0.96 0.73 0.64
Plot the curve by continuous line along with the given data points by ‘o’ on the same
graph. Print the equation on command prompt after getting the coefficient. Estimate y
when x=4.1.
31. Fit a second degree parabola to the following data:
Plot the best fit curve by continuous line along with the given data points by ‘o’ on the
same graph. Print the equation on command prompt after getting the coefficient.
33. The population of the world for selected years from 1950 to 2010 is given in the
following table:
Determine the polynomial function that best fits the data. Use the function to estimate the
population in 1985. Make a plot of the points and the function.
34. The population of the world for selected years from 1950 to 2010 is given in the
following table:
Determine the exponential function that fits the data. Use the function to estimate the
population in 1995. Make a plot of the points and the function.
35. Find which degree of polynomial is the best fit for given data using MATLAB.
36. Find which degree of polynomial is the best fit for given data using MATLAB.
x 0.4 2.5 3.3 5.0 6.2 8.0
y 0.7 19.3 38.2 88.2 100 115
Plot the best fit curve by continuous line along with the given data points by ‘*’ on the
same graph. Print the equation on command prompt after getting the coefficient.
37. The population of the world for selected years from 1750 to 2009 is given in the
following table:
Plot the best fit curve by continuous line along with the given data points by diamond on
the same graph. Print the equation on command prompt after getting the coefficient.
38. Ram hit a golf ball from the top of a hill. The height of the ball above the green is
given in the table below.
Time (s) 1 2 3 4 5
Height 52.5 73.2 74.6 55.8 16.1
(m)
Plot the best fit curve by continuous line along with the given data points by ‘o’ on the
same graph. Print the equation on command prompt after getting the coefficient.
x 1 5 7 9 12
y 10 15 12 15 21
Write a code in MATLAB to determine constants. Plot the best fit curve by ‘dotted’ line
along with the given data points by ‘six pointed star’ on the same graph. Print the
equation of ‘y’ on command prompt after getting the coefficient.
40. The population of the world for selected years from 1750 to 2009 is given in the
following table:
Year (x) 1750 1800 1850 1900 1950 1990 2000 2009
Population(in 791 980 1260 1650 2520 5270 6060 6800
Millions) (y)
Plot the curve of the type y=aemx by continuous line along with the given data points by
square on the same graph. Print the equation on command prompt after getting the
coefficient.
Determine the degree 2 polynomial. Plot the best fit curve by continuous line along with
the given data points by ‘*’ on the same graph. Print the equation on command prompt
after getting the coefficient.
43. A person runs the same track for five days and is timed as follows:
Days (x) 1 2 3 4 5
Time (y) 15.3 15.1 15 14.5 14
Find degree 3 polynomial and plot the best polynomial fit curve by continuous line along
with the given data points by ‘*’ on the same graph. Print the equation on command
prompt after getting the coefficient.