Ame302 Chapter3 Homework Set

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Instructor: Hacker Name:

Course: AME 302


Chapter 3 Homework Set
Solving Nonlinear Algebraic Equations
Instructions: Problems in this course are classified into three basic components:
Part 1: True-False concept questions.

Part 2: Basic-computational-skills (BCS) questions.

Part 3: Derivation, analysis, and problem-solving questions


This homework is broke into the first two components with the third part showing up in the
project questions. The rules for each component are listed below.
Part 1: There is no partial credit given for true-false problems. You do not need to show any work
for these problems. There are 10 problems worth 40% (4 points each). [online-component]

Part 2: There is no partial credit given for multiple-choice problems. Although there is no partial
credit on this assignment, you must show your work on all of the problems. If you fail to
show work you will receive a zero for the problem even if it is correct.
There are 15 problems worth 60% (4 points each) [online-component].

Part 1: Circle your answers here. Do not detach this sheet from the homework.

1. T F 6. T F

2. T F 7. T F

3. T F 8. T F

4. T F 9. T F

5. T F 10. T F

Part 2: Circle your answers here. Do not detach this sheet from the homework.
11. a b c d e 16. a b c d e 21. a b c d e

12. a b c d e 17. a b c d e 22. a b c d e

13. a b c d e 18. a b c d e 23. a b c d e

14. a b c d e 19. a b c d e 24. a b c d e

15. a b c d e 20. a b c d e 25. a b c d e


AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 2

Part 1: True-or-False Concept Questions Component

Problem 1. True or False: If an algorithm uses an open method, then the scheme may
use one or two initial conditions that need not bound the root.

Problem 2. True or False: In general, open methods are more accurate than bracketing
methods.

Problem 3. True or False: In general, provided a root exists in the bounding interval,
bracketing methods are guaranteed to converge.

Problem 4. True or False: The False Position method is a bracketing method.

Problem 5. True or False: The fixed-point method is a bracketing method.

Problem 6. True or False: The secant method is derived from newton’s method by
replacing the derivative with a forward difference.

Problem 7. True or False: Newton’s method needs two initial conditions.

Problem 8. True or False: Newton’s method diverges if for some n ∈ N, f 0 (xn ) ≈ 0.

Problem 9. True or False: For a continuous function f (x) on a closed interval [a, b],
with f (a) · f (b) < 0, the Newton-Raphson method (algorithm) is guaranteed to converge.

Problem 10. True or False: The False position method uses a tangent line to approx-
imate the next root and advance the iteration scheme.
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 3

Part 2: Basic Computational Skills Component

Problem 11 (Graphical Method). The graph of the function f (x) = sin(x) − x2 over
the interval [0, 1], where x is in radians, is shown below. From the graph it is clear that
the function has a root in the interval [0.5, 1]. If the bisection method is used to find the
root with the initial conditions for the bounding interval being xl = 0.5 and xu = 0.9,
then what will xr be after 3 iterations.

Figure 1: The nontrivial root clears lies in the interval [0.5, 0.9]. The root appears to be
somewhere between [0.8, 0.9], so to be safe we’ll use the interval [0.5, 0.9], since this is
our grid spacing.
(a) xr = 0.8 (b) xr = 0.85

(c) xr = 0.875 (d) xr = 0.8875


(e) None of these

Problem 12 (Bisection Method). For which pair, if any, of bracketing points {xl , xu }
will the bisection method converge to the root of the graph below?

(a) {−1, 1} (b) {−1, −0.5}


(c) {0.5, 1} (d) Does not satisfy the hypothesis of the bisection method
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 4

Problem 13 (Bisection Method). The function f (x) = 8 − 4.5(x − sin x) is known


to have a unique root in the interval [2, 3]. Use the Bisection Algorithm to fill in the
table below. In the table we use the abbreviations: fl ≡ f (xl ), fu ≡ f (xu ), fr ≡ f (xr ),
xr = (xl + xu )/2.
Pretest: fl · fu < 0 ⇒ ∃ a root in [xl , xu ].

i xl f (xl ) xu f (xu ) xr f (xr ) |a | sign(fl · fr )


