Tutorial 2

26
Shan Feng [email protected]

Transcript of Tutorial 2

Page 2: Tutorial 2

Determine the real roots of f(x)=-0.5x2+2.5x+4.5

1) Graphically2) Using the quadratic formula3) Using three iterations of the bisection

method to determine the highest root. Employ initial guesses of xl=5 and xu=1. Compute the estimated error and the true error after each iteration.

Page 3: Tutorial 2

1) A plot indicates that roots occur at about x = –1.4 and 6.4.

Page 4: Tutorial 2

Quadratic formula

Page 5: Tutorial 2

First iteration:

Page 6: Tutorial 2
Page 7: Tutorial 2

Third iteration

Page 8: Tutorial 2

Determine the real root of f(x)=-26+85x-91x2+44x3-8x4+x5

1) Graphically2) Using bisection to determine the root to εs=10%. Employ initial guesses of xl=0.5 and xu=1.0

3) Perform the same computation as in (2) but use the false-position method and εs=0.2%

Page 9: Tutorial 2

A plot indicates that a single real root occurs at about x = 0.58.

Page 10: Tutorial 2

Bisection:First iteration

Page 11: Tutorial 2

The process can be repeated until the approximate error falls below 10%. As summarized below, this occurs after 4 iterations yielding a root estimate of 0.59375.

Page 12: Tutorial 2

False position:First iteration:

Page 13: Tutorial 2

Second iteration:

Page 14: Tutorial 2

The process can be repeated until the approximate error falls below 0.2%. As summarized below, this occurs after 4 iterations yielding a root estimate of 0.57956.

Page 15: Tutorial 2

Determine the highest real root off(x)=2x3-11.7x2+17.7x-5

1) Graphically2) Newton-Raphson method (three iterations,

x0 =3)3) Secant method (three iterations, x-

1=3,x0=4)

Page 16: Tutorial 2

Graphical

Page 17: Tutorial 2

Newton-Raphson

Page 18: Tutorial 2

Secant

Page 19: Tutorial 2

Employ the Newton-Raphson method to determine a real root for f(x)=-2+6x-4x2+0.5x3

using initial guesses of 1) 4.522) 4.54

Discuss and use graphical and analytical methods to explain any peculiarities in your results

Page 20: Tutorial 2

The Newton-Raphson method can be set up as

Using an initial guess of 4.52, this formula jumps around and eventually converges on the root at 0.214333 after 21 iterations:

Page 21: Tutorial 2
Page 22: Tutorial 2

The reason for the behavior is depicted in the following plot. As can be seen, the guess of x = 4.52 corresponds to a near-zero negative slope of the function. Hence, the first iteration shoots to a large negative value that is far from a root.

Page 23: Tutorial 2

Using an initial guess of 4.54, this formula jumps around and eventually converges on the root at 6.305898 after 14 iterations:

Page 24: Tutorial 2
Page 25: Tutorial 2

The reason for the behavior is depicted in the following plot. As can be seen, the guess of x = 4.54 corresponds to a near-zero positive slope. Hence, the first iteration shoots to a large positive value that is far from a root.

Page 26: Tutorial 2

Thanks~