0% found this document useful (1 vote)
331 views

Assignment - Curve Fitting

Develop code in MATLAB to solve assigned curve fitting problems based on given data sets. Problems are assigned based on roll numbers. Code should include plotting fitted curves and data points, and printing equations on the command prompt with coefficients.

Uploaded by

Dustin Martin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
331 views

Assignment - Curve Fitting

Develop code in MATLAB to solve assigned curve fitting problems based on given data sets. Problems are assigned based on roll numbers. Code should include plotting fitted curves and data points, and printing equations on the command prompt with coefficients.

Uploaded by

Dustin Martin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Applied Mathematics –Practical

SY BTECH CIVIL Block-2

Programming Assignment: Based on curve fitting & 2D Plots

Question Description Marks CO No.

Develop code in MATLAB to solve the assigned problems of


Curve fitting.

Every student is assigned the specific problem. Problem number is


the roll number. Follow the template for submission of assignment. 10 6
Read the rubrics (Same as 2D/3D Plots Assignment) carefully and
then submit.

File should be named as School_Block_Roll no_Name_PR3

List of Problems along with assigned roll number:

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.

c (mg/L) 0.5 0.8 1.5 2.5 4


k (per d) 1.1 2.4 5.3 7.6 8.9
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.

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.

T (oC) 22.8 22.8 22.8 20.6 13.6 11.7 11.1 11.1


z (m) 0 2.3 4.9 9.1 13.7 18.3 22.9 27.2
Plot the best fit curve (polynomial / exponential / Power) 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.
4. An investigator has reported the data tabulated below:

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.

5. Find the curve of best fir of type = for following data:

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.

6. Find the curve of best fit of type = for following data:

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

7. Fit the curve of type = to the following data:

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.

9. Fit the exponential curve to the following data:

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.

10. Fit the quadratic curve to the following data:

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).

11. Fit a second degree parabola in the following data:

x 0.0 1.0 2.0 3.0 4.0


y 1.0 4.0 10.0 17.0 30.0
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. Predict
the value of y at x=1.14.

12. Fit the curve of type = ∗ 10 to the following data:

x 0.4 0.8 1.2 1.6 2 2.3


y 800 975 1500 1950 2900 3600

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.

13. The figures of population data of India for 10 years is as under:

(Data from: https://tradingeconomics.com/india/population)

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)

The population growth rate is given by the equation: = 0∗ .

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.

15. Fit an exponential curve for the following data:

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.

16. Determine the constants a and b by fitting exponential equation = :

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.

17. Fit a second degree parabola to the following data:

x 1.0 1.5 2.0 2.5 3.0 3.5 4.0


y 1.1 1.3 1.6 2.0 2.7 3.4 4.1

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.

18. Fit the best polynomial for given data:

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:

Year 1750 1800 1850 1900 1950 1990 2000 2009


Population(in 791 980 1260 1650 2520 5270 6060 6800
Millions)

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.

21.The area A of a circle of diameter d is given for the following values

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.

Temperature 110 130 160 190


viscosity 10.8 8.1 5.5 4.8

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.

23. Fit the exponential curve to the following data:

x 0.9 1.5 3 4 6 8 9.5


y 0.9 1.5 2.5 5.1 4.5 4.9 6.3

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.

25. Fit the quadratic curve to the following data:

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:

x 0.4 2.5 3.3 5 6.2 8


y 0.7 19.3 38.2 88.2 155 224
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.

27. The population of the world for selected years from 1750 to 2009 is given in the
following table:

Year 1750 1800 1850 1900 1950 1990 2000 2009


Population(in 791 980 1260 1650 2520 5270 6060 6800
Millions)

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:

x 0.4 2.5 3.3 5 6.2 8


y 0.7 19.3 38.2 88.2 155 224
Use a transformation to linearize this equation and then write a code in MATLAB to
determine b and m. Print the equation on command prompt after getting b & m and
predict the value of y at x=7.

29. Find the curve of best fit of type = for following data:

x 0 0.5 1 1.5 2 2.5


y 6 4.83 3.70 3.15 2.41 1.83
Use a transformation to linearize this equation and then write a code in MATLAB to
determine b and m. Print the equation on command prompt after getting b & m and
predict the value of y at x=1.2.

30. Fit the exponential curve to the 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:

x -5 -3.4 -2 -0.8 0 1.2 2.5


y 4.4 4.5 4 3.6 3.9 3.8 3.5

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.

32. Fit a second degree parabola to the following data:

x 0.0 1.0 2.0 3.0 4.0


y 5.0 8.0 14.0 21.0 34.0
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. Predict
the value of y at x=1.14.

33. The population of the world for selected years from 1950 to 2010 is given in the
following table:

Year 1950 1960 1970 1980 1990 2000 2010


Population(in 791 980 1260 1650 2520 5270 6060
Millions)

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:

Year 1950 1960 1970 1980 1990 2000 2010


Population(in 791 980 1260 1650 2520 5270 6060
Millions)

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.

c (mg/L) 0.5 0.8 1.5 2.5 4


k (per d) 1.1 2.4 5.3 7.6 8.9
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.

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:

Year 1750 1800 1850 1900 1950 1990 2000 2009


Population(in 791 980 1260 1650 2520 5270 6060 6800
Millions)

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.

39. Fit the cubic polynomial for following data:

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.

41. Find best fitting polynomial to the following data:

x 0.0 1.0 2.0 3.0 4.0


y 5.0 8.0 14.0 21.0 34.0
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. Predict
the value of y at x=1.14.
42. The following table gives the viscosity of oil as a function of temperature.

Temperature 110 130 160 190


viscosity 10.8 8.1 5.5 4.8

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.

You might also like