0 2.0000 3.0918 3.0000 -4.8650 N/A N/A N/A −
1 2.0000 3.0918 3.0000 -4.8650 2.5000 -0.5569 N/A −
2
3
4

Figure 2: Graph of 8 − 4.5(x − sin x) over the interval [2, 3].

For i = 4 we have
(a) xr = 2.4375 and a = 2.5641 (b) xr = 2.3750 and a = 2.5641

(c) xr = 2.4375 and a = 5.2632 (d) xr = 2.3750 and a = 5.2632


(e) None of these
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 5

Problem 14 (Using MATLAB prewritten code). The velocity of a smooth cannon


ball released from rest from a hovering helicopter is given by
r r 
mg gcd
v(t) = tanh t ,
cd m

where m is the mass of the ball, g = 9.8 m/s2 is the acceleration due to gravity, and cd
is the drag coefficient. Here we’ve assume a large Reynolds number. Write a script that
calls the function bisect.m to determine the drag coefficient cd needed so that an 20-kg
cannon ball has a velocity of 20 m/s after 5 s of free fall. For definiteness, write your
function f in the form:
r r 
mg gcd
f (cd ) = tanh t −v.
cd m

If you take xl = 0.3, xu = 0.5, and maxit = 100, then how many iterations does it take
to satisfy the criteria s = 0.0001%?
(a) 8 (b) 13
(c) 19 (d) 24
(e) None of these
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 6

Problem 15 (Using MATLAB prewritten code). Consider the situation shown in


the figure below. Water is being discharged from a cylindrical tank through a long pipe.

Using techniques from fluid mechanics it can be shown that the velocity of water, v (m/s),
can be computed as √ 
p 2gH
v = 2gH tanh t ,
2L
where g = 9.81 m/s2 , H = initial head (m), L = pipe length (m), and t = elapsed time
(s). Use this equation to determine the initial head H needed to achieve an exit velocity
v = 5 m/s in 2.5 s for a 4-m long pipe by converting the equation into a roots problem
of the form: √ 
p 2gH
f (H) = 2gH tanh t − v = 0.
2L
Develop a MATLAB script that uses the bisection program bisect.m together with the
initial bracketing guesses: xl = 0 and xu = 4 m. Use the stopping criterion s = 0.1%.
Round your answer to 6 decimal places. Your code should run for 12 iterations.
(a) H = 1.4643 m (b) H = 1.4649 m

(c) H = 1.4652 m (d) H = 1.4658 m


(e) None of these
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 7

Problem 16 (False-Position Method). Use the M-file false position.m given below
for the false
√ position method to determine the positive nonzero root of the function
f (x) = sin( x) − x. Start with initial guesses of xl = 0.5 and xu = 1.0 and iterate until
the approximate relative error falls below 0.01%. If the scheme converges, then round
the answer to six decimal places.


Figure 3: Graph of y = sin( x) − x over the interval [0, 1].

(a) 0.768627 (b) 0.768659

(c) 0.768648 (d) scheme not converging


(e) None of these
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 8

1 f u n c t i o n [ r o o t , ea , i t e r ]= f a l s e p o s ( func , xl , xu , es , maxit , v a r a r g i n )
2 % falsepos : root location zeroes
3 % [ r o o t , ea , i t e r ]= f a l s e p o s ( func , xl , xu , es , maxit , p1 , p2 , . . . ) :
4 % uses f a l s e p o s i t i o n to f i n d the root of func
5 % input :
6 % f u n c = name o f f u n c t i o n
7 % xl , xu = l o w e r and upper g u e s s e s
8 % e s = d e s i r e d r e l a t i v e e r r o r ( d e f a u l t = 0.0001%)
9 % maxit = maximum a l l o w a b l e i t e r a t i o n s ( d e f a u l t = 5 0 )
10 % p1 , p2 , . . . = a d d i t i o n a l p a r a m e t e r s used by f u n c t i o n
11 % output :
12 % root = real root
13 % ea = approximate r e l a t i v e e r r o r (%)
14 % i t e r = number o f i t e r a t i o n s
15 %% i n p u t v a l i d a t i o n
16 i f n a r g i n <3, e r r o r ( ' a t l e a s t 3 i n p u t arguments r e q u i r e d ' ) , end
17 t e s t = f u n c ( xl , v a r a r g i n { : } ) * f u n c ( xu , v a r a r g i n { : } ) ;
18 i f t e s t >0, e r r o r ( ' no s i g n change ' ) , end
19 i f n a r g i n <4| es <=0, e s = 0 . 0 0 0 1 ; end
20 i f n a r g i n <5| maxit <=0, maxit =50; end
21 %% w h i l e l o o p i t e r a t i o n
22 i t e r = 0 ; xr = x l ;
23 while (1)
24 x r o l d = xr ;
25 f l =f u n c ( xl , v a r a r g i n { : } ) ;
26 f u=f u n c ( xu , v a r a r g i n { : } ) ;
27 xr = xu − f u * ( x l − xu ) / ( f l − f u ) ;
28 iter = iter + 1;
29 i f xr ˜= 0 , ea = abs ( ( xr − x r o l d ) / xr ) * 1 0 0 ; end
30 t e s t = f l * f u n c ( xr , v a r a r g i n { : } ) ;
31 i f test < 0
32 xu = xr ;
33 e l s e i f test > 0
34 x l = xr ;
35 else
36 ea = 0 ;
37 end
38 i f ea <= e s | i t e r >= maxit , break , end
39 end
40 r o o t = xr ;
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 9

