Question

Mathematical models of physical phenomena are infinitely precise. However, we are not able to make measurements...

Mathematical models of physical phenomena are infinitely precise. However, we are not able to make measurements of physical phenomena with anywhere near that precision. Therefore, we often must “fit” the data we measure to a mathematical model we construct to describe the system. How well the data "fits" helps us understand how good our model is and how well our data collection systems perform.

Using the velocity and position data for a falling object provided by the instructor, do the following in MATLAB:

  1. Add in instrumentation noise by introducing a random offset of your design. Explain the rationale for your range of values.
  2. Fit the data to polynomial curves using the methods shown in the textbook.
  3. Determine which "order" of curve best fits the data. The order refers to the highest power of the polynomial equation.
  4. For both velocity and position, plot the curve and the data on the same figure.

velocity = 11, 31, 64, 112, 176, 259, 362
position = 2, 3, 4, 5, 6, 7, 8

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here we are going to demonstrate the effect of 3 polynomial orders (1 2 3) for the relation between velocity and position, obeying the models (between position p and velocity v)

%===================================================

clear all;
clc;

% Assuming position(p) to be a function of velocity(v) as for x=v and y=p giving y=f(x)

x = [11, 31, 64, 112, 176, 259, 362];
y = [2, 3, 4, 5, 6, 7, 8];
y = y + rand(1,length(y)); % Introducing uniform random noise having value between 0 to 1

% Fitting 1,2,3 order polynomials
poly1 = polyfit(x,y,1);
poly2 = polyfit(x,y,2);
poly3 = polyfit(x,y,3);

% Generting fitted values
yfit1 = polyval(poly1,x);
yfit2 = polyval(poly2,x);
yfit3 = polyval(poly3,x);

% Goodness of fit calculation
% == order-1 ==
% Compute the residual values as a vector of signed numbers:

yresid1 = y - yfit1;
yresid2 = y - yfit2;
yresid3 = y - yfit3;


% Square the residuals and total them to obtain the residual sum of squares:

SSresid1 = sum(yresid1.^2);
SSresid2 = sum(yresid2.^2);
SSresid3 = sum(yresid3.^2);

% Compute the total sum of squares of y by multiplying the variance of y by the number of observations minus 1:

SStotal = (length(y)-1) * var(y);

% Compute R2 using the formula given in the introduction of this topic:

rsq1 = 1 - SSresid1/SStotal;
rsq2 = 1 - SSresid2/SStotal;
rsq3 = 1 - SSresid3/SStotal;
fprintf('Goodness of fit for polynomials of order 1 = %f, order 2 = %f, order 3 = %f\n',rsq1,rsq2,rsq3);

% plot
figure
scatter(x,y);
hold on
plot(x,yfit1)
hold on
plot(x,yfit2)
hold on
plot(x,yfit3)
legend('Original data','Polynomial order-1','Polynomial order-2','Polynomial order-3');
xlabel('Velocity');
ylabel('Position');

%===================================================

sample output:

Goodness of fit for polynomials of order 1 = 0.905276, order 2 = 0.943981, order 3 = 0.995069

Note: the output on each run is highly likely to be different that the previous run due to the introduction of random noise in y values.

Add a comment
Know the answer?
Add Answer to:
Mathematical models of physical phenomena are infinitely precise. However, we are not able to make measurements...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • link phenomena at these measurements, if we have a reliable model and appropriate mathematical skills to two length scales. You will be able to predict the behavior of rubber under a variety of...

    link phenomena at these measurements, if we have a reliable model and appropriate mathematical skills to two length scales. You will be able to predict the behavior of rubber under a variety of practical Preliminary calculations Consider a piece of rubber with initial dimensions and orientation shown in the diagram below: to bo where lo, bo, and to are the unstretched length, width, and thickness, respectively Then L./ lo A force F is applied parallel to the x-axis, stretching the...

  • (3) Re-read the Introduction, giving particular attention to its final paragraph. Now, suppose th...

    (3) Re-read the Introduction, giving particular attention to its final paragraph. Now, suppose that physical considerations lead you to expect that measurements on a certain thermodynamic system will lead to the following relationship between the pressure p and the temperature T p %(kT) where k is a constant. Pressure measurements are taken on the system as the temperature is varied, and you would like to perform a curve fit on this data in order to measure the constant k. As...

  • Hello, I have a lab that we have used bending sense in our hand joint and...

    Hello, I have a lab that we have used bending sense in our hand joint and we build a voltage decider to record voltage change as angle of hand joint change as number (4) said : I did record my values in a table1 below. However, I need help in number (5). How would I plot these values in Matlab ? can some one help me plotting what is asked in #5 ? I need help in this Matlab coding...

  • FISCAL POLICY IN THEORY: March, 2020: we are on the verge of Congress and the President...

    FISCAL POLICY IN THEORY: March, 2020: we are on the verge of Congress and the President passing legislation that will empower the federal government to spend an unprecedented amount of EXTRA money not seen since World War 2 ---- in order to address the pandemic but also to help cushion the blow financially of perhaps ten or twenty million Americans --- or more --- losing their jobs, and thus suffering a drop in income. The scale of the 2020 recession...

  • please help with no 3,4,5 and 6 Thanks 1. What is standard error? Measure of statistical...

    please help with no 3,4,5 and 6 Thanks 1. What is standard error? Measure of statistical accuracy of an estimate, equal to the standard deviation of the theorental distribution of a large populanon of such estimates 2. What calculation is used to describe the variation in measurements. 3. In experiment 3.2. You will be measuring out 40ml of volume. How many times will you measure 40 ml? 4. What is the difference for each time you measure out 40ml? In...

  • Should World Kitchen outsource Pyrex production and close the Charleroi plant? If so, how many suppliers should the company employ and where should they be located? We were una...

    Should World Kitchen outsource Pyrex production and close the Charleroi plant? If so, how many suppliers should the company employ and where should they be located? We were unable to transcribe this imagedishwas resulted from a process that pressed together yers of thin, strengthened opaque glass. products if they were moved overseas and simply source the lower-cost private-label versions directly sales and marketing functions. THE MARKET Givsn its extensive experience with outsourcing the Giobal Sourcing Department at World Kitchen had...

  • First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below...

    First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....

  • I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this p...

    I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this paper and some conclusions and contributes of this paper. I need this for my Finishing Project so i need this ASAP please ( IN 1-2-3 HOURS PLEASE !!!) Budgetary Policy and Economic Growth Errol D'Souza The share of capital expenditures in government expenditures has been slipping and the tax reforms have not yet improved the income...

  • 1. According to the paper, what does lactate dehydrogenase (LDH) do and what does it allow...

    1. According to the paper, what does lactate dehydrogenase (LDH) do and what does it allow to happen within the myofiber? (5 points) 2. According to the paper, what is the major disadvantage of relying on glycolysis during high-intensity exercise? (5 points) 3. Using Figure 1 in the paper, briefly describe the different sources of ATP production at 50% versus 90% AND explain whether you believe this depiction of ATP production applies to a Type IIX myofiber in a human....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT