assignment-2-nonlinear-equations-attempt-review
pdf
keyboard_arrow_up
School
Concordia University *
*We aren’t endorsed by this school
Course
391
Subject
English
Date
Apr 3, 2024
Type
Pages
9
Uploaded by SuperCrocodileMaster1006
Assignment 2 - Nonlinear Equations Attempt review
Numerical Methods in Engineering (Concordia University)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Assignment 2 - Nonlinear Equations Attempt review
Numerical Methods in Engineering (Concordia University)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
1/8
Dashboard
/
My courses
/ ENGR 391 (Winter 2021)
/ Assignments
/ Assignment 2 - Nonlinear Equations
Question 1
Complete
Not graded
Question 2
Correct
Mark 1.00 out of
1.00
Started on
Tuesday, 26 January 2021, 6:25 PM
State
Finished
Completed on
Tuesday, 2 February 2021, 12:00 AM
Time taken
6 days 5 hours
Grade
15.67
out of 20.00 (
78
%)
Feedback
Well done. However make sure to understand well where you did mistakes and review the corresponding lecture topics. By checking the "yes" answer below I confirm 1. that I have neither given nor received unauthorized aid to answer the questions of this assignment. 2. I agree to follow the rules in regard of online assignments as posted in the course outline 3. I used only octave or Matlab to solve the questions (I am allowed to consult all course material and my own notes) Select one:
a. Yes I agree
b. No I do not agree
Your answer is correct.
The correct answer is: Yes I agree
Consider the function . We apply Newton's method to find a root of this function.
If then the value of is given as Select one:
a. 7/3
b. 11/4
c. 10/3
d. 5/2
Your answer is correct.
Reference: lecture on Newton's method in topic 2 "Solving nonlinear equations" The correct answer is: 10/3
Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
2/8
Question 3
Correct
Mark 1.00 out of
1.00
Question 4
Correct
Mark 1.00 out of
1.00
Question 5
Correct
Mark 1.00 out of
1.00
Solve the equation using the bisection algorithm starting with and .
Conduct three iterations (i.e. find ) and report the approximation of the root computed by the algorithm. Use as many
digits as possible. Answer:
1.9375
First iteration: and Second iteration: and Third iteration: and Algorithm estimates the root in the third iteration as Reference: lecture on bisection method in topic 2 "Solving nonlinear equations" The correct answer is: 1.9375
The equation has a solution in . You are using Newton's method to estimate this solution. If the absolute error in iteration 4 is about 0.02, how large do
you expect to be the absolute error in iteration 5 ? Select one:
a. We can not predict this error with the information given
b. 0.001
c. 0.01
d. 0.05
Your answer is correct.
Newton's method convergences quadraticaly. The asymptotic error constant is given by .
This is . Consequently Reference: Lecture on order of convergence form topic 2 "Nonlinear equations" The correct answer is: 0.001
The root of the equation has a multiplicity of Answer:
2
Indeed is a root as .
Define . Then . As the root is at least a double root.
As and the root is a double root. Reference: lecture on challenging problems in topic 2 "Solving nonlinear equations" The correct answer is: 2
Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
3/8
Question 6
Incorrect
Mark 0.00 out of
1.00
Question 7
Correct
Mark 1.00 out of
1.00
Question 8
Correct
Mark 1.00 out of
1.00
You are implementing on a computer a numerical algorithm to solve an equation of the form .
In order to check your algorithm you decide to test it with the function . Select one:
a. This is not a good choice for the function to test the programmed algorithm
b. This is a valid choice for the function to test the programmed algorithm
Your answer is incorrect.
The function f
(
x
) =
x
3
is flat around the root r
= 0
as it is a triple root. 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 topic 2 "Solving nonlinear equations" The correct answer is: This is not a good choice for the function \(f(x)\) to test the programmed algorithm
You have to solve an equation \(f(x)=0\) with a precision below a defined value \(TOL\). If \(|f(x_r)|<TOL\) then Select one:
a. you have found an approximation \(x_r\) to the specified precision
b. you have found an approximation \(x_r\) to the specified precision if \(x_r\) is not a multiple root
c. you have found an approximation \(x_r\) to the specified precision as long as you use relative errors
d. you can't conclude anything
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 error you want
to have below the specified tolerance \(TOL\). Reference: lecture on backward and forward errors in topic 2 "Solving nonlinear equations". The correct answer is: you can't conclude anything
You are using the bisection method to solve an equation with an initial guess \(a_0=0.5\) and \(b_0=2.5\). It is required to find the approximation of the root with an absolute error less than 0.2.
How many iterations do you have to do at least in order to reach the set precision? Answer:
3
You need at least four iterations. Indeed the initial error is about \(\frac{2.5-0.5}{2}=1.0\). After one iteration the error will be \(\frac{1.0}{2}\) which is larger than 0.2
After two iterations the error will be \(\frac{1.0}{2^2}\) which is larger than 0.2 After three iterations you have an error of \(\frac{1.0}{2^3}\) which is less than 0.2. Alternatively you can use the formula of the lecture:
\( n \geq \frac{\log(2.5-0.5)-\log 0.2 }{\log 2}-1 \simeq 2.3 \)
You find again that at least three iterations will be needed. Reference: lecture on bisection method (error control) in topic 2 "Solving nonlinear equations" The correct answer is: 3
Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
4/8
Question 9
Correct
Mark 1.00 out of
1.00
Question 10
Correct
Mark 2.00 out of
2.00
Question 11
Partially correct
Mark 0.67 out of
1.00
We solve the equation \(x^2-3=0\) using the false-position method.
If \(a_0=1\) and \(b_0=2\) then \(a_1\) and \(b_1\) are? Select one:
a. \(a_1=1.5878\) and \(b_1=2\)
b. \(a_1=1\) and \(b_1=1.5878\)
c. \(a_1=1.6667\) and \(b_1=2\)
d. \(a_1=1\) and \(b_1=1.6667\)
Your answer is correct.
Reference: lecture on false position in topic 2 "Solving nonlinear equations" The correct answer is: \(a_1=1.6667\) and \(b_1=2\)
Find the absolute backward and forward error for the following functions, where the true root is \(r=0.75\) and the
approximated root is \(x_r=0.74\).
Fill out the following table to answer the question
\(f(x)\)
Backward error Forward error \(f(x)=4x-3\)
0.04
0.01
\(f(x)=(4x-3)^2\)
0.0016
0.01
\(f(x)=(4x-3)^3\)
0.000064
0.01
The forward error is for all cases \(|r-x_r|=0.01\).
The 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 topic 2 "Solving nonlinear equations" We want to apply the fixed point method to solve the equation \(x=g(x)\).
Choose among the following examples of functions \(g(x)\) which will lead to a converging fixed point algorithm when
using the intial guess \(x_0\) specified. Select one or more:
a. \(g(x)=e^{x-2}+x^3\) and \(x_0=0.5\)
b. \(g(x)=\ln x+ x^3 \cos x\) and \(x_0=5\)
c. \(g(x)=x^2-3x\cos x\) and \(x_0=1\)
d. \(g(x)=\frac{x^4-\cos x} {3-5x^3}\) and \(x_0=0.8\)
e. \(g(x)=e^x-4x^2\) and \(x_0=-1\)
Your answer is partially correct.
You have selected too many options.
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 topic 2 "Solving nonlinear equations". The correct answers are: \(g(x)=e^{x-2}+x^3\) and \(x_0=0.5\), \(g(x)=\frac{x^4-\cos x} {3-5x^3}\) and \(x_0=0.8\)
Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
5/8
Question 12
Correct
Mark 2.00 out of
2.00
Question 13
Correct
Mark 2.00 out of
2.00
Consider the following equation:
\(x^2-2xe^{-x}+e^{-2x} = 0\).
A numerical algorithm produced the following approximation of a root \(r\) of this equation \(x_r=0.567143470743\).
How much is the backward error (give the answer with one significant digit) ? 8e-14
Estimate the multiplicity of the root the algorithm is trying to approximate :
2
Estimate the absolute error \(|r-x_r|\) of \(x_r\) to one significant digit : 3e-7
How many correct significant digits contains \(x_r\) ? 6
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" Consider the following equation:
\((x-2)^2-\ln x = 0\).
A numerical algorithm produced the following approximation of a root \(r\) of this equation \(x_r=3.057107083749\).
How much is the backward error (give the answer with one significant digit) ? 6e-6
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 : 3e-6
How many correct significant digits contains \(x_r\) ? 5
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" Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
6/8
Question 14
Correct
Mark 1.00 out of
1.00
Consider the equation \( 2x \cos(2x) -(x+1)^2 = 0\).
Find an approximation of it's root in \([-1,0]\) to an absolute error less than \(10^{-12}\) with one of the methods covered
in class. Answer:
-0.798159961405796
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=-1.0\)
\(x_1=-8.137830254063156e-01\)
\(x_2=-7.983458812221341e-01\)
\(x_3=-7.981599890441817e-01\)
\(x_4= -7.981599614057965e-01\)
We see that in iteration 4 we have an estimated absolute error of
\( |r-x_r| \simeq \left| \frac{\cdot f(x_5)}{f'(x_5)} \right| \simeq 6 \cdot 10^{-16} \) Consequently \(x_4\) is an approximation to the root with an absolute error less than \(10^{-12}\).
The correct answer is: -0.7981599614058
Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
7/8
Question 15
Incorrect
Mark 0.00 out of
1.00
Question 16
Partially correct
Mark 1.00 out of
2.00
Consider the equation \( x \cos x -2x^2+3x-1 = 0\).
Find an approximation of it's root in \([1,2]\) to an absolute error less than \(10^{-9}\) with one of the methods covered in
class. Answer:
1.256623312830925
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=1.5\)
\(x_1=1.298013076180474\)
\(x_2=1.258319136510899\)
\(x_3=1.256626416511110\)
\(x_4=1.256623322515906\)
We see that in iteration 4 we have an estimated absolute error of \( |r-x_r| \simeq \left| \frac{\cdot f(x_4)}{f'(x_4)} \right| \simeq 1 \cdot 10^{-11} \) Consequently \(x_4\) is an approximation to the root with an absolute error less than \(10^{-9}\).
The correct answer is: 1.2566233225056
Consider the following equation:
\(2+\cos(e^x-2)-e^x=0\).
A numerical algorithm produced the following approximation of a root \(r\) of this equation \(x_r=1.00767372\).
How much is the backward error (give the answer with one significant digit) ? -2e-4
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 : 4e-5
How many correct significant digits contains \(x_r\) ? 4
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" Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
3/13/2021
Assignment 2 - Nonlinear Equations: Attempt review
https://moodle.econcordia.com/mod/quiz/review.php?attempt=19502&cmid=655
8/8
Question 17
Incorrect
Mark 0.00 out of
1.00
Consider the equation \(x^5-\frac{1}{x^3}+4 =0\).
Find an approximation of it's positive root to an absolute error less than \(10^{-12}\) with one of the methods covered in
class. Answer:
0.625030975043046
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)
\(x_o=0.5\)
\(x_1=5.821474773609314e-01\)
\(x_2=6.196782123994239e-01\)
\(x_3=6.249462653677527e-01\)
\(x_4=6.250309538065602e-01\)
\(x_5=6.250309750512092e-01\)
\(x_6=6.250309750512105e-01\) Using the formula \(|x_r-r| \simeq \left| \frac{f(x_r)}{f'(x_r)} \right|\) shows that \(x_5\) has an estimated absolute error
below \(10^{-12}\). The correct answer is: 0.6250309750512
◄ Assignment 1 - Introduction (Not for grade)
Jump to...
Assignment 3 - Linear Equations ►
Downloaded by NightShade Co (nghtshdeco@gmail.com)
lOMoARcPSD|33438865
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help