Problem 17 (Fixed-point method). Consider the equation e−x − x ln x − x = 0 over


the interval [0, 1]. It has a root around 0.725. Convert the equation from the form
f (x) = 0 to the form x = g(x) and use the standard fixed-point iteration method of the
form xn+1 = g(xn ) with the initial condition x0 = 1 to find the approximation x3 for the
root of the equation.
Note: Since |g 0 (xT S )| > 1, the scheme (locally) diverges away from the location of the
root xT S ≈ 0.725.
(a) 1.0601 (b) 0.2846
(c) 1.1100 (d) 0.7203
(e) None of these

Figure 4: Graph of y = e−x − x ln x − x over the interval [0, 1].


AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 10

Problem 18 (Fixed-point method). .


Fact: The fixed-point iteration theorem states that the sequence generated from xn+1 =
g(xn )
(i) converges if |g 0 (xT S )| < 1 for x0 sufficiently close to xT S , and

(ii) (locally) diverges away from the location of the root xT S if |g 0 (xT S )| > 1.
Consider the equation cos x = sin x over the interval [0, π/2] that has an exact root (true
solution) xT S = π/4. Convert the equation from the form f (x) = 0 to the form x = g(x)
and use the standard fixed-point iteration method of the form xn+1 = g(xn ) with the
initial condition x0 = 0 to find the approximation x3 for the root of the equation. Make
sure to rewrite the equation in a form where |g 0 (xT S )| < 1, so that the iterations converge.
Round your answer to four significant digits.
Comment: For example, if the equation is recast in the form x = tan x − 1 + x = g(x),
then |g 0 (xT S )| = sec2 (π/4) + 1 = 3 > 1, and the scheme will not converge.
(a) 0.6988 (b) 0.8211
(c) 0.7706 (d) no g exists with |g 0 (xT S )| < 1
(e) None of these

Problem 19 (Newton-Raphson method). Find the third iterate, x3 , in the Newton-


Raphson algorithm for the equation f (x) = tan x − 1 = 0 over the interval [0, π/2]. Take
the initial condition x0 = 1. If the scheme is converging to the root, round your answer
to four significant digits. Otherwise choose “iteration sequence locally diverging from
root”.
(a) 0.7852 (b) 0.7848
(c) 0.7854 (d) iteration sequence locally diverging from root
(e) None of these
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 11

Problem 20 (Newton-Raphson method). Use the Newton-Raphson method to find


the root of
f (x) = e−x (4 − x) − 2 ,
with initial guess x0 = 6. If the method converges determine the root to four decimal
places.
(a) 0.8817 (b) 0.8857
(c) 0.8897 (d) method fails to converge for this initial condition
(e) None of these

Problem 21 (Secant method). Use the Secant method to find the root of f (x) = xe−x
with the initial guesses x0 = 0.3 and x1 = 0.4. Use three iterations. If the scheme is
converging to the root, round your answer to four significant digits. Otherwise choose
“iteration sequence not converging”.
(a) - 0.1844 (b) 0.08012
(c) 0.01396 (d) iteration sequence not converging
(e) None of these

