From 5128cfdd16e951bae9c50931c11a4a10062adbc6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Cooper" Date: Tue, 14 Feb 2017 09:29:11 -0500 Subject: [PATCH] update lecture 08 --- lecture_07/.lecture_07.md.swo | Bin 16384 -> 0 bytes lecture_08/goldmin.m | 36 + lecture_08/lecture_08.ipynb | 1032 ++++++++++++++++- lecture_08/lecture_08.md | 626 ++++++++++ .../lecture_08_files/lecture_08_11_0.svg | 168 +++ .../lecture_08_files/lecture_08_12_0.svg | 163 +++ .../lecture_08_files/lecture_08_13_0.svg | 163 +++ .../lecture_08_files/lecture_08_16_1.svg | 142 +++ .../lecture_08_files/lecture_08_17_1.svg | 136 +++ .../lecture_08_files/lecture_08_19_1.svg | 135 +++ .../lecture_08_files/lecture_08_23_0.svg | 196 ++++ .../lecture_08_files/lecture_08_3_0.svg | 147 +++ .../lecture_08_files/lecture_08_6_1.svg | 169 +++ .../lecture_08_files/lecture_08_7_1.svg | 169 +++ .../lecture_08_files/lecture_08_8_1.svg | 169 +++ .../lecture_08_files/lecture_08_9_1.svg | 169 +++ lecture_08/octave-workspace | Bin 4894 -> 16015 bytes 17 files changed, 3557 insertions(+), 63 deletions(-) delete mode 100644 lecture_07/.lecture_07.md.swo create mode 100644 lecture_08/goldmin.m create mode 100644 lecture_08/lecture_08.md create mode 100644 lecture_08/lecture_08_files/lecture_08_11_0.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_12_0.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_13_0.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_16_1.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_17_1.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_19_1.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_23_0.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_3_0.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_6_1.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_7_1.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_8_1.svg create mode 100644 lecture_08/lecture_08_files/lecture_08_9_1.svg diff --git a/lecture_07/.lecture_07.md.swo b/lecture_07/.lecture_07.md.swo deleted file mode 100644 index 244c92b4a8b2de0963ac2c967211c369c6345cc2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3e~cqneZVKZ5D3YIC{$G|HSG)8)7g9W?9A9>ukYmMHX%r~TpA@kXvp0D>Z86kv{g!oA>kkzVG{e-?!c^Y=r_U3AN3 zniidN0-1cFtL;X&HU@3v61pc2(An6~{?q-ZXk&W}y+4n^Y-!ElXFH3)T;r*fP z`4idq)ma7Oda~r@*HQvY2`nYBl)zE~O9?C`u#~`30!s-jC9sshQUXf}yap0*_(S?t zwEJCo0Knh>$MOG5Z_>0M!wc{&_&fMp_$GV}o`OGtKZf6f55a@*dbk9>eubtz1AhpA z07KY;ZRo*m@K(41PQY70gC88$v=`yu;d}7+@MU-!{uG{q^Y9S-I_y9U5j5ZixE?m( zBvjyP_|fIm3Eze9z&GG=I1i7(qwp#C9Z29#=s+881q)0t;3NDt;=^zneg!UrH^L)t z)U>8ocxdP5Tdc8lHqN!l&Rv@LTYHxCaK1z%f{b z7hbPv--j>5)9_xX!#Z3FZ-BqPMAQBX9)(BXH{my+1QwWZ6n^wN07Cr+H!*9a~-V3{M7o383z%Ris!bvDV z4vxYVa2PI!O%9vR!Wp;)s&E*-j}HGENL~Jp)aRF9cieG@w&5rBjaeOd0{ISJ6_Ti<7&MiaU(ZQMC2rH zK}5Qszkb1(c=^iuW8p;IM2>9(zr9z}O!c&2%dyP0Ed}T?k5WEWB{tVdC$FR%6;nzxO^(7a zkuS`$rC0f_7qw`&%fy1~6l4u&XT{QP_yu!3USn~@E5pXFcg!5s<@cy~rX4xW-F8kr z<#T6RZZB~}`ZOA+ADc@qj&qMzu-IKE=(tLehr-=aiCfid3g1n-VGElaipXsZnyiOt%S$3BIwxXRYNcGOVOwlFk>_lo znFTS3Rnwa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R%hYYV zTIQx$(uv$;TCuDXR@w5ds;`$ViyO11m(~r^ik7WgHIsbBlC7K8`d%%Yla|+K8di~U zy1?7H+l}LfXOZ)`o^Cg!)ikfyRXL4t$EDF!Ms+6xK9TTM)m<+GhguwhXyTGTt5g5!q!t zOK!*r*jsBy1pgx>nmxH89q)f+Et9RKY9JFuc9>Cek6GiPu%jTf-hV7+MYoJJ4pB7; zu64ayso52IYcZF#8VV)UmLt;+x%=4nR+E|4hZw7zX-{U}GG?ZpjHWyq;JU!AQ5$D4 zY!puwGb)zUP}9(BoZzI#DH;i4((d}CS+hLfY^|mnC9@{A`G7sxuZx;&P<>3Ao$7gY zrd8Kz1Z>k%9hgRL#BChU*#!a;j^q0eWA{ArCIjv?U@2L*6`)MQ2iVClXa5iNLNu> zqs%f>k7-ToNiE|<&YUs!h;G_Z=&J!tUc9QQlPaV2+>RTxaz~|dG12m5fUxdp;V2fT zNVv(SjEA<Ki(^~-QO#9 zE6(TD0HuI5`l%k&;ap=Y=6sINoR^m5_G~@vS&r4giJ&plI=MKSmer)C+kIKO-Jg_h z_s`bVC{gtTl=oHZ{<)5g8l`C=7v>+RLe<2^U% zB;6U|D|4_F*Y9#824WU&Qs)(N-!4=WI`+cb^U;bv_bNDVhlLk3ni)h&W9)Oz02sd;DWr!MFf?o{Tq z#KaX`52W@bgZ;z&DHeQt(zd)IaUaHtN=>zFQrOa7ZHbCX;US+@bXnE?8 zW;b3+TgMJbJ= maxit,break,end +end +x=xopt;fx=f(xopt,varargin{:}); \ No newline at end of file diff --git a/lecture_08/lecture_08.ipynb b/lecture_08/lecture_08.ipynb index 134ed8a..d99107a 100644 --- a/lecture_08/lecture_08.ipynb +++ b/lecture_08/lecture_08.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": { "collapsed": false }, @@ -20,24 +20,6 @@ "Many problems involve finding a minimum or maximum based on given constraints. Engineers and scientists typically use energy balance equations to find the conditions of minimum energy, but this value may never go to 0 and the actual value of energy may not be of interest. " ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] - }, { "cell_type": "markdown", "metadata": {}, @@ -64,7 +46,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": { "collapsed": false }, @@ -243,7 +225,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": { "collapsed": false }, @@ -281,7 +263,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": { "collapsed": false }, @@ -515,7 +497,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": { "collapsed": false }, @@ -738,7 +720,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 6, "metadata": { "collapsed": false }, @@ -748,7 +730,7 @@ "output_type": "stream", "text": [ "current_min = -0.038904\n", - "error_app = 0\n" + "error_app = 0.13359\n" ] }, { @@ -888,30 +870,30 @@ "\tgnuplot_plot_2a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_3a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_4a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_5a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_6a\n", "\n", - "\t\n", + "\t\n", "\t\n", "\n", "\n", @@ -961,7 +943,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 7, "metadata": { "collapsed": false }, @@ -970,7 +952,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "current_min = -0.039000\n", + "current_min = -0.038904\n", "error_app = 0\n" ] }, @@ -1111,30 +1093,30 @@ "\tgnuplot_plot_2a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_3a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_4a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_5a\n", "\n", "\t \n", - "\t\n", + "\t\n", "\n", "\t\n", "\tgnuplot_plot_6a\n", "\n", - "\t\n", + "\t\n", "\t\n", "\n", "\n", @@ -1188,7 +1170,7 @@ "collapsed": true }, "source": [ - "## Parabolc Interpolation\n", + "## Parabolic Interpolation\n", "\n", "Near a minimum/maximum, the function resembles a parabola. With three data points, it is possible to fit a parabola to the function. So, given a lower and upper bound, we can choose the midpoint and fit a parabola to the 3 x,f(x) coordinates. \n", "\n", @@ -1202,7 +1184,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 8, "metadata": { "collapsed": false }, @@ -1436,18 +1418,11 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "f3 = -0.038878\r\n" - ] - }, { "data": { "image/svg+xml": [ @@ -1653,18 +1628,11 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "f3 = -0.038878\r\n" - ] - }, { "data": { "image/svg+xml": [ @@ -1888,7 +1856,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 24, "metadata": { "collapsed": false }, @@ -1897,24 +1865,962 @@ "name": "stdout", "output_type": "stream", "text": [ - "xmin = 3.2933\r\n" + "xmin = 0.32933\n", + "Emin = -2.7096e-04\n" ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "Gnuplot\n", + "Produced by GNUPLOT 5.0 patchlevel 3 \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t-0.0004\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-0.0002\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0002\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0004\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0006\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.3\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.7\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tLennard Jones Potential (aJ/atom)\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\tbond length (nm)\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\t \n", + "\t\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "xmin = fminbnd(Au_x,2.8,6)\n", + "epsilon = 0.039; % kcal/mol\n", + "epsilon = epsilon*6.9477e-21; % J/atom\n", + "epsilon = epsilon*1e18; % aJ/J\n", + "% final units for epsilon are aJ\n", + "\n", + "sigma = 2.934; % Angstrom\n", + "sigma = sigma*0.10; % nm/Angstrom\n", + "x=linspace(2.8,6,200)*0.10; % bond length in um\n", + "\n", + "Ex = lennard_jones(x,sigma,epsilon);\n", "\n", - "Etotal = @(dx,F) Au_x(xmin+dx)-F.*dx;\n" + "%[Emin,imin]=min(Ex);\n", + "\n", + "[xmin,Emin] = fminbnd(@(x) lennard_jones(x,sigma,epsilon),0.28,0.6)\n", + "\n", + "plot(x,Ex,xmin,Emin,'o')\n", + "ylabel('Lennard Jones Potential (aJ/atom)')\n", + "xlabel('bond length (nm)')\n", + "\n", + "Etotal = @(dx,F) lennard_jones(xmin+dx,sigma,epsilon)-F.*dx;\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 114, "metadata": { - "collapsed": true + "collapsed": false }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: called from\n", + " goldmin at line 17 column 1\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n", + "warning: Matlab-style short-circuit operation performed for operator |\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "Gnuplot\n", + "Produced by GNUPLOT 5.0 patchlevel 3 \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0005\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.001\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0015\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.002\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0025\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-0.01\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.01\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.02\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.03\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.04\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tForce (nN)\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\tdx (nm)\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "N=50;\n", + "dx = zeros(1,N); % [in nm]\n", + "F_applied=linspace(0,0.0022,N); % [in nN]\n", + "for i=1:N\n", + " optmin=goldmin(@(dx) Etotal(dx,F_applied(i)),-0.001,0.035);\n", + " dx(i)=optmin;\n", + "end\n", + "\n", + "plot(dx,F_applied)\n", + "xlabel('dx (nm)')\n", + "ylabel('Force (nN)')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For this function, it is possible to take a derivative and compare the analytical result:" + ] + }, + { + "cell_type": "code", + "execution_count": 105, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "F =\n", + "\n", + "@(dx) 4 * epsilon * 6 * (sigma ^ 6 ./ (xmin + dx) .^ 7 - 2 * sigma ^ 12 ./ (xmin + dx) .^ 13)\n", + "\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "Gnuplot\n", + "Produced by GNUPLOT 5.0 patchlevel 3 \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0005\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.001\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0015\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.002\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0025\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.01\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.02\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.03\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.04\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.05\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.06\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "dx_full=linspace(0,0.06,50);\n", + "F= @(dx) 4*epsilon*6*(sigma^6./(xmin+dx).^7-2*sigma^12./(xmin+dx).^13)\n", + "plot(dx_full,F(dx_full),dx,F_applied)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Curve-fitting\n", + "Another example is minimizing error in your approximation of a function. If you have data (now we have Force-displacement data) we can fit this to a function, such as:\n", + "\n", + "$F(x) = K_{1}\\Delta x + \\frac{1}{2} K_{2}(\\Delta x)^{2}$\n" + ] + }, + { + "cell_type": "code", + "execution_count": 106, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "function SSE = sse_of_parabola(K,xdata,ydata)\n", + " % calculate the sum of squares error for a parabola given a function, func, and xdata and ydata\n", + " % output is SSE=sum of squares error\n", + " K1=K(1);\n", + " K2=K(2);\n", + " y_function = K1*xdata+1/2*K2*xdata.^2;\n", + " SSE = sum((ydata-y_function).^2);\n", + "end\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "The nonlinear spring constants are K1=0.16 nN/nm and K2=-5.98 nN/nm^2\n", + "The mininum sum of squares error = 7.35e-08\n" + ] + } + ], + "source": [ + "[K,SSE_min]=fminsearch(@(K) sse_of_parabola(K,dx,F_applied),[1,1]);\n", + "fprintf('\\nThe nonlinear spring constants are K1=%1.2f nN/nm and K2=%1.2f nN/nm^2\\n',K)\n", + "fprintf('The mininum sum of squares error = %1.2e',SSE_min)" + ] + }, + { + "cell_type": "code", + "execution_count": 108, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "Gnuplot\n", + "Produced by GNUPLOT 5.0 patchlevel 3 \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\t\n", + "\t \n", + "\t \n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0005\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.001\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0015\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.002\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.0025\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.005\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.01\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.015\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.02\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.025\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.03\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.035\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.04\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t \n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plot(dx,F_applied,'o',dx,K(1)*dx+1/2*K(2)*dx.^2)" + ] } ], "metadata": { diff --git a/lecture_08/lecture_08.md b/lecture_08/lecture_08.md new file mode 100644 index 0000000..8a81a2a --- /dev/null +++ b/lecture_08/lecture_08.md @@ -0,0 +1,626 @@ + + +```octave +%plot --format svg +``` + +# Optimization + +Many problems involve finding a minimum or maximum based on given constraints. Engineers and scientists typically use energy balance equations to find the conditions of minimum energy, but this value may never go to 0 and the actual value of energy may not be of interest. + +The Lennard-Jones potential is commonly used to model interatomic bonding. + +$E_{LJ}(x)=4\epsilon \left(\left(\frac{\sigma}{x}\right)^{12}-\left(\frac{\sigma}{x}\right)^{6}\right)$ + +Considering a 1-D gold chain, we can calculate the bond length, $x_{b}$, with no force applied to the chain and even for tension, F. This will allow us to calculate the nonlinear spring constant of a 1-D gold chain. + +![TEM image of Gold chain](au_chain.jpg) + +Computational Tools to Study and Predict the Long-Term Stability of Nanowires. +By Martin E. Zoloff Michoff, Patricio Vélez, Sergio A. Dassie and Ezequiel P. M. Leiva + +![Model of Gold chain, from molecular dynamics simulation](Auchain_model.gif) + +[Single atom gold chain mechanics](http://www.uam.es/personal_pdi/ciencias/agrait/) + +### First, let's find the minimum energy $\min(E_{LJ}(x))$ + +## Brute force + + +```octave +setdefaults +epsilon = 0.039; % kcal/mol +sigma = 2.934; % Angstrom +x=linspace(2.8,6,200); % bond length in Angstrom + +Ex = lennard_jones(x,sigma,epsilon); + +[Emin,imin]=min(Ex); + +plot(x,Ex,x(imin),Emin,'o') +``` + + +![svg](lecture_08_files/lecture_08_3_0.svg) + + + +```octave +x(imin-1) +x(imin) +x(imin+1) +``` + + ans = 3.2824 + ans = 3.2985 + ans = 3.3146 + + +## Golden Search Algorithm + +We can't just look for a sign change for the problem (unless we can take a derivative) so we need a new approach to determine whether we have a maximum between the two bounds. + +Rather than using the midpoint of initial bounds, here the problem is more difficult. We need to compare the values of 4 function evaluations. The golden search uses the golden ratio to determine two interior points. + +![golden ratio](goldenratio.png) + +Start with bounds of 2.5 and 6 Angstrom. + + +```octave +% define Au atomic potential +epsilon = 0.039; % kcal/mol +sigma = 2.934; % Angstrom +Au_x= @(x) lennard_jones(x,sigma,epsilon); + +% calculate golden ratio +phi = 1/2+sqrt(5)/2; +% set initial limits +x_l=2.8; +x_u=6; + +% Iteration #1 +d=(phi-1)*(x_u-x_l); + +x1=x_l+d; % define point 1 +x2=x_u-d; % define point 2 + + +% evaluate Au_x(x1) and Au_x(x2) + +f1=Au_x(x1); +f2=Au_x(x2); +plot(x,Au_x(x),x_l,Au_x(x_l),'ro',x2,f2,'rs',x1,f1,'gs',x_u,Au_x(x_u),'go') +hold on; + +if f2x2 + plot(x4,f4,'*',[x1,x2],[f1,f2]) + x1=x2; + f1=f2; + else + plot(x4,f4,'*',[x3,x2],[f3,f2]) + x3=x2; + f3=f2; + end + x2=x4; f2=f4; +else + error('no minimum in bracket') +end +hold off +``` + + +![svg](lecture_08_files/lecture_08_11_0.svg) + + + +```octave +p = polyfit([x1,x2,x3],[f1,f2,f3],2); +x_fit = linspace(x1,x3,20); +y_fit = polyval(p,x_fit); + +plot(x,Au_x(x),x_fit,y_fit,[x1,x2,x3],[f1,f2,f3],'o') +hold on +if f2x2 + plot(x4,f4,'*',[x1,x2],[f1,f2]) + x1=x2; + f1=f2; + else + plot(x4,f4,'*',[x3,x2],[f3,f2]) + x3=x2; + f3=f2; + end + x2=x4; f2=f4; +else + error('no minimum in bracket') +end +hold off + +``` + + +![svg](lecture_08_files/lecture_08_12_0.svg) + + + +```octave +p = polyfit([x1,x2,x3],[f1,f2,f3],2); +x_fit = linspace(x1,x3,20); +y_fit = polyval(p,x_fit); + +plot(x,Au_x(x),x_fit,y_fit,[x1,x2,x3],[f1,f2,f3],'o') +hold on +if f2x2 + plot(x4,f4,'*',[x1,x2],[f1,f2]) + x1=x2; + f1=f2; + else + plot(x4,f4,'*',[x3,x2],[f3,f2]) + x3=x2; + f3=f2; + end + x2=x4; f2=f4; +else + error('no minimum in bracket') +end +hold off + +``` + + +![svg](lecture_08_files/lecture_08_13_0.svg) + + +Parabolic interpolation does not converge in many scenarios even though it it a bracketing method. Instead, functions like `fminbnd` in Matlab and Octave use a combination of the two (Golden Ratio and Parabolic) + +## Using the solutions to minimization for the nonlinear spring constant + +Now, we have two routines to find minimums of a univariate function (Golden Ratio and Parabolic). Let's use these to solve for the minimum energy given a range of applied forces to the single atom gold chain + +$E_{total}(\Delta x) = E_{LJ}(x_{min}+\Delta x) - F \cdot \Delta x$ + + +```octave +epsilon = 0.039; % kcal/mol +epsilon = epsilon*6.9477e-21; % J/atom +epsilon = epsilon*1e18; % aJ/J +% final units for epsilon are aJ + +sigma = 2.934; % Angstrom +sigma = sigma*0.10; % nm/Angstrom +x=linspace(2.8,6,200)*0.10; % bond length in um + +Ex = lennard_jones(x,sigma,epsilon); + +%[Emin,imin]=min(Ex); + +[xmin,Emin] = fminbnd(@(x) lennard_jones(x,sigma,epsilon),0.28,0.6) + +plot(x,Ex,xmin,Emin,'o') +ylabel('Lennard Jones Potential (aJ/atom)') +xlabel('bond length (nm)') + +Etotal = @(dx,F) lennard_jones(xmin+dx,sigma,epsilon)-F.*dx; + +``` + + xmin = 0.32933 + Emin = -2.7096e-04 + + + +![svg](lecture_08_files/lecture_08_16_1.svg) + + + +```octave +N=50; +dx = zeros(1,N); % [in nm] +F_applied=linspace(0,0.0022,N); % [in nN] +for i=1:N + optmin=goldmin(@(dx) Etotal(dx,F_applied(i)),-0.001,0.035); + dx(i)=optmin; +end + +plot(dx,F_applied) +xlabel('dx (nm)') +ylabel('Force (nN)') +``` + + warning: Matlab-style short-circuit operation performed for operator | + warning: called from + goldmin at line 17 column 1 + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + warning: Matlab-style short-circuit operation performed for operator | + + + +![svg](lecture_08_files/lecture_08_17_1.svg) + + +For this function, it is possible to take a derivative and compare the analytical result: + + +```octave +dx_full=linspace(0,0.06,50); +F= @(dx) 4*epsilon*6*(sigma^6./(xmin+dx).^7-2*sigma^12./(xmin+dx).^13) +plot(dx_full,F(dx_full),dx,F_applied) +``` + + F = + + @(dx) 4 * epsilon * 6 * (sigma ^ 6 ./ (xmin + dx) .^ 7 - 2 * sigma ^ 12 ./ (xmin + dx) .^ 13) + + + + +![svg](lecture_08_files/lecture_08_19_1.svg) + + +## Curve-fitting +Another example is minimizing error in your approximation of a function. If you have data (now we have Force-displacement data) we can fit this to a function, such as: + +$F(x) = K_{1}\Delta x + \frac{1}{2} K_{2}(\Delta x)^{2}$ + + + +```octave +function SSE = sse_of_parabola(K,xdata,ydata) + % calculate the sum of squares error for a parabola given a function, func, and xdata and ydata + % output is SSE=sum of squares error + K1=K(1); + K2=K(2); + y_function = K1*xdata+1/2*K2*xdata.^2; + SSE = sum((ydata-y_function).^2); +end + +``` + + +```octave +[K,SSE_min]=fminsearch(@(K) sse_of_parabola(K,dx,F_applied),[1,1]); +fprintf('\nThe nonlinear spring constants are K1=%1.2f nN/nm and K2=%1.2f nN/nm^2\n',K) +fprintf('The mininum sum of squares error = %1.2e',SSE_min) +``` + + + The nonlinear spring constants are K1=0.16 nN/nm and K2=-5.98 nN/nm^2 + The mininum sum of squares error = 7.35e-08 + + + +```octave +plot(dx,F_applied,'o',dx,K(1)*dx+1/2*K(2)*dx.^2) +``` + + +![svg](lecture_08_files/lecture_08_23_0.svg) + diff --git a/lecture_08/lecture_08_files/lecture_08_11_0.svg b/lecture_08/lecture_08_files/lecture_08_11_0.svg new file mode 100644 index 0000000..c61f790 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_11_0.svg @@ -0,0 +1,168 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.06 + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + gnuplot_plot_3a + + + + + + + + gnuplot_plot_4a + + + + + + gnuplot_plot_5a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_12_0.svg b/lecture_08/lecture_08_files/lecture_08_12_0.svg new file mode 100644 index 0000000..b641032 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_12_0.svg @@ -0,0 +1,163 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + gnuplot_plot_3a + + + + + + + + gnuplot_plot_4a + + + + + + gnuplot_plot_5a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_13_0.svg b/lecture_08/lecture_08_files/lecture_08_13_0.svg new file mode 100644 index 0000000..3e467e5 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_13_0.svg @@ -0,0 +1,163 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + gnuplot_plot_3a + + + + + + + + gnuplot_plot_4a + + + + + + gnuplot_plot_5a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_16_1.svg b/lecture_08/lecture_08_files/lecture_08_16_1.svg new file mode 100644 index 0000000..ff27c29 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_16_1.svg @@ -0,0 +1,142 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.0004 + + + + + -0.0002 + + + + + 0 + + + + + 0.0002 + + + + + 0.0004 + + + + + 0.0006 + + + + + 0.2 + + + + + 0.3 + + + + + 0.4 + + + + + 0.5 + + + + + 0.6 + + + + + 0.7 + + + + + + + + + Lennard Jones Potential (aJ/atom) + + + + + bond length (nm) + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_17_1.svg b/lecture_08/lecture_08_files/lecture_08_17_1.svg new file mode 100644 index 0000000..1f3103b --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_17_1.svg @@ -0,0 +1,136 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 0.0005 + + + + + 0.001 + + + + + 0.0015 + + + + + 0.002 + + + + + 0.0025 + + + + + -0.01 + + + + + 0 + + + + + 0.01 + + + + + 0.02 + + + + + 0.03 + + + + + 0.04 + + + + + + + + + Force (nN) + + + + + dx (nm) + + + + + gnuplot_plot_1a + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_19_1.svg b/lecture_08/lecture_08_files/lecture_08_19_1.svg new file mode 100644 index 0000000..2a891df --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_19_1.svg @@ -0,0 +1,135 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 0.0005 + + + + + 0.001 + + + + + 0.0015 + + + + + 0.002 + + + + + 0.0025 + + + + + 0 + + + + + 0.01 + + + + + 0.02 + + + + + 0.03 + + + + + 0.04 + + + + + 0.05 + + + + + 0.06 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_23_0.svg b/lecture_08/lecture_08_files/lecture_08_23_0.svg new file mode 100644 index 0000000..8fa3bb1 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_23_0.svg @@ -0,0 +1,196 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 0.0005 + + + + + 0.001 + + + + + 0.0015 + + + + + 0.002 + + + + + 0.0025 + + + + + 0 + + + + + 0.005 + + + + + 0.01 + + + + + 0.015 + + + + + 0.02 + + + + + 0.025 + + + + + 0.03 + + + + + 0.035 + + + + + 0.04 + + + + + + + + + gnuplot_plot_1a + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gnuplot_plot_2a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_3_0.svg b/lecture_08/lecture_08_files/lecture_08_3_0.svg new file mode 100644 index 0000000..2c38150 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_3_0.svg @@ -0,0 +1,147 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_6_1.svg b/lecture_08/lecture_08_files/lecture_08_6_1.svg new file mode 100644 index 0000000..ecf7a18 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_6_1.svg @@ -0,0 +1,169 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + gnuplot_plot_3a + + + + + + gnuplot_plot_4a + + + + + + gnuplot_plot_5a + + + + + + gnuplot_plot_6a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_7_1.svg b/lecture_08/lecture_08_files/lecture_08_7_1.svg new file mode 100644 index 0000000..e63011c --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_7_1.svg @@ -0,0 +1,169 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + gnuplot_plot_3a + + + + + + gnuplot_plot_4a + + + + + + gnuplot_plot_5a + + + + + + gnuplot_plot_6a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_8_1.svg b/lecture_08/lecture_08_files/lecture_08_8_1.svg new file mode 100644 index 0000000..873b04d --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_8_1.svg @@ -0,0 +1,169 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + gnuplot_plot_3a + + + + + + gnuplot_plot_4a + + + + + + gnuplot_plot_5a + + + + + + gnuplot_plot_6a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/lecture_08_files/lecture_08_9_1.svg b/lecture_08/lecture_08_files/lecture_08_9_1.svg new file mode 100644 index 0000000..28fd681 --- /dev/null +++ b/lecture_08/lecture_08_files/lecture_08_9_1.svg @@ -0,0 +1,169 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0.04 + + + + + -0.02 + + + + + 0 + + + + + 0.02 + + + + + 0.04 + + + + + 0.06 + + + + + 0.08 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 5.5 + + + + + 6 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + gnuplot_plot_3a + + + + + + gnuplot_plot_4a + + + + + + gnuplot_plot_5a + + + + + + gnuplot_plot_6a + + + + + + + + + + + + + \ No newline at end of file diff --git a/lecture_08/octave-workspace b/lecture_08/octave-workspace index f505b0a7d58e9e91f9e09b3ff78567b472aeda59..990b83a1136bd5adf6926a92d84892e62ba3b9f5 100644 GIT binary patch literal 16015 zcmeHOcUTn3wjZ*fBqa*s5EM`{h!IYkFzqS|n8`tMMiC6-8ZZlrifKi_fC0mbx`rv# zHDF}PnE_Np44@z=hBq^P%DsEt-FN?Zf4xh8-*Betg!-LORoyks4BuGq#s22j=09+x zIULT|IL~+?;c&hx3;zVfh5N<^MTBz$y~F)N{gs4W%oy+Ri14Lh5pgk&T${n79+P-e zZm55FxOcRlXK+Nge+<_o-i#X)v?$EmjO!m66BHT|ZYn2~#P7myLi@79KQX@Eq2AGQ zLz6Tr9(87djHpYbCKC9Qgwut0pNr$=7!kyYVL{>F2@I85liqRNnux4UjE#u(4rN9D z6EAGX2xS=)KOtzR?>!NY#vRHPG5^gYt~u9p1CG0+J%%FgqeY!@OgogW|t@{rXix*t#qH$gTcTHE(^CBlOyl(7n92xZ`_(4 zHypg(F4wP%zgPSEk;~irkk{s?`l()2Co)ei>6m%x5?#{)CYOiklPhI)HbzB;&hHlHB)V}$Ra3A9DfLkrH9ygk zq=oJ2&9Si}8Rnl2tx~PXx;rBdR6VsKg=bxoSD09nH3z)z#kpIPM@y8vCDvJ!t~*xB zlQOMI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