You are on page 1of 1

   Ishimwe Uwantare

ENGR 391 - Numerical Methods in Engineering (Fall 2020)


Dashboard / My courses / ENGR 391 (Fall 2020) / Assessments / Assignment 2 - Nonlinear Equations

Started on Monday, 28 September 2020, 11:30 AM Quiz navigation


State Finished
Completed on Monday, 28 September 2020, 7:05 PM Terms and conditions
1
Time taken 7 hours 35 mins
Grade 13.17 out of 20.00 (66%)
Feedback
Make sure to understand well where you did mistakes and review the corresponding lecture topics. Knowledge check - nonlinear
Be careful not to fall behind by postponing the review of the topics. equations
2 3 4 5 6 7 8 9 10

Question 1 By checking the "yes" answer below I confirm 11


Complete
1. that I have neither given nor received unauthorized aid to answer the questions of this
Not graded assignment.
Flag question 2. I agree to follow the rules in regard of online assignments as posted in the course outline Problems
3. I used only octave or Matlab to solve the questions (I am allowed to consult all course material 12 13 14 15 16 17
and my own notes)
Show one page at a time
Select one:
Finish review
a. Yes I agree

b. No I do not agree

Your answer is correct.


The correct answer is: Yes I agree

Question 2 You are using the bisection method to solve an equation with an initial guess a0 = −2.0 and
Incorrect b0 = 0.5 .

Mark 0.00 out of It is required to find the approximation of the root with an absolute error less than 0.1
1.00
How many iteration do you have to do at least in order to reach the set precision?
Flag question

Answer: 5 

You need at least three iterations.

Indeed the initial error is about .


0.5+2.0
= 1.25
2

After one iteration the error will be 1.25

2
which is larger than 0.1.

After two iterations the error will be which is larger than 0.1.
1.25

2
2

After three iterations the error will be which is larger than 0.1.
1.25
3
2

After four iterations you have an error of which is less than 0.1.
1.25
4
2

Alternatively you can use the formula of the lecture:


log(0.5+2)−log 0.1
n ≥ − 1 ≃ 3.6
log 2

Again we find that at least 4 iterations will be needed.


Reference: lecture on bisection method (error control) in Lesson 2 "Solving nonlinear equations"

The correct answer is: 4

Question 3 We solve the equation x3 + 4x


2
− 10 = 0 using the false-position method.
Correct
If a0 = 1 and b0 = 2 then a1 and b1 are?
Mark 1.00 out of
1.00
Select one:
Flag question
a. a1 = 1.263 and b1 = 2 
b. a1 = 1.5 and b1 = 2

c. a1 = 1 and b1 = 1.5

d. a1 = 1 and b1 = 1.263

Your answer is correct.


Reference: lecture on false position in Lesson 2 "Solving nonlinear equations"

The correct answer is: a1 = 1.263 and b1 = 2

Question 4 Solve the equation x3 + 4x


2
− 10 = 0 using the bisection algorithm starting with a0 = 1 and
Incorrect b0 = 2.0 .

Mark 0.00 out of Conduct three iterations (i.e. find x3 ) and report the approximation x3 of the root computed by the
1.00
algorithm.
Flag question
Use as many digits as possible.

Answer: 1.679273065 

First iteration: a1 = 1 and b1 = 1.5

Second iteration: a2 = 1.25 and b2 = 1.5

Third iteration: a3 = 1.25 and b3 = 1.375

Algorithm estimates the root in the third iteration as x3


1.125+1.375
= = 1.3125
2

Reference: lecture on bisection method in lesson 2 "Solving nonlinear equations"


The correct answer is: 1.3125

Question 5 We want to apply the fixed point method to solve the equation x = g(x) .
Partially correct
Choose among the following examples of functions g(x) which will lead to a converging fixed point
Mark 0.50 out of algorithm when using the intial guess x0 specified.
1.00

Flag question
Select one or more:
a. g(x) = x
2
− 3x cos x and x0 = 1

b. g(x) =
2
and x0 = 1 
√x

c. g(x) = sin x + e
x
+ x − 4 and x0 = 0.5

d. g(x) = e
x
− 7 and x0 = −2

e. g(x) = sin x + e
x
and x0 = 0.5

Your answer is partially correct.


You have correctly selected 1.
To decide which function g(x) leads to a converging algorithm you need to try out some iterations
and observe the convergence plot.

Reference: lecture on fixed point method in Lesson 2 "Solving nonlinear equations".