Problem 22 (MATLAB’s built-in function fzero). .


Consider the function f (x) = 1 + 2x − 10 sin x. Use MATLAB’s built in function fzero
to find all of the zeros x1 , x2 , . . . xn , to at least 10 decimal places. Then sum the zeros
using the following algorithm:
Step 1: Graph the function in MATLAB. Use the graph to determine how many zeros the
function has and to find your initial guess for MATLAB’s built-in function fzero.

Step 2: Compute the sum of the roots: x1 + x2 + · · · + xn (do not round yet!).

Step 3: Round the sum to 6 decimal place accuracy.


You should do all of this in MATLAB! The sum of the roots is
(a) -0.064654 (b) -0.064660
(c) -0.064662 (d) -0.064672
(e) None of these
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 12

Problem 23 (Newton’s method for nonlinear systems). .

Determine the roots of the simultaneous nonlinear equations

(x − 4)2 + (y − 4)2 = 5
x2 + y 2 = 16

Observe that the equations are two circles. A graphical approach reveals that one of the
roots is near the point (1.8, 3.6). For computational simplicity, take as your initial guess
(x0 , y0 ) = (2, 4), and compute one iteration (x1 , y1 ) using Newton’s method for nonlinear
systems.
(a) (x1 , y1 ) = (1.8, 3.625) (b) (x1 , y1 ) = (1.8, 3.6)
(c) (x1 , y1 ) = (1.7, 3.6) (d) (x1 , y1 ) = (1.75, 3.625)
(e) None of these
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 13

Problem 24. Use Newton’s method to determine an approximation to the point of


intersection of the curves:
( x
f1 (x, y) = y − cosh =0 (catenary curve)
2
f2 (x, y) = 9x2 + 25y 2 − 225 = 0 (ellipse)

that resides in the first quadrant of the xy-plane. Take the initial guess to be xT0 =
[x0 , y0 ] = [2.5, 2.0]. Compute the first iteration to two decimal place accuracy.

(a) (x1 , y1 ) = (3.13, 2.38) (b) (x1 , y1 ) = (3.14, 2.40)


(c) (x1 , y1 ) = (3.15, 2.45) (d) (x1 , y1 ) = (3.16, 2.49)
(e) None of these
Relevant formulas:
d d
sinh(ax) = a cosh(ax) and cosh(ax) = a sinh(ax) .
dx dx
The Jacobian is given by
∂f1 ∂f1
∂x ∂y ∂f1 ∂f2 ∂f1 ∂f2
J(f1 , f2 ) = = −
∂f2 ∂f2 ∂x ∂y ∂y ∂x
∂x ∂y
The iteration formula is
∂f2 ∂f1
f1 (xi , yi ) (xi , yi ) − f2 (xi , yi ) (xi , yi )
∂y ∂y
xi+1 = xi −
∂f1 ∂f2 ∂f1 ∂f2
(xi , yi ) (xi , yi ) − (xi , yi ) (xi , yi )
∂x ∂y ∂y ∂x
∂f1 ∂f2
f2 (xi , yi ) (xi , yi ) − f1 (xi , yi ) (xi , yi )
yi+1 = yi − ∂x ∂x
∂f1 ∂f2 ∂f1 ∂f2
(xi , yi ) (xi , yi ) − (xi , yi ) (xi , yi )
∂x ∂y ∂y ∂x
AME 302 chapter 3 hw set Copyright ©Wayne Hacker 2018. All rights reserved. 14

Problem 25 (MATLAB’s built-in function fsolve). .


Use MATLAB’s built-in function fsolve to determine the roots of the simultaneous
nonlinear equations:

(x − 4)2 + (y − 4)2 = 5
x2 + y 2 = 16

A graphical approach reveals that one of the roots is near the point (1.8, 3.6). Determine
the root to four decimal place accuracy.
(a) (x1 , y1 ) = (1.8058, 3.5692) (b) (x1 , y1 ) = (1.8042, 3.5708)
(c) (x1 , y1 ) = (1.8041, 3.5708) (d) (x1 , y1 ) = (1.8058, 3.5708)
(e) None of these

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy