6.2

We need to determine the highest real root of:

f(x) = 2x^3 – 11.7x^2 + 17.7x – 5

a. Graphically:

root = 3.5632

For the modified secant method, use 8 = 0.01. Plot the graphs for the approximate% relative error for different roots. Each graph should have 5 error curves, one for each method. (b) f(x) = x + 10 - xcosh(50/x) For this function, plot the% approximate relative error for each method similar to the part (a). Use 8 = 0.01 for modified secant method. Develop an M-file for the modified secant method. Along with the initial guess and the perturbation fraction, pass the function as an argument. Test it by solving Prob. Advantages of secant method: 1. It converges at faster than a linear rate, so that it is more rapidly convergent than the bisection method. It does not require use of the derivative of the function, something that is not available in a number of applications. It requires only one function evaluation per iteration.

b. Three fixed point method iterations where x_0 = 3

Convergent than the bisection method. It does not require use of the derivative of the function, something that is not available in a number of applications. It requires only one function evaluation per iteration, as compared with Newton’s method which requires two. Disadvantages of secant method: 1. It may not converge. The SEC function in Excel calculates and returns the secant of a given radians. The Secant is the reciprocal of Cosine. SEC (θ) = Hypotenuse / Adjacent = c/b Secant of the angle θ, is the ratio of the hypotenuse side – c, to the adjacent side – b.

x(0)= (5 + 11.7x^2 – 2x^3)/17.7

x(1) = 3.18079

Ea = 5.68381%

x(2) = 3.33396

Ea = 4.59424

x(3) = 3.44254

Ea = 3.15407

c. Three Newton Raphson method iterations where x_0 = 3

Newton Raphson formula = x(i+1) = x(i) – f(x(i))/f'(xi)

f(x) = 2x^3 – 11.7x^2 + 17.7x – 5

f'(x) = 17.7-23.4 x+6 x^2

new x =

x(0) =3

x(1) = 5.13333

Ea = 41.5584%

x(2) = 4.26975

Ea = 20.2255%

x(3)= 3.79293

Ea = 12.5713%

d. Secant Method formula: where z = x(i-1), x = x(i), and xnew = x(i+1)

xnew = x – (f(x)(z-x))/(f(z)-f(x))

f(x) = (2x^3 – 11.7x^2 + 17.7x – 5)

x(-1) = 3

x(0) = 4

x(1) = 3.32653

Ea= 20.2454%

x(2) = 3.48127

Ea = 4.44493%

x(3) = 3.58628

Ea = 2.9281%

e. Modified Secant Method with x_0 = 3, and o = .01

x(0) = 2

x(1) = 4.8926

Ea = 59.1219%

x(2) = 4.14295

Ea = 18.0946%

x(3) = 3.74232

Ea = 10.7054%

6.5:

We need to use the Newton Raphson Method to solve the function with two separate starting points.

f(x) = -2+6x -4x^2 +.5x^3

f'(x) =6-8 x+1.5 x^2

xnew = x -(-2+6x -4x^2 +.5x^3)/(6-8 x+1.5 x^2)

a.

x0 = 4.2

x1: -4.84912

x2: -2.57392

x3:-1.13753

x4: -0.272741

x5: 0.202829

b.

x0 = 4.43

x1 = -3939.13

x2 = -2625.2

x3 = -1749.25

x4 = -1165.28

x5 = -775.966

In the latter case, the function line is curving at such a fast rate the tangent is skewed.

6. 15

In this problem, we need to determine the roots of of two simultaneous nonlinear equations using fixed point iteration and the Newton – Raphson Method

a. fixed point

Real roots are x = 1.37207, y =0.239502, x = -0.186792, y= 0.528317, x = 0.528317, y = -0.585274

y = -x^2 + x +.75

y +5xy =x^2

new x = sqrt(x-y+.75)

new y = (x^2 – y)/5x

initial x and initial y = 1.2

x1 = 0.866025

y1 = -0.103923

x2 = 1.31147

y2 = 0.278142

x3 = 1.33541

y3 = 0.225426

x4 = 1.36381

y4 = 0.239704

b.

u = (x^2 + x + .75 – y)

v = (x^2 – 5xy – y)

du/dx = (1+2 x)

du/dy = (-1)

### Python Function For Modified Secant Method Formula

dv/dx = (2 x-5 y)

dv/dy = (-1-5 x)

Newton Raphson formula:

x new = x – (u*dvdy – v *dudy)/(dudx*dvdy – dudy*dvdx)

y new = y – (v*dudx – u*dvdx)/(dudx*dvdy – dudy*dvdx)

x new =

y new =

x0, y0 = 1.2, 1.2

x1 ,y1 = 0.386496, 0.624088

x2 ,y2 = -0.0933718, 0.435073

x3 ,y3 =-0.217136, 0.564695

**6.18**

### Secant Equation

In this problem, we have to use the modified secant method to solve for (dc/dt)

V(dc/dt) = W – Qc – kVsqrt(c)

(dc/dt) =(W – Qc – kVsqrt(c))/V

(dc/dt) = f(c) = (1.-0.25*sqrt(c)-0.1*c)

f(c+o*c) = (1.-0.25*sqrt(c+o*c)-0.1*(c+o*c))

new c = c – (o*c*f(c))/(f(c+o*c)-f(c))

new c = c – (o*c*(1.-0.25*sqrt(c)-0.1*c))/((1.-0.25*sqrt(c+o*c)-0.1*(c+o*c))- (1.-0.25*sqrt(c)-0.1*c))

initial values c = 4 and o = .5

true root = 4.62408

c(1) = 4.64026

Error(t) = -0.35%

c(2) = 4.62345

Error(t) = 0.01%

c(3) = 4.62411

Error(t) = -0.0006%

**6.28**

We need to apply Newton-Raphson to this function with an initial guess of 16.15

The real root between 15 and 20 is 18.8948

Newton-Raphson is new x = x – f(x)/f'(x)

f'(x) = 0.0296*x^3 -0.852*x^2 +6.71*x -12.183

new x =

initial x = 16.15

x(1) = 9.0771

x(2) = -4.02094

x(3) = -0.280374

The algorithm is not approaching the desired root, rather it is moving towards the root farthest away.

**6.31:**

We need to use fixed point iteration to solve this equation for H.

Q = (sqrt(S)*(B*H)^(5/3))/(n*(B+2*H)^(2/3))

Q = 5, S = .0002, B = 20, n =0.03

This can be rearranged so that H = B * ((Q*n*(B+2H)^(2/3))/(sqrt(S)))^(3/5)

H(0) = 0

H(1) = 273.394

It is already moving away from the true root.

H = (sqrt(S)*(B*H)^(5/3))/(n*(B+2*H)^(2/3)) -Q + H

H(0) = 0

H(1) = -5

this is a failure as well

H = (((sqrt(S)*(B*H)^(5/3)/(Q*n) )^(3/2) -B)/(2)

H = 1/2 (-20+51.7858 (H^(5/3))^(3/2))

I keep getting back to negative numbers which result in negative numbers.