The correct answers are: g(x) = e
x
− 7 and x0 ,
= −2 g(x) =
2
and x0 = 1
√x

Question 6 The root r = 0 of the equation ex − x − 1 has a multiplicity of


Correct

Mark 1.00 out of


Answer: 2 
1.00

Flag question

Indeed r = 0 is a root as er − r − 1 = 0 .
Define f (x) = e
x
− x − 1 .
Then f ′ (x) = e
x
− 1 .
As f ′ (r) = 0 the root is at least a double root.

Further f " (x) = e


x
and f " (r) ≠ 0 . Consequently the root is a double root.

Reference: lecture on challenging problems in Lesson 2 "Solving nonlinear equations"


The correct answer is: 2

Question 7 Consider the function f (x) = 3


−x
− x . We apply Newton's method to find a root of this function.
Correct
If x2 = 0.5 then the value of x3 is given as
Mark 1.00 out of
1.00
Select one:
Flag question
a. -0.4554

b. 0.3748

c. 0.5473 

d. 0.5965

Your answer is correct.


Reference: lecture on Newton's method in Lesson 2 "Solving nonlinear equations"
The correct answer is: 0.5473

Question 8 You are implementing on a computer a numerical algorithm to solve an equation of the form
Correct f (x) = 0.

Mark 1.00 out of In order to check your algorithm you decide to test it with the function f (x) .
= sin(x) − x
1.00

Flag question Select one:


a. This is a valid choice for the function f (x) to test the programmed algorithm

b. This is not a good choice for the function f (x) to test the programmed algorithm 

Your answer is correct.


The function f (x) = sin(x) − x is flat around the root r = 0 as it is a root of multiplicity 3.
Any numerical algorithm will face problems to find this root accurately. Some of them may even
behave differently compared to what they should (see the examples with Newton's algorithm
covered in class where a root finding problem with multiple roots becomes problematic).

It is not a good idea to check an implementation of an algorithm with a challenging problem.


Reference: lecture on challenging problems in Lesson 2 "Solving nonlinear equations"
The correct answer is: This is not a good choice for the function f(x) to test the programmed
algorithm

Question 9
Find the absolute backward and forward error for the following functions, where the true root is \
Partially correct
(r=0.5\) and the approximated root is \(x_r=0.48\).
Mark 0.67 out of
1.00 Fill out the following table to answer the question (use as many digits as possible)

Flag question
\(f(x)\) Backward error Forward error

\(f(x)=2x-1\) -0.04  0.02 

\(f(x)=(2x-1)^2\) 0.0016  0.02 

\(f(x)=(2x-1)^3\) -0.000064  0.02 

The absolute forward error is for all cases \(|r-x_r|=0.02\).


The absolute backward error is different for each case and is computed as \(|f(x_r)|\).
The important element to understand here: even with a same forward error, one can have different
backward errors.

This problem illustrates once more that computing the backward error doesn't tell us anything
about the forward error.
Reference: lecture on forward and backward errors in Lesson 2 "Solving nonlinear equations"

Question 10 You have to solve an equation \(f(x)=0\) with a precision below a relative error of \(10^{-5}\).
Correct
If \(\left|\frac{f(x_r)}{x_r}\right|<10^{-5}\) then
Mark 1.00 out of
1.00
Select one:
Flag question
a. you can't conclude anything 

b. you have found an approximation \(x_r\) to the specified precision

c. you have found an approximation \(x_r\) to the specified precision as long as \(x_r \neq 0\)

d. you have found an approximation \(x_r\) to the specified precision if \(x_r\) is not a multiple
root

Your answer is correct.

The quantity \(|f(x_r)|\), which is the backward error, doesn't tell you anything about \(|r-x_r|\) which
is the absolute error.
Similarly \(\left|\frac{f(x_r)}{x_r}\right| \) doesn't tell you anything about \( \left| \frac{r-x_r}{x_r}
\right|\) which is the relative error you want to have below the specified tolerance.
Reference: lecture on backward and forward errors in Lesson 2 "Solving nonlinear equations".
The correct answer is: you can't conclude anything

Question 11 The equation \(x^3-4x^2-11x+30=0\) has a solution in \(r=2\).


Correct
You are using Newton's method to estimate this solution. If the absolute error in iteration 4 is about
Mark 1.00 out of 0.04, how large do you expect to be the absolute error in iteration 5 ?
1.00

Flag question Select one:


a. 0.0002 

b. 0.005

c. 0.03

d. We can not predict this error with the information given

Your answer is correct.


