Problem. 2- Generalize Least-squares-30pts- First generate a data set of N points (xi,yi), i=1..N, using those...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem. 2- Generalize Least-squares-30pts- First generate a data set of N points (xi,yi), i=1..N, using those Matlab command lines >>X = linspace (0, 10, 100); >>Y = 2*sin (X+0.5*pi); Now pretend you didn't know how the data points were generated, the goal of this problem is determine a way to approximate this "unknown" data set by a sinusoidal function. 1) [10 pts] Using the generalized least-square matrix formulation derived in class (Section 17.4 of the textbook), determine the two best-fit parameters -amplitude A and phase - so that the data can be fitted by the function y = A sin(x + 0) Eq (1). NAME YOUR CODE MyFit1.m HINT: using trigonometry, show that this fit function y = A sin(x + O) can be rewritten as a linear parameter fit: y = al sin(x) + a2 cos(x) 2) [5 pts] Plot on the same graph the data points and the best fit function (over a more finely sampled horizontal axis to have a smooth curve). Comment on the accuracy of the fit. NAME YOUR CODE MyFit2.m 3) [15 pts] Consider now the data set is noisy. That is the data are now given by X =linspace(0,10,100); Y = 2* sin(X+0.5*pi)+ B*2*(rand(size(X))-0.5);; *Repeat Questions 1)&2) when the noise amplitude B varies successively from 0 to 3 in 0.1 increment (Use a For loop to display the following cases). Plot the variations of the percentage true error for BOTH the fit amplitude A and phase you computed vs. the values of B. (use the true values of amplitude Atrue-2 and phase offset true=1/2 from Part 1 to define the percentage true error). *For what values of noise amplitude B is the original sinusoidal fit given in Eq. (1) no longer relevant ? simply explain why? NAME YOUR CODE MyFit3.m Problem. 2- Generalize Least-squares-30pts- First generate a data set of N points (xi,yi), i=1..N, using those Matlab command lines >>X = linspace (0, 10, 100); >>Y = 2*sin (X+0.5*pi); Now pretend you didn't know how the data points were generated, the goal of this problem is determine a way to approximate this "unknown" data set by a sinusoidal function. 1) [10 pts] Using the generalized least-square matrix formulation derived in class (Section 17.4 of the textbook), determine the two best-fit parameters -amplitude A and phase - so that the data can be fitted by the function y = A sin(x + 0) Eq (1). NAME YOUR CODE MyFit1.m HINT: using trigonometry, show that this fit function y = A sin(x + O) can be rewritten as a linear parameter fit: y = al sin(x) + a2 cos(x) 2) [5 pts] Plot on the same graph the data points and the best fit function (over a more finely sampled horizontal axis to have a smooth curve). Comment on the accuracy of the fit. NAME YOUR CODE MyFit2.m 3) [15 pts] Consider now the data set is noisy. That is the data are now given by X =linspace(0,10,100); Y = 2* sin(X+0.5*pi)+ B*2*(rand(size(X))-0.5);; *Repeat Questions 1)&2) when the noise amplitude B varies successively from 0 to 3 in 0.1 increment (Use a For loop to display the following cases). Plot the variations of the percentage true error for BOTH the fit amplitude A and phase you computed vs. the values of B. (use the true values of amplitude Atrue-2 and phase offset true=1/2 from Part 1 to define the percentage true error). *For what values of noise amplitude B is the original sinusoidal fit given in Eq. (1) no longer relevant ? simply explain why? NAME YOUR CODE MyFit3.m
Expert Answer:
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these mechanical engineering questions
-
Give Correct ANSWERS Human-Computer Interaction (a) If you had been one of the original inventors of the WIMP interface, and engineers on the technical team had been sceptical about the advantages...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Given the following information, prepare a production report with materials added at the beginning and ending work in process inventory being 20% complete with regard to conversion costs. Costs to...
-
On March 1, 2018, Stratford Lighting issued 14% bonds, dated March 1, with a face amount of $300,000. The bonds sold for $294,000 and mature on February 28, 2038 (20 years). Interest is paid...
-
Commonwealth v. Levesque Discuss why the Superior Court allowed the motion to dismiss. Do you agree with the decision of this court? Why or why not? Discuss the three main areas that the...
-
The following table lists typical flight speeds for two aircraft. For which of these conditions would it be reasonable to use the incompressible Bernoulli equation to study the aerodynamics...
-
Triangle Fastener Corporation accumulates costs for its single product using process costing. Direct material is added at the beginning of the production process. and conversion activity occurs...
-
Make report based on productivity commission report and annual report of reject shop.(productivity commission research report- retail cost of doing business in australia september 2014 )please only...
-
Vertical marketing systems consist of the producer, wholesaler, and retailer acting as a unified whole. A) True B) False
-
What was required for the successful implementation of mercantilism?
-
What are the main characteristics of Chinas experience with economic transition?
-
On December 31, 20X1, Tiffin Township paid a contractor $2,000,000 for the total cost of a new firehouse built in 20X1 on township-owned land. Financing was by means of a $1,500,000 general...
-
What positive and negative effects can trade have on a country?
-
How might international relations among countries affect political risk?
-
Companies have relied on their operations functions not only to maintain day-today operations, which has itself been challenging, but also to position the business to survive, grow and remain...
-
Find an equation of the given line. Slope is -2; x-intercept is -2
-
In reaction engineering, the average residence time t is the amount of time an element of fluid spends in a reactor and is related to the amount of substance present in the system. The easiest method...
-
Write a MATLAB program that uses centered finite differences to solve the onedimensional diffusion equation for a spatially dependent diffusion coefficient D(x) = D 0 (1 ax) and the boundary...
-
Consider the solution to the diffusion equation on a 4 4 rectangular grid with equal spacing in the x and y directions. The boundary conditions for the problem are Using the global index k and the...
-
With reference to Exercise 11.65, test the null hypothesis \(\beta=1.5\) against the alternative hypothesis \(\beta>1.5\) at the 0.01 level of significance. Data From Exercise 11.65 11.65 The data...
-
With reference to Exercise 11.65, construct a \(99 \%\) confidence interval for \(\alpha\).
-
The data below pertains to the number of hours a laptop has been charged for and the number of hours of backup provided by the battery. (a) Use the first set of expressions on page 330, involving...
Study smarter with the SolutionInn App