# channelflow.org

### Site Tools

gibson:teaching:spring-2018:math445:lab7

# Differences

This shows you the differences between two versions of the page.

 gibson:teaching:spring-2018:math445:lab7 [2018/03/19 14:49]gibson gibson:teaching:spring-2018:math445:lab7 [2018/03/29 06:55] (current)gibson Both sides previous revision Previous revision 2018/03/29 06:55 gibson 2018/03/19 14:49 gibson 2018/03/19 14:48 gibson created 2018/03/29 06:55 gibson 2018/03/19 14:49 gibson 2018/03/19 14:48 gibson created Line 18: Line 18: 1. Use a ''​for''​ loop to perform the Newton-search iteration $x_{n+1} = x_n + \Delta x$. Take up to ten Newton-search iterations. 1. Use a ''​for''​ loop to perform the Newton-search iteration $x_{n+1} = x_n + \Delta x$. Take up to ten Newton-search iterations. - 2. Use an ''​if''​ statement inside the ''​for''​ loop to test if either $|f(x)| < \epsilon$ or $|\Delta x| < \epsilon$ for some specified tolerance $\epsilon$. + 2. Use an ''​if''​ statement inside the ''​for''​ loop to test if either $|f(x)| < tol$ or $|\Delta x| < tol$ for some specified tolerance $tol$. - 3. If either of those conditions is true, use a ''​break''​ statement to terminate the iteration and return from the function. For our purposes $\epsilon ​= 10^{-7}$ is a decent choice. ​ + 3. If either of those conditions is true, use a ''​break''​ statement to terminate the iteration and return from the function. For our purposes $tol = 10^{-13}$ is a decent choice. ​ ---- ----