Newton's method convergences quadraticaly. The asymptotic error constant \(\lambda\) is given by
\(\left| \frac{f"(r)}{2f'(r)} \right|\).
This is \( \lambda=\left| \frac{6r-8}{3r^2-8r-11} \right| \simeq 0.13 \).

Consequently \( E_5 \simeq \lambda E_4^2 \simeq 0.13 \cdot 0.04^2 \simeq 0.002 \)
Reference: Lecture on order of convergence form Lesson 2 "Nonlinear equations"
The correct answer is: 0.0002

Question 12 Consider the following function:


Correct
\(f(x) = 2+\cos(e^x-2)-e^x\).
Mark 2.00 out of
2.00 Use Newton's algorithm with \(x_o=0.5\) and perform four iterations to compute \(x_4\). Use 16
digits in your calculations.
Flag question
We use \(x_4\) as the approximation of the root \(r\) of \(f(x)\)

How much is the backward error (give the answer with one significant digit) ? 0.2 

Estimate the multiplicity of the root : 1 

Estimate the absolute error \(|r-x_4|\) of \(x_4\) to one significant digit : 0.04 

How many correct significant digits contains \(x_4\) if used to estimate the root of \(f\)? 2

To apply Newton's algorithm you need to compute the first derivative of \(f\):
\(f'(x)=e^x (-\sin (e^x - 2) - 1)\)
Iterating Newton's algorithm gives:
\(x_o=0.5\)
\(x_1=1.693096115738836\)
\(x_2=0.5541812360355938\)
\(x_3=1.501688006679172\)
\(x_4=1.046498587535354\)
The backward error is given by \(|f(x_4)|\).
A plot of \(y=f(x)\) shows that the root near \(x_4\) is of multiplicity \(m=1\).
To estimate the error of \(x_4\) one uses: \( |r-x_4| \simeq \left| \frac{ f(x_4)}{f'(x_4)} \right| \)
Based on the estimation of \( |r-x_4| \) one can immediately see how many digits in \(x_4\) are
correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"

Question 13 Consider the following equation:


Incorrect
\(x^2-2xe^{-x}+e^{-2x} = 0\).
Mark 0.00 out of
2.00 A numerical algorithm produced the following approximation of a root \(r\) of this equation

Flag question \(x_r=0.567143470743\).

How much is the backward error (give the answer with one significant digit) ? 0 

Estimate the multiplicity of the root the algorithm is trying to approximate : 1 

Estimate the absolute error \(|r-x_r|\) of \(x_r\) to one significant digit : 0 

How many correct significant digits contains \(x_r\) ? 1 

Define \(f(x)=x^2-2xe^{-x}+e^{-2x}\).
The backward error is given by \(|f(x_r)|\).

A plot of \(y=f(x)\) shows that the root near \(x_r\) is of multiplicity \(m>1\) and must be of even
multiplicity.
Computing \(f'(x_r)\), \(f^{(2)}(x_r)\) and \(f^{(3)}(x_r)\) allows to conclude that the multiplicity is \
(m=2\)
To estimate the error of \(x_r\) one uses: \( |r-x_r| \simeq \left| \frac{m! \cdot f(x_r)}{f^{(m)}(x_r)}
\right| ^ {1/m} \) with \(m=2\)
Based on the estimation of \( |r-x_r| \) one can immediately see how many digits in \(x_r\) are correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"

Question 14 Consider the equation \( 2x\cos(2x)-(x-2)^2 = 0\).


Incorrect
Find an approximation of it's root in \([2,3]\) to an absolute error less than \(10^{-10}\) with one of
Mark 0.00 out of
the methods covered in class.
1.00

Flag question
Answer: 2.370686918 

Regardless on which technique you use and which initial guess, you need to perform enough
iterations until reaching the asked precision.
For this you need in each iteration to estimate your error and check if it falls or not below the target
precision.
It is recommended to go a few iterations more to double check and ideally try with more than one
method to verify the answer

Example calculation (Using Newton algorithm)

First we note based on a plot of \(y=f(x)\) that the root is of multiplicity \(m=1\) (needed to know in
order to estimate correctly the error).
The plot allows us as well to choose an initial guess to start the algorithm
\(x_o=2\)
\(x_1=2.550769198432895\)

\(x_2=2.371358512514945\)
\(x_3=2.370687056826609\)
\(x_4=2.370686917662268\)
We see that in iteration 4 we have an estimated absolute error of
\( |r-x_r| \simeq \left| \frac{f(x_4)}{f'(x_4)} \right| \simeq 6 \cdot 10^{-15} \)
Consequently \(x_4\) is an approximation to the root with an absolute error less than \(10^{-10}\).

The correct answer is: 2.3706869176623

Question 15 Consider the equation \( 3x^2-e^x = 0\).


Incorrect
Find an approximation of it's root in \([3,5]\) to an absolute error less than \(10^{-12}\) with one of
Mark 0.00 out of the methods covered in class.
1.00

Flag question
Answer: 3.733079029 

Regardless on which technique you use and which initial guess, you need to perform enough
iterations until reaching the asked precision.
For this you need in each iteration to estimate your error and check if it falls or not below the target
precision.

It is recommended to go a few iterations more to double check and ideally try with more than one
method to verify the answer

Example calculation (Using Newton algorithm)


First we note based on a plot of \(y=f(x)\) that the root is of multiplicity \(m=1\) (needed to know in
order to estimate correctly the error).

The plot allows us as well to choose an initial guess to start the algorithm
\(x_o=4\)
\(x_1=3.784361145167370\)
\(x_2=3.735379375079544\)

\(x_3=3.733083897874097\)
\(x_4=3.733079028654685\)
\(x_5=3.733079028632814\)
We see that in iteration 5 we have an estimated absolute error of

\( |r-x_r| \simeq \left| \frac{f(x_5)}{f'(x_5)} \right| \simeq 4 \cdot 10^{-16} \)


Consequently \(x_5\) is an approximation to the root with an absolute error less than \(10^{-12}\).

The correct answer is: 3.7330790286328

Question 16 Consider the following equation:


Correct
\(2+\cos(e^x-2)-e^x=0\).
Mark 2.00 out of
2.00 A numerical algorithm produced the following approximation of a root \(r\) of this equation

Flag question \(x_r=1.00767372\).

How much is the backward error (give the answer with one significant digit) ? 0.0002 

Estimate the multiplicity of the root the algorithm is trying to approximate : 1 

Estimate the absolute error \(|r-x_r|\) of \(x_r\) to one significant digit : 0.00005 

How many correct significant digits contains \(x_r\) ? 5 

Define \(f(x)=2+\cos(e^x-2)-e^x\).
The backward error is given by \(|f(x_r)|\).
A plot of \(y=f(x)\) shows that the root near \(x_r\) is of multiplicity \(m=1\).
To estimate the error of \(x_r\) one uses: \( |r-x_r| \simeq \left| \frac{m! \cdot f(x_r)}{f^{(m)}(x_r)}
\right| ^ {1/m} \) with \(m=1\)
Based on the estimation of \( |r-x_r| \) one can immediately see how many digits in \(x_r\) are correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"

Question 17 Consider the following equation:


This study source was downloaded by 100000834826368 from CourseHero.com on 11-08-2023 16:00:25 GMT -06:00

Correct
\((x-2)^2-\ln x = 0\).
https://www.coursehero.com/file/117424965/Assignment-2-Nonlinear-Equations-Attempt-reviewpdf/

Mark 2.00 out of


2.00 A numerical algorithm produced the following approximation of a root \(r\) of this equation

Flag question \(x_r=3.057107083749\).

How much is the backward error (give the answer with one significant digit) ? 0.000006 

Estimate the multiplicity of the root the algorithm is trying to approximate : 1 

Estimate the absolute error \(|r-x_r|\) of \(x_r\) to one significant digit : 0.000004 

How many correct significant digits contains \(x_r\) ? 6 

Define \(f(x)=(x-2)^2-\ln x\).


The backward error is given by \(|f(x_r)|\).
A plot of \(y=f(x)\) shows that the root near \(x_r\) is of multiplicity \(m=1\).
To estimate the error of \(x_r\) one uses: \( |r-x_r| \simeq \left| \frac{m! \cdot f(x_r)}{f^{(m)}(x_r)}
\right| ^ {1/m} \) with \(m=1\)

Based on the estimation of \( |r-x_r| \) one can immediately see how many digits in \(x_r\) are correct.
Reference: lectures on backward/forward errors and challenging problems of Lesson 2 "Solving
nonlinear equations"

Finish review

◄ Assignment 1 - Introduction
Jump to... Assignment 3 - Linear Equations ►
(Not for grade)

You are logged in as Ishimwe Uwantare (Log out)


ENGR 391 (Fall 2020)
Data retention summary
Get the mobile app

Powered by TCPDF (www.tcpdf.org)

You might also like