Skip to content
Permalink
162abcd3c8
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
77 lines (76 sloc) 5.9 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
</head>
<body>
<h1 id="homework-2">Homework #2</h1>
<h2 id="due-10617-by-1159pm">due 10/6/17 by 11:59pm</h2>
<p><strong>1.</strong> Create a new github repository called ‘02_roots_and_optimization’.</p>
<ol style="list-style-type: lower-alpha">
<li><p>Add rcc02007 and zhs15101 as collaborators.</p></li>
<li><p>submit the clone repository URL to: <a href="https://goo.gl/forms/svFKpfiCfLO9Zvfz1" class="uri">https://goo.gl/forms/svFKpfiCfLO9Zvfz1</a></p></li>
</ol>
<p><strong>2.</strong> 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</p>
<div class="figure">
<img src="./equations/eq1.png" alt="eq. 1" />
<p class="caption">eq. 1</p>
</div>
<p><span class="math inline">\(y(x)=\frac{T}{w}\cosh\left(\frac{w}{T}x\right)+y_{0}-\frac{T}{w}\)</span>.</p>
<p>where y(x) is the height of the cable at a distance, x, from the lowest point, <span class="math inline">\(y_{0}\)</span>, T is the tension in the cable, and w is the weight per unit length of the cable. Your supervisor wants to know which numerical solver to use when they have to install these powerlines in similar places.</p>
<ol style="list-style-type: lower-alpha">
<li><p>Use the three solvers <code>falsepos.m</code>, <code>bisect.m</code>, and <code>mod_secant.m</code> to solve for the tension neededi, T, to reach y(30 m)=35 m, with w=10 N/m, and <span class="math inline">\(y_{0}\)</span>=30 m.</p></li>
<li><p>Compare the number of iterations that each function needed to reach an accuracy of 0.00001%. Include a table in your README.md with:</p>
<pre><code>| solver | initial guess(es) | ea | number of iterations|
| --- | --- | --- | --- |
|falsepos | | | |
|mod_secant | | | |
|bisect | | | |</code></pre></li>
<li><p>Add a figure to your README that plots the final shape of the powerline (<img src="./equations/eq2.png" alt="eq2" />) from x=-10 to 50 m.</p></li>
</ol>
<p><strong>3.</strong> 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, <code>newtraph.m</code> and <code>mod_secant.m</code>, there are certain initial guesses that do not converge.</p>
<ol style="list-style-type: lower-alpha">
<li><p>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).</p></li>
<li><p>Add the results to a table in the <code>README.md</code> with:</p>
<pre><code>### divergence of Newton-Raphson method
| iteration | x_i | approx error |
| --- | --- | --- |
| 0 | 3 | n/a |
| 1 | | |
| 2 | | |
| 3 | | |
| 4 | | |
| 5 | | |</code></pre></li>
<li><p>Repeat steps a-b for an initial guess of 1.2. (But change the heading from ‘divergence’ to ‘convergence’)</p></li>
</ol>
<div class="figure">
<img src="../08_optimization/Auchain_model.png" alt="Model of Gold chain, from molecular dynamics simulation" />
<p class="caption">Model of Gold chain, from molecular dynamics simulation</p>
</div>
<p><strong>4.</strong> 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</p>
<div class="figure">
<img src="./equations/eq3.png" alt="eq3" />
<p class="caption">eq3</p>
</div>
<p><span class="math inline">\(E_{LJ}(x)=4\epsilon \left(\left(\frac{\sigma}{x}\right)^{12}-\left(\frac{\sigma}{x}\right)^{6}\right)\)</span>.</p>
<p>Where x is the distance between atoms in nm, <span class="math inline">\(\epsilon\)</span>=2.71E-4 aJ, and <span class="math inline">\(\sigma\)</span>=0.2934 nm. The energy term that must be minimized is</p>
<div class="figure">
<img src="./equations/eq4.png" alt="eq4" />
<p class="caption">eq4</p>
</div>
<p><span class="math inline">\(E_{total}(\Delta x)=E_{LJ}(x_{0}+\Delta x)-F\Delta x\)</span>.</p>
<p>Where <span class="math inline">\(x_{0}\)</span> is the distance between atoms with no force applied and <img src="./equations/deltax.png" alt="dx" /> is the amount each gold atom has moved under a given force, F.</p>
<ol style="list-style-type: lower-alpha">
<li><p>Determine <img src="./equations/x0.png" alt="x0" /> when F=0 nN using the golden ratio and parabolic methods. <em>Show your script and output in your README and include your functions</em></p></li>
<li><p>Solve for <img src="./equations/deltax.png" alt="dx" /> 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 <code>fminsearch</code></p></li>
<li><p>create a sum of squares error function <code>sse_of_parabola.m</code> that calculates the sum of squares error between a function <span class="math inline">\(F(x)=K_{1}\Delta x+1/2K_{2}\Delta x^{2}\)</span> and the Forces used in part B for each <img src="./equations/deltax.png" alt="dx" />.</p></li>
<li><p>Use the <code>fminsearch</code> matlab/octave function to determine <img src="./equations/k1k2.png" alt="k1k2" />.</p></li>
<li><p>Plot the force vs calculated <img src="./equations/deltax.png" alt="dx" /> and the best-fit parabola using <img src="./equations/k1k2.png" alt="k1k2" /> in part d.</p></li>
</ol>
</body>
</html>