Presentation is loading. Please wait.

Presentation is loading. Please wait.

Access Mathematics Linear Graphs & Best line fits (Least squares)

Similar presentations


Presentation on theme: "Access Mathematics Linear Graphs & Best line fits (Least squares)"— Presentation transcript:

1 Access Mathematics Linear Graphs & Best line fits (Least squares)

2 2 Learning objectives After the session you will be able to: Compute the salient details of a straight line in space Find the solution to two simultaneous equations using graphical means Algebraic solutions to systems of two equations. Computer solutions to systems of equations Use a computer (and/or calculator) to compute the best line fit

3 3 Graphs Draw a table of values Plot the points accurately Draw a straight line or smooth curve, with a sharp pencil. Read off values accurately

4 4 Recap: Graphs Plot the graph y = 2x + 1 x -3 -2 -1 0 1 2 3 2x -6-4-20246 +11111111 y-5-3-11357 Plot x and y

5 5 y = 2x + 1 Rise Run Rise Run

6 6 y = 3x - 2 Plot the graph y = 3x - 2 x -3 -2 -1 0 1 2 y-11-8-5-214

7 7 y = -2x + 3 MATLAB Commands: >>y=‘-2*x+3’ >>fplot(y,[0,6]) OR >>y=‘-2*x+3’ >>ezplot(y)

8 8 Straight line summary The equation for a straight line is always in the form: y = mx + c  m is the gradient (calculated from the rise over the run).  And c is simply the intercept on the y axis. +ve -ve

9 9 Fractional coefficients

10 10 3x + 2y = 12 How would we approach this problem Note for implicit functions you must use the ezplot command MATLAB Commands: >>ezplot(‘3*x+2*y=12)

11 11 2x – 3y = 18 MATLAB Commands: >>ezplot(‘2*x-3*y=18)

12 12 Group Discussion Sketch the graphs of the following:

13 13 The Intercept Method

14 14 Learning Check Solve the following using a graphical method y=2x -1 & y= 8-x Use MATLAB to verify your results. Q. Is there a way to solve such problems algebraically? Commands: >> ezplot('8-x‘) >> fplot(y,[0,6]) >> hold on >> grid on >> y='2*x-1‘ >> fplot(y,[0,6]) >> fplot(y,[0,6],'r') Read off or use ginput

15 15 Class Examples Time Solve the following problems using a graphical method and verify the results using algebra/MATLAB y=x+3 & y=7-x y=x-4 & 2x+y=5 x+y =3 & y=1-2x y=x+4 & y=3x y=2x-1 & y=3x+2

16 16 Finding the Line Here’s the StarGate bit: A point in three dimensions needs six pieces of information to be fully described. A course therefore seven Since a line exists essentially in 2D then only two pieces of information. Two points A gradient and a point

17 17 Example Find the equation of the line given that it passes though the points (-2,1) and (6,5)

18 18 Examples 1. Find the equation of the line given the points (-2,4) and (4,1) expressing your answer in the form ax+by=c. 2. A line has a gradient of –0.75 and passes through a point (3,-4), state the equation of the line. 3. Find the equation of a line with a gradient of unity given that it passes through the point (-1,-2).

19 19 Best Line Fit Consider the following data if we suspect that these must fall on a straight line what is the best way of finding the relationship (the law of the line)

20 20 Example: Best Line Fit Find the best line fit given the following data Hence or otherwise find the law of the line

21 21 Class Discussion Time Plot the graph given the following data: Find the best line fit Hence the law of the line.

22 22 Analytical: Best Line Fit MATLAB is a useful tool to evaluate the line of best fit for you. The procedure is: Enter data x=[-4:1:4] y=[-9.81 -5.87 etc Plot graph plot(x,y,’x’)

23 23 Analytical: Best Line Fit Fit data to line ployfit(x,y,1) ans=2.0545 -0.5500 Set up function y1=‘2.0545*x-0.5500’ Plot the function hold on fplot(y1,[-4:4],’k’)

24 24 Group Activity: The width of keyways for various shaft diameters are given by: D 10 20 30 40 50 60 w3.8 6.38.311.3 13.8 16.3 (1) Show that the relationship between D and W is linear and find the law of the line (2) Use MATLAB or otherwise to find the analytical law of the line

25 25 Lesson summary Have we met our leaning objectives, specifically can you now: Find the solution to two simultaneous equations using graphical means Algebraic solutions to systems of two equations. Computer solutions to systems of equations Use a computer (and/or calculator) to compute the best line fit

26 26 Homework 1. Find the equation of the line given the points (-1,6) and (4,1) expressing your answer in the form ax+by=c. 2. A line has a gradient of 1/2 and passes through a point (-2,4), state the equation of the line. 3. Find the equation of a line with a gradient of unity given that it passes through the point (0,-4).

27 27 Homework During an experiment to find the coefficient of friction between two surfaces the following results were obtained. Load W (N) 10 20 30 40 50 60 Friction Force F (N) 1.5 4.3 7.610.4 13.5 15.6 Find the law connecting the variables in the form of: F=aW+b (You may use a computer if you wish)


Download ppt "Access Mathematics Linear Graphs & Best line fits (Least squares)"

Similar presentations


Ads by Google