260 likes | 539 Views
AM2032 JAYANTA MUKHERJEE. APPROXIMATION . Least Squares Method of Curve Fitting. OF DATA. AM2032 JAYANTA MUKHERJEE. Data points (xi, yi) can be approximated by a function y = f(x) such that the function passes close" to the data points but does not necessarily pass through them.. Data Ap
E N D
1. AM2032 JAYANTA MUKHERJEE
2. AM2032 JAYANTA MUKHERJEE
3. AM2032 JAYANTA MUKHERJEE
4. AM2032 JAYANTA MUKHERJEE Multi-Valued Data Points
5. AM2032 JAYANTA MUKHERJEE Fitting Data With a Linear Function
6. AM2032 JAYANTA MUKHERJEE Linear Least Squares Algorithm
7. AM2032 JAYANTA MUKHERJEE Linear Least Squares Algorithm-cont. Our goal is to determine the values of a and b that will minimize z, the sum of the squares of the errors.
8. AM2032 JAYANTA MUKHERJEE Plot of Linear Fit using Matlab
9. AM2032 JAYANTA MUKHERJEE Plot of Linear Fit using Matlab
10. AM2032 JAYANTA MUKHERJEE A Linear Fit Ignoring One Data Point
11. AM2032 JAYANTA MUKHERJEE Second Degree Polynomial Fit, Ignoring a Different Data Point
12. AM2032 JAYANTA MUKHERJEE Choosing the Right Polynomial The degree of the correct approximating function depends on the type of data being analyzed.
13. AM2032 JAYANTA MUKHERJEE Data Approximation with Matlab’s ‘polyfit’ The steps used in Matlab for approximating data are very similar to those used for interpolation
14. AM2032 JAYANTA MUKHERJEE Example ‘Ohm’s Law’
15. AM2032 JAYANTA MUKHERJEE Example-cont.
16. AM2032 JAYANTA MUKHERJEE IN MATLAB Rewrite I = V/R as I = (1/R)*V, which is a linear relationship between V and I, with coefficient 1/R.
17. AM2032 JAYANTA MUKHERJEE
The output from Matlab is
resistance =
4.9515
Thus, the resistance is 4.95 O.
IN MATLAB-The Plot
18. AM2032 JAYANTA MUKHERJEE Exponential Fit Not all experimental data can be approximated with polynomial functions.
Exponential data can be fit using the least squares method by first converting the data to a linear form.
19. AM2032 JAYANTA MUKHERJEE Relationship between an Exponential & Linear Form
20. AM2032 JAYANTA MUKHERJEE
21. AM2032 JAYANTA MUKHERJEE
22. AM2032 JAYANTA MUKHERJEE An exponential function,
y = aebx
can be rewritten as a linear polynomial by taking the natural logarithm of each side:
ln y = ln a + bx
By finding ln yi for each point in a data set, we can solve for a and b using the least squares method. Relationship between an Exponential & Linear Form
23. AM2032 JAYANTA MUKHERJEE Using Matlab to Approximate Exponential Data: An Example
24. AM2032 JAYANTA MUKHERJEE A(t)=A0 e-?t
ln(A(t)) = ln(A0) + -?t Example-Cont.
25. AM2032 JAYANTA MUKHERJEE Example-Cont. The plot of the exponential approximation
26. AM2032 JAYANTA MUKHERJEE Interpolation vs. Approximation Splines are used:
To produce smooth surfaces, shapes, and motions.
When interpolation best used:
When you wish to find an unknown intermediate point within a dataset with well-defined behavior.
When a relatively small data set exists.
When is approximation best used:
When evaluating fluctuating data.
To create a mathematical model of a process.
27. AM2032 JAYANTA MUKHERJEE Fundamental to Engineering Practice and Research Analysis of data in engineering research involves relating data to theory or a model.
This starts with “fitting” the data to mathematical functions so that relationships can be explored.
The next step is to compare the approximating (data) function with the theoretical function.
The theoretical function is often the solution to a set of differential equations.
For a given theory, when the data function is similar to the theoretical function, we say that we have a good theory or model of the phenomenon.
If the functions are not similar, the theoretical function may need to be modified, or completely new equations may be needed.