28
Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

Embed Size (px)

Citation preview

Page 1: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

Analytical Toolbox

Simultaneous Equations

By

Dr J.P.M. Whitty

Page 2: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

2

Learning objectives

• After the session you will be able to:• Find the solution to two simultaneous equations

using graphical means.• Algebraic solutions to systems of two equations.• Appreciate the solution protocol required for

systems of three equations.• Use math software to solve systems of equations.

Page 3: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

3

Learning Check: 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

Page 4: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

4

Example

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

2

1

62

51Gradient theFind

x

ym

cxy 2

1intercept theFind

c )5(2

16 do point willAny c )2(

2

11or

Page 5: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

5

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

Page 6: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

6

Learning Check

Solve the following using a graphical method

y=2x -1 & y= 8-x

Hence, use MATLAB to verify your results.

Q. Is there a way to solve such problems algebraically?

Page 7: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

7

Class Examples Time

• Solve the following problems using a graphical method (via MATLAB) and verify the results using substitution

• 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

Page 8: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

8

Algebraic Solution One way to obtain an algebraic solution is to

substitute one equation into the other and obtain the solution of the resulting linear equation. Thus:

• y=x+3 (1) & y=7-x (2)• x+3=7-x• 2x=4; x=2• y=x+3=5 • Also 7-2=5 (which satisfies the second)

Page 9: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

9

Algebraic Solution Continued

Solve the following simultaneously x+y =3 & y=1-2x• x+(1-2x)=3• -1x=2• x=-2• -2+y=3; y=5• Does the other equation fire also?

Page 10: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

10

Class Examples Time• Use the method of substitution • y=x-4 & 2x+y=5• y=x+4 & y=3x• y=2x-1 & y=3x+2

Page 11: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

11

Method of Elimination

Let us consider the class examples Let us consider the class examples again written in a slightly different again written in a slightly different form, i.e. equating the variables to a form, i.e. equating the variables to a number thusnumber thus• y-x=-4 & y+2x=5y-x=-4 & y+2x=5• y-x=4 & y-3x=0y-x=4 & y-3x=0• y-2x=1 & y-3x=2y-2x=1 & y-3x=2• Since in each of these examples that Since in each of these examples that coefficients of y are identical than we are just coefficients of y are identical than we are just able to subtract the equationsable to subtract the equations

Page 12: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

12

Method of Elimination Write on equation under the other thus y - x=4 y+2x=5 0-3x=-9 x=3; y-3=4; y=1 Does the other equation also fire?

Page 13: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

13

Method of Elimination This method can be used when ever the either the x

or the y coefficients are the same: consider:• 3x+y=7 & x+y=3• 5x+4y=17 & 3x+4y=15• Additionally if the signs are different we add instead

of subtracting• 5x-2y=5 & 3x+2y=19• 4x+3y=19 & 2x-3y=5

Page 14: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

14

Class Examples Time• Solve the following simultaneous equations using the

method of elimination verity your answers using MATLAB.

• 2x+y=8 & x-y=1• 2x+3y=14 & 2x-y=6• 3x+5y=5 & x–5y =15• 3x+2y=13 & 3x+y=9• 6x+5y=3 & 2x+5y=9

Page 15: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

15

Equations with unlike coefficients So far we have only considered sets of

equations where the coefficients of either the x or the y values are the same. A problem occurs when this is NOT the case, consider:

• 2x+ y= 9• 5x+2y=22

Page 16: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

16

General Method of Ellimination(Cross Multiplication)

The method of attack is ALWAYS the same regardless and is as follows:

A. Multiply the first equation by the coefficient of y in the second equation.

B. Multiply the second equation by the coefficient of y in the first equation.

C. The coefficients of y are now equal so they can now be solved as previously. (i.e. if they have the same sign subtract otherwise add)

Page 17: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

17

Cross multiplication Let us now consider

how this works when applying this to the last example.

• 2x+ y= 9 (1)• 5x+2y=22 (2)

• 2(2x+ y= 9) (1)• 1(5x+2y=22) (2)

4x+2y=18 4x+2y=18 (1)(1)5x+2y=22 5x+2y=22 (2)(2)

-1x+0=-4-1x+0=-4x=4x=4

2(4)+y=92(4)+y=9y=1y=1

Page 18: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

18

Discussion Examples Use the general method of elimination to

solve the following:

1. 2x+y=18 & 2x-3y=1

2. 5x+2y=18 & 7x-8y=9

3. 8x+7y=22 & 12x-5y=2

4. 3x-4y=1 & 9x-7y=13

5. 2x-3y=8 & 8x+15y=5

Page 19: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

19

Summary

Simultaneous equations can be solve via the method substitution or elimination generally the following rules apply to which method should be used Method of substitution if one of the equations y=mx+c

of x=ay+b then substitute this equation into the other. If the equations are both un the form ax+by=c then

use the elimination method

Page 20: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

20

Solution of three simultaneous equations

12627

8735

26432

321

321

321

III

III

III

Problems occur in scientific and engineering problems where more unknowns are required. Hence more equations are required. We will only concern ourselves here with three unknowns as in principle the methods shown in this lecture can easily be extended.

Page 21: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

21

Discussion Examples

62

9532

1043

)1

zyx

zyx

zyx

How would we approach these problems:

2223

33432

4

)2

zyx

zyx

zyx

Page 22: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

22

Use of mathematic Software

Once you have more than four equations even with the higher math methods of Matrices and Determinates it is still cumbersome and due to the amount of computations errors inevitably creep in to calculation. Thus the need for computer solutions of such systems of equations is self evident. To solve such systems we can use a number of math software packages inc. MatLab & Derive

Page 23: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

23

Computer Solutions of Equations

Let us consider the systems of equations as before:The solution protocol is the same each time using the math package

62 3#

9532 2#

1043 1#

zyx

zyx

zyx

Go to SOLVE in the top menu

Select system and enter the appropriate expression numbers (in this case #1,#2 and #3)

The package then returns the solution vector for the system

Page 24: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

24

MatLab Computer Solution

12627

8735

26432

)1

321

321

321

III

III

IIIUse the following method to solve the following systems of equations:

2223

33432

4

)2

zyx

zyx

zyx

I. Type each of the coefficients on the RHS into a matrix A=[2, 4, -4;1 -5 -3; -7 2 6] (Important to remember the semicolons)

II. Type the RHS as a column vector [26; -87; 12]

III. Type in x=A\b and the system will return the solution (NB a backslash \ is required)

Page 25: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

25

Summary

• Have we met our learning objectives?• Specifically: are you able to:

• Find the solution to two simultaneous equations using graphical means.

• Algebraic solutions to systems of two equations.• Appreciate the solution protocol required for systems of

three equations.• Use math software to solve systems of equations.

Page 26: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

26

Derive Solution of Equations

Let us consider the systems of equations as before:The solution protocol is the same each time using the math package

62 3#

9532 2#

1043 1#

zyx

zyx

zyx

Go to SOLVE in the top menu

Select system and enter the appropriate expression numbers (in this case #1,#2 and #3)

The package then returns the solution vector for the system

Page 27: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

27

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

Page 28: Analytical Toolbox Simultaneous Equations By Dr J.P.M. Whitty

28

Homework

Use the most suitable method to solve the following simultaneous equations:

1. 7x-10y=16 & 4x-15y=372. y=3x-1 & 2y-6x=23. 3x-5y=13 & 7x+3y=14. 3x+5y=5 & x-5y=155. 3x+2y=8 & 7x+10y=24