====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2016:math445:lab7 [2016/03/08 06:31] gibson |
gibson:teaching:spring-2016:math445:lab7 [2016/03/12 06:39] (current) gibson |
||
---|---|---|---|
Line 5: | Line 5: | ||
* learn the most widely-used algorithm for solving nonlinear equations | * learn the most widely-used algorithm for solving nonlinear equations | ||
* solve a practical, real-world problem involving a nonlinear equation | * solve a practical, real-world problem involving a nonlinear equation | ||
+ | * learn about anonymous functions | ||
* gain more experience in programming with ''for'' loops and ''if'' statements | * gain more experience in programming with ''for'' loops and ''if'' statements | ||
Line 13: | Line 14: | ||
''xguess'' using the Newton search algorithm. | ''xguess'' using the Newton search algorithm. | ||
- | You Newton search algorithm should | + | Your Newton search algorithm should |
- | 1. Use a ''for'' loop to perform the Newton-search iteration $x_{n+1} = x_n + \Delta x$. Take up to ten Newton steps. | + | 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)| < \epsilon$ or $|\Delta x| < \epsilon$ for some specified tolerance $\epsilon$. | ||
Line 57: | Line 58: | ||
If $x$ is in meters and $t$ is in seconds, the thermal conductivity of soil is | If $x$ is in meters and $t$ is in seconds, the thermal conductivity of soil is | ||
$\alpha = 0.138 \times 10^{-6} \; m^2/s$. | $\alpha = 0.138 \times 10^{-6} \; m^2/s$. | ||
- | Let $T_i= 20\,C$ and $T_S = -15\,C$, and recall that water freezes at $T = 0\,C$. | + | Let $T_i= 20\,C$ and $T_S = -15\,C$, and recall that water freezes at $T(x,t) = 0\,C$. |
Use your Newton-search algorithm to determine how deep a water main must be | Use your Newton-search algorithm to determine how deep a water main must be | ||
buried so that it will not freeze until at least 60 days' exposure to these | buried so that it will not freeze until at least 60 days' exposure to these | ||
conditions. | conditions. | ||
- | ---- | ||
- | ...to be continued... |