Homework #2
due 10/6/17 by 11:59pm
1. Create a new github repository called '02_roots_and_optimization'.
a. Add rcc02007 and zhs15101 as collaborators.
b. submit the clone repository URL to: https://goo.gl/forms/svFKpfiCfLO9Zvfz1
2. You're installing a powerline in a residential neighborhood. The lowest point on the cable is 30 m above the ground, but 30 m away is a tree that is 35 m tall. Another engineer informs you that this is a catenary cable problem with the following solution
where y(x) is the height of the cable at a distance, x, from the lowest point,
a. Use the three solvers falsepos.m
, bisect.m
, and mod_secant.m
to solve for the tension neededi, T, to reach y(30 m)=35 m, with w=10 N/m, and
b. Compare the number of iterations that each function needed to reach an accuracy of 0.00001%. Include a table in your README.md with:
```
| solver | initial guess(es) | ea | number of iterations|
| --- | --- | --- | --- |
|falsepos | | | |
|mod_secant | | | |
|bisect | | | |
```
c. Add a figure to your README that plots the final shape of the powerline () from x=-10 to 50 m.
3. The Newton-Raphson method and the modified secant method do not always converge to a
solution. One simple example is the function f(x) = (x-1)*exp(-(x-1)^2). The root is at 1, but
using the numerical solvers, newtraph.m
and mod_secant.m
, there are certain initial
guesses that do not converge.
a. Calculate the first 5 iterations for the Newton-Raphson method with an initial guess of x_i=3 for f(x)=(x-1)*exp(-(x-1)^2).
b. Add the results to a table in the README.md
with:
```
### divergence of Newton-Raphson method
| iteration | x_i | approx error |
| --- | --- | --- |
| 0 | 3 | n/a |
| 1 | | |
| 2 | | |
| 3 | | |
| 4 | | |
| 5 | | |
```
c. Repeat steps a-b for an initial guess of 1.2. (But change the heading from 'divergence' to 'convergence')
4. Determine the nonlinear spring constants of a single-atom gold chain. You can assume the gold atoms are aligned in a one dimensional network and the potential energy is described by the Lennard-Jones potential as such
Where x is the distance between atoms in nm,
Where is the distance between atoms with no force applied and is the amount each gold atom has moved under a given force, F.
a. Determine when F=0 nN using the golden ratio and parabolic methods. Show your script and output in your README and include your functions
b. Solve for is the
amount each gold atom has mov for F=0 to 0.0022 nN with 30 steps. *Use the golden ratio
solver or the matlab/octave fminsearch
c. create a sum of squares error function sse_of_parabola.m
that calculates the sum of
squares error between a function
d. Use the fminsearch
matlab/octave function to determine
.
e. Plot the force vs calculated and the best-fit parabola using in part d.