diff --git a/01_Introduction/.ipynb_checkpoints/lecture_01-Copy1-checkpoint.ipynb b/01_Introduction/.ipynb_checkpoints/lecture_01-Copy1-checkpoint.ipynb new file mode 100644 index 0000000..495f361 --- /dev/null +++ b/01_Introduction/.ipynb_checkpoints/lecture_01-Copy1-checkpoint.ipynb @@ -0,0 +1,418 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Freefall Model\n", + "## Octave solution (will run same on Matlab)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [], + "source": [ + "set (0, \"defaultaxesfontname\", \"Helvetica\")\n", + "set (0, \"defaultaxesfontsize\", 18)\n", + "set (0, \"defaulttextfontname\", \"Helvetica\")\n", + "set (0, \"defaulttextfontsize\", 18) \n", + "set (0, \"defaultlinelinewidth\", 4)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Define time from 0 to 12 seconds\n", + "\n", + "t=[0,2,4,6,8,10,12]'" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t =\n", + "\n", + " 0\n", + " 2\n", + " 4\n", + " 6\n", + " 8\n", + " 10\n", + " 12\n", + "\n", + "t =\n", + "\n", + " 0\n", + " 2\n", + " 4\n", + " 6\n", + " 8\n", + " 10\n", + " 12\n", + "\n" + ] + } + ], + "source": [ + "t=[0,2,4,6,8,10,12]'\n", + "% or\n", + "t=[0:2:12]'" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Define constants and analytical solution (meters-kilogram-sec)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_analytical =\n", + "\n", + " 0.00000\n", + " 18.61630\n", + " 32.45521\n", + " 40.64183\n", + " 44.84646\n", + " 46.84974\n", + " 47.77002\n", + "\n" + ] + } + ], + "source": [ + "c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c);\n", + "\n", + "v_analytical = v_terminal*tanh(g*t/v_terminal)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_numerical =\n", + "\n", + " 0.00000\n", + " 19.62000\n", + " 36.03213\n", + " 44.83284\n", + " 47.70298\n", + " 48.35986\n", + " 48.49089\n", + "\n" + ] + } + ], + "source": [ + "v_numerical=zeros(length(t),1);\n", + "for i=1:length(t)-1\n", + " v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*2;\n", + "end\n", + "v_numerical" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Display time, velocity (analytical) and velocity (numerical)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time (s)|vel analytical (m/s)|vel numerical (m/s)\n", + "-----------------------------------------------\n", + " 0.0 | 0.00 | 0.00\n", + " 2.0 | 18.62 | 19.62\n", + " 4.0 | 32.46 | 36.03\n", + " 6.0 | 40.64 | 44.83\n", + " 8.0 | 44.85 | 47.70\n", + " 10.0 | 46.85 | 48.36\n", + " 12.0 | 47.77 | 48.49\n" + ] + } + ], + "source": [ + "fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\\n')\n", + "fprintf('-----------------------------------------------')\n", + "M=[t,v_analytical,v_numerical];\n", + "fprintf('%7.1f | %18.2f | %15.2f\\n',M(:,1:3)');" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t40\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t12\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\t \n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\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": [ + "plot(t,v_analytical,'-',t,v_numerical,'o-')" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/01_Introduction/lecture_01-Copy1.ipynb b/01_Introduction/lecture_01-Copy1.ipynb new file mode 100644 index 0000000..fa4f5eb --- /dev/null +++ b/01_Introduction/lecture_01-Copy1.ipynb @@ -0,0 +1,448 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Freefall Model\n", + "## Octave solution (will run same on Matlab)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "An object falling is subject to the force of \n", + "\n", + "- gravity ($F_g$=mg) and \n", + "- drag ($F_d=cv^2$)\n", + "\n", + "Acceleration of the object:\n", + "\n", + "$\\sum F=ma=F_g-F_d=mg - cv^2 = m\\frac{dv}{dt}$\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Define time from 0 to 12 seconds\n", + "\n", + "t=[0,2,4,6,8,10,12]'" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "t=[0,2,4,6,8,10,12]';\n", + "% or \n", + "t=[0:2:12]';" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### Define constants and analytical solution (meters-kilogram-sec)\n", + "\n", + "g=9.81 m/s$^2$, c=0.25 kg/m, m=60 kg\n", + "\n", + "$v_{terminal}=\\sqrt{\\frac{mg}{c}}$\n", + "\n", + "$v=v_{terminal}\\tanh{\\left(\\frac{gt}{v_{terminal}}\\right)}$" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_terminal = 48.522\n", + "v_analytical =\n", + "\n", + " 0.00000\n", + " 18.61630\n", + " 32.45521\n", + " 40.64183\n", + " 44.84646\n", + " 46.84974\n", + " 47.77002\n", + "\n" + ] + } + ], + "source": [ + "c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c)\n", + "\n", + "v_analytical = v_terminal*tanh(g*t/v_terminal)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### Define numerical method\n", + "#### Finite difference approximation\n", + "\n", + "$\\frac{v(t_{i+1})-v(t_{i})}{t_{i+1}-t_{i}}=g-\\frac{c}{m}v(t_{i})^2$\n", + "\n", + "solve for $v(t_{i+1})$\n", + "\n", + "$v(t_{i+1})=v(t_{i})+\\left(g-\\frac{c}{m}v(t_{i})^2\\right)(t_{i+1}-t_{i})$\n", + "\n", + "or\n", + "\n", + "$v(t_{i+1})=v(t_{i})+\\frac{dv_{i}}{dt}(t_{i+1}-t_{i})$\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_numerical =\n", + "\n", + " 0.00000\n", + " 19.62000\n", + " 36.03213\n", + " 44.83284\n", + " 47.70298\n", + " 48.35986\n", + " 48.49089\n", + "\n" + ] + } + ], + "source": [ + "v_numerical=zeros(length(t),1);\n", + "for i=1:length(t)-1\n", + " v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*2;\n", + "end\n", + "v_numerical" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Display time, velocity (analytical) and velocity (numerical)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time (s)|vel analytical (m/s)|vel numerical (m/s)\n", + "-----------------------------------------------\n", + " 0.0 | 0.00 | 0.00\n", + " 2.0 | 18.62 | 19.62\n", + " 4.0 | 32.46 | 36.03\n", + " 6.0 | 40.64 | 44.83\n", + " 8.0 | 44.85 | 47.70\n", + " 10.0 | 46.85 | 48.36\n", + " 12.0 | 47.77 | 48.49\n" + ] + } + ], + "source": [ + "fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\\n')\n", + "fprintf('-----------------------------------------------')\n", + "M=[t,v_analytical,v_numerical];\n", + "fprintf('%7.1f | %18.2f | %15.2f\\n',M(:,1:3)');" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "set (0, \"defaultaxesfontname\", \"Helvetica\")\n", + "set (0, \"defaultaxesfontsize\", 18)\n", + "set (0, \"defaulttextfontname\", \"Helvetica\")\n", + "set (0, \"defaulttextfontsize\", 18) \n", + "set (0, \"defaultlinelinewidth\", 4)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t40\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t12\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\t \n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\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": [ + "plot(t,v_analytical,'-',t,v_numerical,'o-')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/01_Introduction/lecture_01.ipynb b/01_Introduction/lecture_01.ipynb new file mode 100644 index 0000000..307bc0c --- /dev/null +++ b/01_Introduction/lecture_01.ipynb @@ -0,0 +1,366 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Freefall Model\n", + "## Octave solution (will run same on Matlab)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "set (0, \"defaultaxesfontname\", \"Helvetica\")\n", + "set (0, \"defaultaxesfontsize\", 18)\n", + "set (0, \"defaulttextfontname\", \"Helvetica\")\n", + "set (0, \"defaulttextfontsize\", 18) \n", + "set (0, \"defaultlinelinewidth\", 4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Define time from 0 to 12 seconds" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t =\n", + "\n", + " 0\n", + " 2\n", + " 4\n", + " 6\n", + " 8\n", + " 10\n", + " 12\n", + "\n" + ] + } + ], + "source": [ + "t=[0,2,4,6,8,10,12]'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Define constants and analytical solution (meters-kilogram-sec)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_analytical =\n", + "\n", + " 0.00000\n", + " 18.61630\n", + " 32.45521\n", + " 40.64183\n", + " 44.84646\n", + " 46.84974\n", + " 47.77002\n", + "\n" + ] + } + ], + "source": [ + "c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c);\n", + "\n", + "v_analytical = v_terminal*tanh(g*t/v_terminal)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_numerical =\n", + "\n", + " 0.00000\n", + " 19.62000\n", + " 36.03213\n", + " 44.83284\n", + " 47.70298\n", + " 48.35986\n", + " 48.49089\n", + "\n" + ] + } + ], + "source": [ + "v_numerical=zeros(length(t),1);\n", + "for i=1:length(t)-1\n", + " v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*2;\n", + "end\n", + "v_numerical" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Display time, velocity (analytical) and velocity (numerical)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time (s)|vel analytical (m/s)|vel numerical (m/s)\n", + "-----------------------------------------------\n", + " 0.0 | 0.00 | 0.00\n", + " 2.0 | 18.62 | 19.62\n", + " 4.0 | 32.46 | 36.03\n", + " 6.0 | 40.64 | 44.83\n", + " 8.0 | 44.85 | 47.70\n", + " 10.0 | 46.85 | 48.36\n", + " 12.0 | 47.77 | 48.49\n" + ] + } + ], + "source": [ + "fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\\n')\n", + "fprintf('-----------------------------------------------')\n", + "M=[t,v_analytical,v_numerical];\n", + "fprintf('%7.1f | %18.2f | %15.2f\\n',M(:,1:3)');" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "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\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t40\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t12\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\t \n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\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": [ + "plot(t,v_analytical,'-',t,v_numerical,'o-')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/01_Introduction/lecture_01.md b/01_Introduction/lecture_01.md new file mode 100644 index 0000000..807e888 --- /dev/null +++ b/01_Introduction/lecture_01.md @@ -0,0 +1,111 @@ + +# Freefall Model +## Octave solution (will run same on Matlab) + + +```octave +%plot --format svg +``` + + +```octave +set (0, "defaultaxesfontname", "Helvetica") +set (0, "defaultaxesfontsize", 18) +set (0, "defaulttextfontname", "Helvetica") +set (0, "defaulttextfontsize", 18) +set (0, "defaultlinelinewidth", 4) +``` + +Define time from 0 to 12 seconds + + +```octave +t=[0,2,4,6,8,10,12]' +``` + + t = + + 0 + 2 + 4 + 6 + 8 + 10 + 12 + + + +Define constants and analytical solution (meters-kilogram-sec) + + +```octave +c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c); + +v_analytical = v_terminal*tanh(g*t/v_terminal) +``` + + v_analytical = + + 0.00000 + 18.61630 + 32.45521 + 40.64183 + 44.84646 + 46.84974 + 47.77002 + + + + +```octave +v_numerical=zeros(length(t),1); +for i=1:length(t)-1 + v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*2; +end +v_numerical +``` + + v_numerical = + + 0.00000 + 19.62000 + 36.03213 + 44.83284 + 47.70298 + 48.35986 + 48.49089 + + + +Display time, velocity (analytical) and velocity (numerical) + + +```octave +fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\n') +fprintf('-----------------------------------------------') +M=[t,v_analytical,v_numerical]; +fprintf('%7.1f | %18.2f | %15.2f\n',M(:,1:3)'); +``` + + time (s)|vel analytical (m/s)|vel numerical (m/s) + ----------------------------------------------- + 0.0 | 0.00 | 0.00 + 2.0 | 18.62 | 19.62 + 4.0 | 32.46 | 36.03 + 6.0 | 40.64 | 44.83 + 8.0 | 44.85 | 47.70 + 10.0 | 46.85 | 48.36 + 12.0 | 47.77 | 48.49 + + + +```octave +plot(t,v_analytical,'-',t,v_numerical,'o-') +``` + + +![plot of +velocities](https://github.uconn.edu/rcc02007/ME3255S2017/blob/master/lecture_01/output_10_0.svg) + + diff --git a/01_Introduction/lecture_01.pdf b/01_Introduction/lecture_01.pdf new file mode 100644 index 0000000..c54f29e Binary files /dev/null and b/01_Introduction/lecture_01.pdf differ diff --git a/01_Introduction/lecture_01_notes.pdf b/01_Introduction/lecture_01_notes.pdf new file mode 100644 index 0000000..d84a44d Binary files /dev/null and b/01_Introduction/lecture_01_notes.pdf differ diff --git a/01_Introduction/octave-workspace b/01_Introduction/octave-workspace new file mode 100644 index 0000000..8c437bb Binary files /dev/null and b/01_Introduction/octave-workspace differ diff --git a/01_Introduction/output_10_0.svg b/01_Introduction/output_10_0.svg new file mode 100644 index 0000000..5c7cdea --- /dev/null +++ b/01_Introduction/output_10_0.svg @@ -0,0 +1,143 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 10 + + + + + 20 + + + + + 30 + + + + + 40 + + + + + 50 + + + + + 0 + + + + + 2 + + + + + 4 + + + + + 6 + + + + + 8 + + + + + 10 + + + + + 12 + + + + + + + + + gnuplot_plot_1a + + + + + + gnuplot_plot_2a + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/01_Introduction/\340\204\264\001" "b/01_Introduction/\340\204\264\001" new file mode 100644 index 0000000..e69de29 diff --git "a/01_Introduction/\360\006\336\001" "b/01_Introduction/\360\006\336\001" new file mode 100644 index 0000000..e69de29 diff --git a/02_Roundoff-Truncation errors/.ipynb_checkpoints/lecture_02-checkpoint.ipynb b/02_Roundoff-Truncation errors/.ipynb_checkpoints/lecture_02-checkpoint.ipynb new file mode 100644 index 0000000..e9d80ec --- /dev/null +++ b/02_Roundoff-Truncation errors/.ipynb_checkpoints/lecture_02-checkpoint.ipynb @@ -0,0 +1,533 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Errors in Numerical Modeling\n", + "\n", + "## 1 - Roundoff \n", + "## 2 - Truncation" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# 1- Roundoff" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Just storing a number in a computer requires rounding\n", + "\n", + "1. digital representation of a number is rarely exact\n", + "\n", + "2. arithmetic (+,-,/,\\*) causes roundoff error" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.14159265358979311600\n", + "3.14159274101257324219\n" + ] + } + ], + "source": [ + "fprintf('%1.20f\\n',double(pi)) % 64-bit\n", + "fprintf('%1.20f\\n',single(pi)) % 32-bit" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "realmax = 1.79769313486231570815e+308\n", + "realmin = 2.22507385850720138309e-308\n", + "maximum relative error = 2.22044604925031308085e-16\n" + ] + } + ], + "source": [ + "fprintf('realmax = %1.20e\\n',realmax)\n", + "fprintf('realmin = %1.20e\\n',realmin)\n", + "fprintf('maximum relative error = %1.20e\\n',eps)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Machine epsilon\n", + "\n", + "Smallest number that can be added to 1 and change the value in a computer" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans = 0\n", + "ans = 1.1102e-12\n" + ] + } + ], + "source": [ + "s=1;\n", + "for i=1:10000\n", + " s=s+eps/2;\n", + "end\n", + "s-1\n", + "10000*eps/2" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# 2- Truncation error\n", + "## Freefall is example of \"truncation error\"\n", + "### Truncation error results from approximating exact mathematical procedure\n", + "\n", + "We approximated the derivative as $\\delta v/\\delta t\\approx\\Delta v/\\Delta t$\n", + "\n", + "Can reduce error by decreasing step size -> $\\Delta t$=`delta_time`" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Truncation error as a Taylor series " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Taylor series:\n", + "$f(x)=f(a)+f'(a)(x-a)+\\frac{f''(a)}{2!}(x-a)^{2}+\\frac{f'''(a)}{3!}(x-a)^{3}+...$\n", + "\n", + "We can approximate the next value in a function by adding Taylor series terms:\n", + "\n", + "|Approximation | formula |\n", + "|---|-------------------------|\n", + "|$0^{th}$-order | $f(x_{i+1})=f(x_{i})+R_{1}$ |\n", + "|$1^{st}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+R_{2}$ |\n", + "|$2^{nd}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\\frac{f''(x_{i})}{2!}h^{2}+R_{3}$|\n", + "|$n^{th}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\\frac{f''(x_{i})}{2!}h^{2}+...\\frac{f^{(n)}}{n!}h^{n}+R_{n}$|\n", + "\n", + "Where $R_{n}=O(h^{n+1})$ is the error associated with truncating the approximation at order $n$." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "![3](https://media.giphy.com/media/xA7G2n20MzTOw/giphy.gif)\n", + "\n", + "$n^{th}$-order approximation equivalent to \n", + "an $n^{th}$-order polynomial. " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Thanks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Freefall Model (revisited)\n", + "## Octave solution (will run same on Matlab)\n", + "\n", + "## Create function called `freefall.m`\n", + "\n", + "Define time from 0 to 12 seconds with `N` timesteps \n", + "function defined as `freefall`\n", + "\n", + "m=60 kg, c=0.25 kg/m" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### Set default values in Octave for linewidth and text size" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [], + "source": [ + "set (0, \"defaultaxesfontsize\", 18)\n", + "set (0, \"defaulttextfontsize\", 18) \n", + "set (0, \"defaultlinelinewidth\", 4)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Freefall example\n", + "\n", + "Estimated the function with a $1^{st}$-order approximation, so \n", + "\n", + "$v(t_{i+1})=v(t_{i})+v'(t_{i})(t_{i+1}-t_{i})+R_{1}$\n", + "\n", + "$v'(t_{i})=\\frac{v(t_{i+1})-v(t_{i})}{t_{i+1}-t_{i}}-\\frac{R_{1}}{t_{i+1}-t_{i}}$\n", + "\n", + "$\\frac{R_{1}}{t_{i+1}-t_{i}}=\\frac{v''(\\xi)}{2!}(t_{i+1}-t_{i})$\n", + "\n", + "or the truncation error for a first-order Taylor series approximation is\n", + "\n", + "$\\frac{R_{1}}{t_{i+1}-t_{i}}=O(\\Delta t)$\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "function [v_analytical,v_terminal,t]=freefall(N)\n", + " t=linspace(0,12,N)';\n", + " c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c);\n", + "\n", + " v_analytical = v_terminal*tanh(g*t/v_terminal);\n", + " v_numerical=zeros(length(t),1);\n", + " delta_time =diff(t);\n", + " for i=1:length(t)-1\n", + " v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*delta_time(i);\n", + " end\n", + " % Print values near 0,2,4,6,8,10,12 seconds\n", + " indices = round(linspace(1,length(t),7));\n", + " fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\\n')\n", + " fprintf('-----------------------------------------------\\n')\n", + " M=[t(indices),v_analytical(indices),v_numerical(indices)];\n", + " fprintf('%7.1f | %18.2f | %15.2f\\n',M(:,1:3)');\n", + " plot(t,v_analytical,'-',t,v_numerical,'o-')\n", + "end\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time (s)|vel analytical (m/s)|vel numerical (m/s)\n", + "-----------------------------------------------\n", + " 0.0 | 0.00 | 0.00\n", + " 2.2 | 20.12 | 20.88\n", + " 4.4 | 34.33 | 36.32\n", + " 6.5 | 42.10 | 44.08\n", + " 7.6 | 44.29 | 45.95\n", + " 9.8 | 46.72 | 47.69\n", + " 12.0 | 47.77 | 48.26\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\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t40\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t12\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\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", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "[v_analytical,v_terminal,t]=freefall(12);" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/02_Roundoff-Truncation errors/README.md b/02_Roundoff-Truncation errors/README.md new file mode 100644 index 0000000..12365ce --- /dev/null +++ b/02_Roundoff-Truncation errors/README.md @@ -0,0 +1,174 @@ + +# Solution to Form #1 + + +```octave +[1,2,3]*[1;2;3] +``` + + ans = + + 14 + + + + +```octave +[1,2,3]*[1;2;3]=? +``` + + +```octave + +``` + +# The first source of error is roundoff error +## Just storing a number in a computer requires rounding + + +```octave +fprintf('realmax = %1.20e\n',realmax) +fprintf('realmin = %1.20e\n',realmin) +fprintf('maximum relative error = %1.20e\n',eps) + +``` + + realmax = 1.79769313486231570815e+308 + realmin = 2.22507385850720138309e-308 + maximum relative error = 2.22044604925031308085e-16 + + + +```octave +s=1; +for i=1:1000 + s=s+eps/10; +end +s==1 +``` + + ans = 1 + + +# Freefall Model (revisited) +## Octave solution (will run same on Matlab) + +Set default values in Octave for linewidth and text size + + +```octave +%plot --format svg +``` + + +```octave +set (0, "defaultaxesfontname", "Helvetica") +set (0, "defaultaxesfontsize", 18) +set (0, "defaulttextfontname", "Helvetica") +set (0, "defaulttextfontsize", 18) +set (0, "defaultlinelinewidth", 4) +``` + +Define time from 0 to 12 seconds with `N` timesteps +function defined as `freefall` + + +```octave +function [v_analytical,v_terminal,t]=freefall(N) + t=linspace(0,12,N)'; + c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c); + + v_analytical = v_terminal*tanh(g*t/v_terminal); + v_numerical=zeros(length(t),1); + delta_time =diff(t); + for i=1:length(t)-1 + v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*delta_time(i); + end + % Print values near 0,2,4,6,8,10,12 seconds + indices = round(linspace(1,length(t),7)); + fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\n') + fprintf('-----------------------------------------------\n') + M=[t(indices),v_analytical(indices),v_numerical(indices)]; + fprintf('%7.1f | %18.2f | %15.2f\n',M(:,1:3)'); + plot(t,v_analytical,'-',t,v_numerical,'o-') +end + +``` + + +```octave +[v_analytical,v_terminal,t]=freefall(120); +``` + + time (s)|vel analytical (m/s)|vel numerical (m/s) + ----------------------------------------------- + 0.0 | 0.00 | 0.00 + 2.0 | 18.76 | 18.82 + 4.0 | 32.64 | 32.80 + 6.1 | 40.79 | 40.97 + 8.0 | 44.80 | 44.94 + 10.0 | 46.84 | 46.93 + 12.0 | 47.77 | 47.82 + + + +![svg](output_13_1.svg) + + +# Types of error +## Freefall is example of "truncation error" +### Truncation error results from approximating exact mathematical procedure + +We approximated the derivative as $\delta v/\delta t\approx\Delta v/\Delta t$ + +Can reduce error by decreasing step size -> $\Delta t$=`delta_time` + +## Another example of truncation error is a Taylor series (or Maclaurin if centered at a=0) + +Taylor series: +$f(x)=f(a)+f'(a)(x-a)+\frac{f''(a)}{2!}(x-a)^{2}+\frac{f'''(a)}{3!}(x-a)^{3}+...$ + +We can approximate the next value in a function by adding Taylor series terms: + +|Approximation | formula | +|---|-------------------------| +|$0^{th}$-order | $f(x_{i+1})=f(x_{i})+R_{1}$ | +|$1^{st}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+R_{2}$ | +|$2^{nd}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\frac{f''(x_{i})}{2!}h^{2}+R_{3}$| +|$n^{th}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\frac{f''(x_{i})}{2!}h^{2}+...\frac{f^{(n)}}{n!}h^{n}+R_{n}$| + +Where $R_{n}=\frac{f^{(n+1)}(\xi)}{(n+1)!}h^{n+1}$ is the error associated with truncating the approximation at order $n$. + +The $n^{th}$-order approximation estimates that the unknown function, $f(x)$, is equal to an $n^{th}$-order polynomial. + +In the Freefall example, we estimated the function with a $1^{st}$-order approximation, so + +$v(t_{i+1})=v(t_{i})+v'(t_{i})(t_{i+1}-t_{i})+R_{1}$ + +$v'(t_{i})=\frac{v(t_{i+1})-v(t_{i})}{t_{i+1}-t_{i}}-\frac{R_{1}}{t_{i+1}-t_{i}}$ + +$\frac{R_{1}}{t_{i+1}-t_{i}}=\frac{v''(\xi)}{2!}(t_{i+1}-t_{i})$ + +or the truncation error for a first-order Taylor series approximation is + +$\frac{R_{1}}{t_{i+1}-t_{i}}=O(\Delta t)$ + + +1. digital representation of a number is rarely exact + +2. arithmetic (+,-,/,\*) causes roundoff error + + +```octave +fprintf('%1.20f\n',double(pi)) +fprintf('%1.20f\n',single(pi)) +``` + + 3.14159265358979311600 + 3.14159274101257324219 + + + +```octave + +``` diff --git a/02_Roundoff-Truncation errors/lecture_02.ipynb b/02_Roundoff-Truncation errors/lecture_02.ipynb new file mode 100644 index 0000000..e9d80ec --- /dev/null +++ b/02_Roundoff-Truncation errors/lecture_02.ipynb @@ -0,0 +1,533 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Errors in Numerical Modeling\n", + "\n", + "## 1 - Roundoff \n", + "## 2 - Truncation" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# 1- Roundoff" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Just storing a number in a computer requires rounding\n", + "\n", + "1. digital representation of a number is rarely exact\n", + "\n", + "2. arithmetic (+,-,/,\\*) causes roundoff error" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.14159265358979311600\n", + "3.14159274101257324219\n" + ] + } + ], + "source": [ + "fprintf('%1.20f\\n',double(pi)) % 64-bit\n", + "fprintf('%1.20f\\n',single(pi)) % 32-bit" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "realmax = 1.79769313486231570815e+308\n", + "realmin = 2.22507385850720138309e-308\n", + "maximum relative error = 2.22044604925031308085e-16\n" + ] + } + ], + "source": [ + "fprintf('realmax = %1.20e\\n',realmax)\n", + "fprintf('realmin = %1.20e\\n',realmin)\n", + "fprintf('maximum relative error = %1.20e\\n',eps)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Machine epsilon\n", + "\n", + "Smallest number that can be added to 1 and change the value in a computer" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans = 0\n", + "ans = 1.1102e-12\n" + ] + } + ], + "source": [ + "s=1;\n", + "for i=1:10000\n", + " s=s+eps/2;\n", + "end\n", + "s-1\n", + "10000*eps/2" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# 2- Truncation error\n", + "## Freefall is example of \"truncation error\"\n", + "### Truncation error results from approximating exact mathematical procedure\n", + "\n", + "We approximated the derivative as $\\delta v/\\delta t\\approx\\Delta v/\\Delta t$\n", + "\n", + "Can reduce error by decreasing step size -> $\\Delta t$=`delta_time`" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Truncation error as a Taylor series " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Taylor series:\n", + "$f(x)=f(a)+f'(a)(x-a)+\\frac{f''(a)}{2!}(x-a)^{2}+\\frac{f'''(a)}{3!}(x-a)^{3}+...$\n", + "\n", + "We can approximate the next value in a function by adding Taylor series terms:\n", + "\n", + "|Approximation | formula |\n", + "|---|-------------------------|\n", + "|$0^{th}$-order | $f(x_{i+1})=f(x_{i})+R_{1}$ |\n", + "|$1^{st}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+R_{2}$ |\n", + "|$2^{nd}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\\frac{f''(x_{i})}{2!}h^{2}+R_{3}$|\n", + "|$n^{th}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\\frac{f''(x_{i})}{2!}h^{2}+...\\frac{f^{(n)}}{n!}h^{n}+R_{n}$|\n", + "\n", + "Where $R_{n}=O(h^{n+1})$ is the error associated with truncating the approximation at order $n$." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "![3](https://media.giphy.com/media/xA7G2n20MzTOw/giphy.gif)\n", + "\n", + "$n^{th}$-order approximation equivalent to \n", + "an $n^{th}$-order polynomial. " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Thanks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Freefall Model (revisited)\n", + "## Octave solution (will run same on Matlab)\n", + "\n", + "## Create function called `freefall.m`\n", + "\n", + "Define time from 0 to 12 seconds with `N` timesteps \n", + "function defined as `freefall`\n", + "\n", + "m=60 kg, c=0.25 kg/m" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### Set default values in Octave for linewidth and text size" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [], + "source": [ + "set (0, \"defaultaxesfontsize\", 18)\n", + "set (0, \"defaulttextfontsize\", 18) \n", + "set (0, \"defaultlinelinewidth\", 4)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Freefall example\n", + "\n", + "Estimated the function with a $1^{st}$-order approximation, so \n", + "\n", + "$v(t_{i+1})=v(t_{i})+v'(t_{i})(t_{i+1}-t_{i})+R_{1}$\n", + "\n", + "$v'(t_{i})=\\frac{v(t_{i+1})-v(t_{i})}{t_{i+1}-t_{i}}-\\frac{R_{1}}{t_{i+1}-t_{i}}$\n", + "\n", + "$\\frac{R_{1}}{t_{i+1}-t_{i}}=\\frac{v''(\\xi)}{2!}(t_{i+1}-t_{i})$\n", + "\n", + "or the truncation error for a first-order Taylor series approximation is\n", + "\n", + "$\\frac{R_{1}}{t_{i+1}-t_{i}}=O(\\Delta t)$\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "function [v_analytical,v_terminal,t]=freefall(N)\n", + " t=linspace(0,12,N)';\n", + " c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c);\n", + "\n", + " v_analytical = v_terminal*tanh(g*t/v_terminal);\n", + " v_numerical=zeros(length(t),1);\n", + " delta_time =diff(t);\n", + " for i=1:length(t)-1\n", + " v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*delta_time(i);\n", + " end\n", + " % Print values near 0,2,4,6,8,10,12 seconds\n", + " indices = round(linspace(1,length(t),7));\n", + " fprintf('time (s)|vel analytical (m/s)|vel numerical (m/s)\\n')\n", + " fprintf('-----------------------------------------------\\n')\n", + " M=[t(indices),v_analytical(indices),v_numerical(indices)];\n", + " fprintf('%7.1f | %18.2f | %15.2f\\n',M(:,1:3)');\n", + " plot(t,v_analytical,'-',t,v_numerical,'o-')\n", + "end\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time (s)|vel analytical (m/s)|vel numerical (m/s)\n", + "-----------------------------------------------\n", + " 0.0 | 0.00 | 0.00\n", + " 2.2 | 20.12 | 20.88\n", + " 4.4 | 34.33 | 36.32\n", + " 6.5 | 42.10 | 44.08\n", + " 7.6 | 44.29 | 45.95\n", + " 9.8 | 46.72 | 47.69\n", + " 12.0 | 47.77 | 48.26\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\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t40\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t12\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\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", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "[v_analytical,v_terminal,t]=freefall(12);" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/02_Roundoff-Truncation errors/lecture_02.pdf b/02_Roundoff-Truncation errors/lecture_02.pdf new file mode 100644 index 0000000..edad8fc Binary files /dev/null and b/02_Roundoff-Truncation errors/lecture_02.pdf differ diff --git a/02_Roundoff-Truncation errors/notes.pdf b/02_Roundoff-Truncation errors/notes.pdf new file mode 100755 index 0000000..66e503c Binary files /dev/null and b/02_Roundoff-Truncation errors/notes.pdf differ diff --git a/02_Roundoff-Truncation errors/octave-workspace b/02_Roundoff-Truncation errors/octave-workspace new file mode 100644 index 0000000..8c437bb Binary files /dev/null and b/02_Roundoff-Truncation errors/octave-workspace differ diff --git a/03_Intro to matlab-octave/.ipynb_checkpoints/lecture_03-checkpoint.ipynb b/03_Intro to matlab-octave/.ipynb_checkpoints/lecture_03-checkpoint.ipynb new file mode 100644 index 0000000..1b7c1ae --- /dev/null +++ b/03_Intro to matlab-octave/.ipynb_checkpoints/lecture_03-checkpoint.ipynb @@ -0,0 +1,5449 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true, + "scrolled": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Matlab/Octave basic use" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Matlab environment can be called by:\n", + "\n", + "1. Starting the matlab executable (the gui)\n", + "2. Starting a jupyter notebook with Matlab kernel\n", + "3. Starting matlab with command-line interface (no gui)\n", + "\n", + "Main requirement = matlab kernel (main matlab program) is running and accepting commands\n", + "\n", + "Once started call\n", + "\n", + "1. matlab built-in functions \n", + "2. anything you write in your `MATLABPATH` or \n", + "3. working directory (`pwd`)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Octave's search path contains the following directories:\n", + "\n", + ".\n", + "/usr/local/lib/python2.7/dist-packages/octave_kernel\n", + "/home/ryan/Documents/MATLAB\n", + "/usr/lib/x86_64-linux-gnu/octave/4.0.0/site/oct/x86_64-pc-linux-gnu\n", + "/usr/lib/x86_64-linux-gnu/octave/site/oct/api-v50+/x86_64-pc-linux-gnu\n", + "/usr/lib/x86_64-linux-gnu/octave/site/oct/x86_64-pc-linux-gnu\n", + "/usr/share/octave/4.0.0/site/m\n", + "/usr/share/octave/site/api-v50+/m\n", + "/usr/share/octave/site/m\n", + "/usr/share/octave/site/m/startup\n", + "/usr/lib/x86_64-linux-gnu/octave/4.0.0/oct/x86_64-pc-linux-gnu\n", + "/usr/share/octave/4.0.0/m\n", + "/usr/share/octave/4.0.0/m/audio\n", + "/usr/share/octave/4.0.0/m/debian\n", + "/usr/share/octave/4.0.0/m/deprecated\n", + "/usr/share/octave/4.0.0/m/elfun\n", + "/usr/share/octave/4.0.0/m/general\n", + "/usr/share/octave/4.0.0/m/geometry\n", + "/usr/share/octave/4.0.0/m/gui\n", + "/usr/share/octave/4.0.0/m/help\n", + "/usr/share/octave/4.0.0/m/image\n", + "/usr/share/octave/4.0.0/m/io\n", + "/usr/share/octave/4.0.0/m/java\n", + "/usr/share/octave/4.0.0/m/linear-algebra\n", + "/usr/share/octave/4.0.0/m/miscellaneous\n", + "/usr/share/octave/4.0.0/m/optimization\n", + "/usr/share/octave/4.0.0/m/path\n", + "/usr/share/octave/4.0.0/m/pkg\n", + "/usr/share/octave/4.0.0/m/plot\n", + "/usr/share/octave/4.0.0/m/plot/appearance\n", + "/usr/share/octave/4.0.0/m/plot/draw\n", + "/usr/share/octave/4.0.0/m/plot/util\n", + "/usr/share/octave/4.0.0/m/polynomial\n", + "/usr/share/octave/4.0.0/m/prefs\n", + "/usr/share/octave/4.0.0/m/set\n", + "/usr/share/octave/4.0.0/m/signal\n", + "/usr/share/octave/4.0.0/m/sparse\n", + "/usr/share/octave/4.0.0/m/specfun\n", + "/usr/share/octave/4.0.0/m/special-matrix\n", + "/usr/share/octave/4.0.0/m/startup\n", + "/usr/share/octave/4.0.0/m/statistics\n", + "/usr/share/octave/4.0.0/m/statistics/base\n", + "/usr/share/octave/4.0.0/m/statistics/distributions\n", + "/usr/share/octave/4.0.0/m/statistics/models\n", + "/usr/share/octave/4.0.0/m/statistics/tests\n", + "/usr/share/octave/4.0.0/m/strings\n", + "/usr/share/octave/4.0.0/m/testfun\n", + "/usr/share/octave/4.0.0/m/time\n", + "/usr/share/octave/4.0.0/data\n", + "\n" + ] + } + ], + "source": [ + "path" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans = /home/ryan/Documents/UConn/ME3255/course_git_S2017/03_Intro to matlab-octave\r\n" + ] + } + ], + "source": [ + "pwd" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Assignments (`=`-operator)\n", + "\n", + "Matlab is interpreted language \n", + "\n", + "each line of code (either saved text file or command-line) is executed as a standalone command\n", + "\n", + "These are reffered to \"scripts\"" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 40\n" + ] + } + ], + "source": [ + "a=10; % line one assigns a to 10\n", + "b=a*3; % line two assigns b to 10 times 3 by calling 'a' from line one\n", + "a+b % line three does not assign anything directly, but leaving off the \";\" prints the result\n", + " % ans" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Matlab has a number of \"objects\" that you can assign to variables\n", + "1. arrays (vectors and matrices `[`...`]`) \n", + "3. cells (combination of strings, text, even function calls `{`...`}`)\n", + "2. strings (text `\"`...`\"` )\n", + "3. functions (both built-in, defined or developed)\n", + "4. and more... (classes defined by `classdef` - you can create your own object to help organize data)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### 1- Arrays\n", + "\n", + "Default in matlab is that when you assign a value to a variable, it is stored as an array\n", + "\n", + "arrays are N x M x ... values of integers or floating point numbers or complex integers/floating point numbers\n", + "\n", + "Use the parantheses to access values in an array `...(n,m)`" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A =\n", + "\n", + " 1 2 3\n", + " 4 5 6\n", + " 7 8 9\n", + " 10 11 12\n", + "\n", + "size of A is 4 x 3\n", + "\n", + "ans =\n", + "\n", + " 7\n", + "\n", + "\n", + "ans =\n", + "\n", + " 5\n" + ] + } + ], + "source": [ + "A = [1 2 3;4,5,6;7,8,9;10,11,12]\n", + "fprintf('size of A is %i x %i\\n',size(A))\n", + "A(3,1)\n", + "A(6)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1\n" + ] + } + ], + "source": [ + "a=10; % a is 1x1 array where a(1,1)==10\n", + "a(1,1)==10\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 2. Cells \n", + "### combine different size arrays and text\n", + "\n", + "you cannot use math operators 'binary operators'" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [], + "source": [ + "C={};\n", + "C{1}=linspace(0,1,10);\n", + "C{2}=linspace(0,1,3);\n", + "C{'z'}='holy cow';" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 3.5185\n" + ] + } + ], + "source": [ + "C{1}*C{1}'" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 3. Strings \n", + "### can be combined and printed" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + "computational mechanics\n" + ] + } + ], + "source": [ + "string1 = 'computational'; string2 = 'mechanics';\n", + "[string1, ' ', string2]" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "use `fprintf` to format strings and numbers for output and `sprintf` to save variables\n" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "computational mechanics\n", + "\n", + "\n", + "string =\n", + "\n", + "the dog had 4 legs and weighed 10.0 lbs\n" + ] + } + ], + "source": [ + "fprintf([string1,' ',string2,'\\n\\n'])\n", + "string = sprintf('the dog had %i legs and weighed %1.1f lbs',4,10.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 4. Functions \n", + "### Some built in Matlab functions \n", + "**(i.e. the reasons to run Matlab)** " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Math operators (=, +, -, /, *, ^)\n", + "\n", + "Matlab assumes all variables are matrices\n", + "\n", + "all operators are matrix operations functions" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 3 3\n", + "\n", + "error: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x2)\n" + ] + } + ], + "source": [ + "1+[2,2]\n", + "1/[2,2]" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Thanks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Further Examples of Arrays and Functions" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "fragment" + } + }, + "source": [ + "vectors are either 1xN or Nx1 arrays for row and column" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_row =\n", + "\n", + " 1 2 3\n", + "\n", + "\n", + "v_column =\n", + "\n", + " 1\n", + " 2\n", + " 3\n" + ] + } + ], + "source": [ + "v_row = [1,2,3] %row vector\n", + "v_column = [1;2;3] %column vector\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "Matrices are MxN arrays\n", + "the `:`-symbol can substitute for a counting" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A =\n", + "\n", + " 1 2 3\n", + " 4 5 6\n", + " 7 8 9\n", + " 10 11 12\n", + "\n", + "ans =\n", + "\n", + " 1\n", + " 4\n", + " 7\n", + " 10\n", + "\n" + ] + } + ], + "source": [ + "A = [1 2 3;4,5,6;7,8,9;10,11,12]\n", + "A(:,1) % the colon assumes you want the first value, 1, counting up by 1 to the last value, 4" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "You can also use every 2nd value or any other integer up to `end` which is the largest value of that row or column of the array" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1\n", + " 7\n" + ] + } + ], + "source": [ + "A(1:2:end,1) % you can also use `end` " + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1\n", + " 4\n", + " 7\n", + " 10\n", + " 2\n", + " 5\n", + " 8\n", + " 11\n", + " 3\n", + " 6\n", + " 9\n", + " 12\n" + ] + } + ], + "source": [ + "A(:)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "In general, arrays can be any size \n", + "\n", + "take rolling 4 die and determining the sum of the components" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "A_6666 = zeros(6,6,6,6); %make a 6 x 6 x 6 x 6 array (1296 different values)\n", + "for i=1:6\n", + " for j=1:6\n", + " for k=1:6\n", + " for l=1:6\n", + " A_6666(i,j,k,l)=i+j+k+l; % each value is the sum of the indices\n", + " end\n", + " end\n", + " end\n", + "end\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 14\n", + "\n", + "\n", + "ans =\n", + "\n", + " 3.4170\n" + ] + } + ], + "source": [ + "mean(A_6666(:))\n", + "std(A_6666(:))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 12\n" + ] + } + ], + "source": [ + "A_6666(1,4,2,5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## This is helpful to create reports of computed data\n", + "\n", + "the `\\` signifies a special character e.g. `\\n` = newline, `\\t` = tab\n", + "\n", + "to actually print the \"\\\", use `\\\\`" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\\\n" + ] + } + ], + "source": [ + "fprintf('\\\\')" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false, + "scrolled": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[0;31mUndefined function or variable 'fid'.\n", + "\u001b[0m" + ] + } + ], + "source": [ + "%fid = fopen('file.txt','w');\n", + "fprintf(fid,[string1, ' ', string2])\n", + "fprintf(fid,'\\n')\n", + "fprintf(fid,string)\n", + "fprintf(fid,'\\n')\n", + "fprintf(fid,'are you awake?')" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 20\n" + ] + } + ], + "source": [ + "a=10;\n", + "a+a % add two 1x1 arrays" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 2 4 6\n", + " 8 10 12\n", + " 14 16 18\n", + " 20 22 24\n" + ] + } + ], + "source": [ + "A = [1 2 3;4,5,6;7,8,9;10,11,12];\n", + "A+A % add two 4 x 3 arrays" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 14 32 50 68\n", + " 32 77 122 167\n", + " 50 122 194 266\n", + " 68 167 266 365\n" + ] + } + ], + "source": [ + "A*A'" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1 4 9\n", + " 16 25 36\n", + " 49 64 81\n", + " 100 121 144\n" + ] + } + ], + "source": [ + "A.^2" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1 4 9\n", + " 16 25 36\n", + " 49 64 81\n", + " 100 121 144\n" + ] + } + ], + "source": [ + "A.*A" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\b> In pymat_eval (line 31)\n", + " In matlabserver (line 24)]\b \n", + "[\bWarning: Rank deficient, rank = 2, tol = 1.696862e-14.]\b \n", + "\n", + "ans =\n", + "\n", + " 1.0000 0 0 -0.0000\n", + " 0.6667 0 0 0.3333\n", + " 0.3333 0 0 0.6667\n", + " 0.0000 0 0 1.0000\n" + ] + } + ], + "source": [ + "A/A" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/ Slash or right matrix divide.\n", + " A/B is the matrix division of B into A, which is roughly the\n", + " same as A*INV(B) , except it is computed in a different way.\n", + " More precisely, A/B = (B'\\A')'. See MLDIVIDE for details.\n", + " \n", + " C = MRDIVIDE(A,B) is called for the syntax 'A / B' when A or B is an\n", + " object.\n", + " \n", + " See also MLDIVIDE, RDIVIDE, LDIVIDE.\n", + "\n", + " Reference page in Doc Center\n", + " doc mrdivide\n", + "\n", + " Other functions named mrdivide\n", + "\n", + " codistributed/mrdivide gf/mrdivide laurpoly/mrdivide\n", + " duration/mrdivide gpuArray/mrdivide StaticModel/mrdivide\n", + " DynamicSystem/mrdivide LagOp/mrdivide timeseries/mrdivide\n", + " fints/mrdivide\n" + ] + } + ], + "source": [ + "help /" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1 1 1\n", + " 1 1 1\n", + " 1 1 1\n", + " 1 1 1\n" + ] + } + ], + "source": [ + "% element-by-element operation with '.'\n", + "A./A" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "But, for 1x1 arrays, these are considered scalars and you get a free-pass" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 10 20 30\n", + " 40 50 60\n", + " 70 80 90\n", + " 100 110 120\n" + ] + } + ], + "source": [ + "a*A % where a=10 and A is 1:12 in a 3 x 4 matrix" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 4.con'd Other built-in functions" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t_linear =\n", + "\n", + " Columns 1 through 7\n", + "\n", + " 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000\n", + "\n", + " Columns 8 through 11\n", + "\n", + " 0.7000 0.8000 0.9000 1.0000\n" + ] + } + ], + "source": [ + "t_linear=linspace(0,1,11)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t_log =\n", + "\n", + " 1 10 100\n" + ] + } + ], + "source": [ + "t_log = logspace(0,2,3) % log interval from 10^0 to 10^2 split into 3 values" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "LOGSPACE Logarithmically spaced vector.\n", + " LOGSPACE(X1, X2) generates a row vector of 50 logarithmically\n", + " equally spaced points between decades 10^X1 and 10^X2. If X2\n", + " is pi, then the points are between 10^X1 and pi.\n", + " \n", + " LOGSPACE(X1, X2, N) generates N points.\n", + " For N = 1, LOGSPACE returns 10^X2.\n", + " \n", + " Class support for inputs X1,X2:\n", + " float: double, single\n", + " \n", + " See also LINSPACE, COLON.\n", + "\n", + " Reference page in Doc Center\n", + " doc logspace\n", + "\n", + " Other functions named logspace\n", + "\n", + " codistributed.logspace distributed.logspace\n", + " codistributor1d/logspace gpuArray/logspace\n", + " codistributor2dbc/logspace\n" + ] + } + ], + "source": [ + "help logspace" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 4.con'd scripts, functions or classes (to define objects)\n", + "\n", + "When using the GUI, your command history is saved, \n", + "\n", + "Best practice: save your work either as a script or a function or combination of both\n", + "\n", + "Creating a default graph script:" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": true, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "set(0, 'defaultAxesFontSize', 16)\n", + "set(0,'defaultTextFontSize',14)\n", + "set(0,'defaultLineLineWidth',3)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjAAAAGkCAIAAACgjIjwAAAACXBIWXMAABcSAAAXEgFnn9JSAAAA\nB3RJTUUH4QUfFCcixdxSEwAAACR0RVh0U29mdHdhcmUATUFUTEFCLCBUaGUgTWF0aFdvcmtzLCBJ\nbmMuPFjdGAAAACJ0RVh0Q3JlYXRpb24gVGltZQAzMS1NYXktMjAxNyAxNjozOTozNKYQAKQAACAA\nSURBVHic7d17QFRlwj/wx5nh5ighggr8eLl4ARUCSZS1vIClRZq3fCWtFHfNjTDTddPEVEwt03JN\nxVwT8FJpRt4tLAlX41VAKC94JWBZGFAu7iAwMMzw++PxPe/sMHNmzlzPzHw/fz2cOZenbXa+Pc95\nLt06OzsJAACAtQmsXQEAAABCEEgAAMATCCQAAOAFBBIAAPACAgkAAHgBgQQAALyAQAIAAF5AIAEA\nAC8gkAAAgBcQSAAAwAsIJAAA4AUEEgAA8AICCQAAeAGBBAAAvIBAAgAAXkAgAQAALyCQAACAF0TG\nXCyXy5uamuRyuUKhcHJycnJycnd3FwhsO+QUCoVSqSSECAQCoVBo7eoAADgKzoFUWVn52WefXbly\npb6+XiaTdT1BLBb36dPnhRdeSEhI6Nu3rykqaV5yuTwvL+/evXtXr1799ddfa2pq6PGpU6du2rTJ\nunUDAHAc3To7O/U5r7q6+t133y0qKlIoFPrf3c3NLT4+funSpV5eXobW0LzOnj27aNEijR8hkAAA\nLEl399pPP/00atSo2NjYgoICTmlECGltbc3Kynr66afj4uJ+//13QytpRh0dHWpH0E0HAGAVbF12\nP/3004o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H5/jx4+bryoAAFakbTFvrORtMWi4AABoHciAObCWhEACANA6kAFp\nZEkIJABwdBjIwBMIJABwaCyLeSONLIzbKDs19+7dS0lJaWxslMvlSqVywIABe/fuNVXNAADMDYt5\n84qBgbR27dqvv/5a7WDPnj3VjkRFRTU3NxNCLl++7OHhYdizAADMBIt58wrnLjulUhkVFdU1jTRa\nunQpLezatYvrgwAAzAqLefMN50AKDw+njR5CiFAoDAgIiIyM1HbyjBkzaOHUqVOG1Q8AwBwwkIGH\nuHXZJSUldXR00PLKlSvnzp1Ly5GRka2trV3Pd3Nz8/Pzq6qqqqurk8vlTk5ORlYXAMB4iYduYjFv\nHuLQQnr06NG5c+do+YsvvmDSiF1Q0OMXgw8ePOBaOQAAk0vNLssskHQ9jsW8rY5DIOXn59PC+PHj\nR48eredVzGukxsZGTjUDADA5besDEUIyEoZYuDKghkMgbd++nRbee+89/a8Si8W00NbWpv9VAAAm\nl1vaqHGQNyHk56RhgZ6uFq4PqOEQSMxbol69DOljzczMNOAqAACTKG+QxaYVa/wIAxl4wuwrNTAx\nNmfOHHM/CwBAm9hdRRqPI434g0Mgubm50UJTU5P+V23ZsoUWMDEWAKyFZcoR0og/OATS1KlTaeHY\nsWP6X1Vc/LiN7O3trf9VAACmom3KETY64hsOgfT888/Twueff67nJVlZWXQWrZubm6enJ9fKAQAY\niSWNMMibbzgEUt++fb28vAghMpls4cKFOs8vLCxcuXIlLc+fP9+w+gEAGEzbBFhMOeInboMa0tLS\naCE3N/fpp5++d++extPa2to2bNjAjGIQiURvv/22MbUEAOBK2wTYQE/Xn5OiLF8f0Inb0kERERHz\n589PT08nhNTV1b344otubm5eXl50KN3du3enTZvW0NBQU1OjetWhQ4dMWGMAAJ1YJ8CibcRTnLef\nWL58uVAo3LNnD/2ztbW1srKS+bSkRH0b4IyMjPDwcGOqCADAibZdjggGefObIfOQli1b9v3339P3\nSSwGDRp05cqVUaNGGVQxAABDlDfIkEY2ysAN+oKDg3/55ReJRHLkyJETJ048evSI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3/+ea9evfr06bNy5UoT\n3hbsG94hAQAAL6CFBAAAvIBAAgAAXvj/u/Oe9/l6M9wAAAAASUVORK5CYII=\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plot(t_linear,t_linear.^2)\n", + "xlabel('time (s)')\n", + "ylabel('displacement (m)')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Graphics can be produced with a number of functions\n", + "\n", + "2-D plots, 3-D plots, contour plots, 3D contour plots ... " + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "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\t-1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_3a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_4a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_5a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_6a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_7a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_8a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_9a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_10a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_11a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_12a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_13a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_14a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_15a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_16a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_17a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_18a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_19a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_20a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_21a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_22a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_23a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_24a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_25a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_26a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_27a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_28a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_29a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_30a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_31a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_32a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_33a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_34a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_35a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_36a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_37a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_38a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_39a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_40a\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "x=linspace(-1,1,21); y=linspace(-1,1,21);\n", + "[X,Y]=meshgrid(x,y);\n", + "Z=(X.*Y.^3-X.^3.*Y);\n", + "\n", + "contour(X,Y,Z)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "mesh(X,Y,Z)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "pcolor(X,Y,Z)" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/03_Intro to matlab-octave/file.txt b/03_Intro to matlab-octave/file.txt new file mode 100644 index 0000000..0fb2c92 --- /dev/null +++ b/03_Intro to matlab-octave/file.txt @@ -0,0 +1,5 @@ +computational mechanics +the dog had 4 legs and weighed 10.0 lbs +are you awake?computational mechanics +the dog had 4 legs and weighed 10.0 lbs +are you awake? \ No newline at end of file diff --git a/03_Intro to matlab-octave/lecture_03.ipynb b/03_Intro to matlab-octave/lecture_03.ipynb new file mode 100644 index 0000000..f24b27f --- /dev/null +++ b/03_Intro to matlab-octave/lecture_03.ipynb @@ -0,0 +1,5491 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": true, + "scrolled": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Matlab/Octave basic use" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Matlab environment can be called by:\n", + "\n", + "1. Starting the matlab executable (the gui)\n", + "2. Starting a jupyter notebook with Matlab kernel\n", + "3. Starting matlab with command-line interface (no gui)\n", + "\n", + "Main requirement = matlab kernel (main matlab program) is running and accepting commands\n", + "\n", + "Once started call\n", + "\n", + "1. matlab built-in functions \n", + "2. anything you write in your `MATLABPATH` or \n", + "3. working directory (`pwd`)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Octave's search path contains the following directories:\n", + "\n", + ".\n", + "/usr/local/lib/python2.7/dist-packages/octave_kernel\n", + "/home/ryan/Documents/MATLAB\n", + "/usr/lib/x86_64-linux-gnu/octave/4.0.0/site/oct/x86_64-pc-linux-gnu\n", + "/usr/lib/x86_64-linux-gnu/octave/site/oct/api-v50+/x86_64-pc-linux-gnu\n", + "/usr/lib/x86_64-linux-gnu/octave/site/oct/x86_64-pc-linux-gnu\n", + "/usr/share/octave/4.0.0/site/m\n", + "/usr/share/octave/site/api-v50+/m\n", + "/usr/share/octave/site/m\n", + "/usr/share/octave/site/m/startup\n", + "/usr/lib/x86_64-linux-gnu/octave/4.0.0/oct/x86_64-pc-linux-gnu\n", + "/usr/share/octave/4.0.0/m\n", + "/usr/share/octave/4.0.0/m/audio\n", + "/usr/share/octave/4.0.0/m/debian\n", + "/usr/share/octave/4.0.0/m/deprecated\n", + "/usr/share/octave/4.0.0/m/elfun\n", + "/usr/share/octave/4.0.0/m/general\n", + "/usr/share/octave/4.0.0/m/geometry\n", + "/usr/share/octave/4.0.0/m/gui\n", + "/usr/share/octave/4.0.0/m/help\n", + "/usr/share/octave/4.0.0/m/image\n", + "/usr/share/octave/4.0.0/m/io\n", + "/usr/share/octave/4.0.0/m/java\n", + "/usr/share/octave/4.0.0/m/linear-algebra\n", + "/usr/share/octave/4.0.0/m/miscellaneous\n", + "/usr/share/octave/4.0.0/m/optimization\n", + "/usr/share/octave/4.0.0/m/path\n", + "/usr/share/octave/4.0.0/m/pkg\n", + "/usr/share/octave/4.0.0/m/plot\n", + "/usr/share/octave/4.0.0/m/plot/appearance\n", + "/usr/share/octave/4.0.0/m/plot/draw\n", + "/usr/share/octave/4.0.0/m/plot/util\n", + "/usr/share/octave/4.0.0/m/polynomial\n", + "/usr/share/octave/4.0.0/m/prefs\n", + "/usr/share/octave/4.0.0/m/set\n", + "/usr/share/octave/4.0.0/m/signal\n", + "/usr/share/octave/4.0.0/m/sparse\n", + "/usr/share/octave/4.0.0/m/specfun\n", + "/usr/share/octave/4.0.0/m/special-matrix\n", + "/usr/share/octave/4.0.0/m/startup\n", + "/usr/share/octave/4.0.0/m/statistics\n", + "/usr/share/octave/4.0.0/m/statistics/base\n", + "/usr/share/octave/4.0.0/m/statistics/distributions\n", + "/usr/share/octave/4.0.0/m/statistics/models\n", + "/usr/share/octave/4.0.0/m/statistics/tests\n", + "/usr/share/octave/4.0.0/m/strings\n", + "/usr/share/octave/4.0.0/m/testfun\n", + "/usr/share/octave/4.0.0/m/time\n", + "/usr/share/octave/4.0.0/data\n", + "\n" + ] + } + ], + "source": [ + "path" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "slide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans = /home/ryan/Documents/UConn/ME3255/course_git_S2017/03_Intro to matlab-octave\r\n" + ] + } + ], + "source": [ + "pwd" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Assignments (`=`-operator)\n", + "\n", + "Matlab is interpreted language \n", + "\n", + "each line of code (either saved text file or command-line) is executed as a standalone command\n", + "\n", + "These are reffered to \"scripts\"" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a = 10\n", + "b = 30\n", + "c = 40\n" + ] + } + ], + "source": [ + "a=10 % line one assigns a to 10\n", + "b=a*3 % line two assigns b to 10 times 3 by calling 'a' from line one\n", + "c=a+b % line three does not assign anything directly, but leaving off the \";\" prints the result\n", + " % ans" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Matlab has a number of \"objects\" that you can assign to variables\n", + "1. arrays (vectors and matrices `[`...`]`) \n", + "3. cells (combination of strings, text, even function calls `{`...`}`)\n", + "2. strings (text `\"`...`\"` )\n", + "3. functions (both built-in, defined or developed)\n", + "4. and more... (classes defined by `classdef` - you can create your own object to help organize data)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "### 1- Arrays\n", + "\n", + "Default in matlab is that when you assign a value to a variable, it is stored as an array\n", + "\n", + "arrays are N x M x ... values of integers or floating point numbers or complex integers/floating point numbers\n", + "\n", + "Use the parantheses to access values in an array `...(n,m)`" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A =\n", + "\n", + " 1 2 3\n", + " 4 5 6\n", + " 7 8 9\n", + " 10 11 12\n", + "\n", + "size of A is 4 x 3\n" + ] + } + ], + "source": [ + "A = [1 2 3;4,5,6;7,8,9;10,11,12]\n", + "fprintf('size of A is %i x %i\\n',size(A))" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A =\n", + "\n", + " 1 2 3\n", + " 4 5 6\n", + " 7 8 9\n", + " 10 11 12\n", + "\n", + "ans = 7\n", + "ans = 11\n" + ] + } + ], + "source": [ + "A = [1 2 3;4,5,6;7,8,9;10,11,12]\n", + "A(3,1)\n", + "A(8)" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans = 0\r\n" + ] + } + ], + "source": [ + "a=10; % a is 1x1 array where a(1,1)==10\n", + "a(1,1)==1\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 2. Cells \n", + "### combine different size arrays and text\n", + "\n", + "you cannot use math operators 'binary operators'" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " Columns 1 through 8:\n", + "\n", + " 0.00000 0.11111 0.22222 0.33333 0.44444 0.55556 0.66667 0.77778\n", + "\n", + " Columns 9 and 10:\n", + "\n", + " 0.88889 1.00000\n", + "\n" + ] + } + ], + "source": [ + "C={};\n", + "C{1}=linspace(0,1,10);\n", + "C{2}=linspace(0,1,3);\n", + "C{'z'}='holy cow';\n", + "C{1}" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " Columns 1 through 8:\n", + "\n", + " 0.00000 0.22222 0.44444 0.66667 0.88889 1.11111 1.33333 1.55556\n", + "\n", + " Columns 9 and 10:\n", + "\n", + " 1.77778 2.00000\n", + "\n" + ] + } + ], + "source": [ + "C{1}+C{1}" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 3. Strings \n", + "### can be combined and printed" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans = computational mechanics rocks!\r\n" + ] + } + ], + "source": [ + "string1 = 'computational'; string2 = 'mechanics';\n", + "[string1, ' ', string2, ' rocks!']" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "use `fprintf` to format strings and numbers for output and `sprintf` to save variables\n" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "computational mechanics\n", + "\n", + "string = the dog had 4 legs and weighed 30.9 lbs\n" + ] + } + ], + "source": [ + "fprintf([string1,' ',string2,'\\n\\n'])\n", + "string = sprintf('the dog had %i legs and weighed %1.1f lbs',4,30.93)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 4. Functions \n", + "### Some built in Matlab functions \n", + "**(i.e. the reasons to run Matlab)** " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "## Math operators (=, +, -, /, *, ^)\n", + "\n", + "Matlab assumes all variables are matrices\n", + "\n", + "all operators are matrix operations functions" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 3 3\n", + "\n", + "ans =\n", + "\n", + " 0.50000 0.50000\n", + "\n" + ] + } + ], + "source": [ + "1+[2,2]\n", + "1./[2,2]" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Thanks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Further Examples of Arrays and Functions" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "fragment" + } + }, + "source": [ + "vectors are either 1xN or Nx1 arrays for row and column" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_row =\n", + "\n", + " 1 2 3\n", + "\n", + "\n", + "v_column =\n", + "\n", + " 1\n", + " 2\n", + " 3\n" + ] + } + ], + "source": [ + "v_row = [1,2,3] %row vector\n", + "v_column = [1;2;3] %column vector\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "Matrices are MxN arrays\n", + "the `:`-symbol can substitute for a counting" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A =\n", + "\n", + " 1 2 3\n", + " 4 5 6\n", + " 7 8 9\n", + " 10 11 12\n", + "\n", + "ans =\n", + "\n", + " 1\n", + " 4\n", + " 7\n", + " 10\n", + "\n" + ] + } + ], + "source": [ + "A = [1 2 3;4,5,6;7,8,9;10,11,12]\n", + "A(:,1) % the colon assumes you want the first value, 1, counting up by 1 to the last value, 4" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "You can also use every 2nd value or any other integer up to `end` which is the largest value of that row or column of the array" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1\n", + " 7\n" + ] + } + ], + "source": [ + "A(1:2:end,1) % you can also use `end` " + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1\n", + " 4\n", + " 7\n", + " 10\n", + " 2\n", + " 5\n", + " 8\n", + " 11\n", + " 3\n", + " 6\n", + " 9\n", + " 12\n" + ] + } + ], + "source": [ + "A(:)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "In general, arrays can be any size \n", + "\n", + "take rolling 4 die and determining the sum of the components" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "A_6666 = zeros(6,6,6,6); %make a 6 x 6 x 6 x 6 array (1296 different values)\n", + "for i=1:6\n", + " for j=1:6\n", + " for k=1:6\n", + " for l=1:6\n", + " A_6666(i,j,k,l)=i+j+k+l; % each value is the sum of the indices\n", + " end\n", + " end\n", + " end\n", + "end\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 14\n", + "\n", + "\n", + "ans =\n", + "\n", + " 3.4170\n" + ] + } + ], + "source": [ + "mean(A_6666(:))\n", + "std(A_6666(:))" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 12\n" + ] + } + ], + "source": [ + "A_6666(1,4,2,5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## This is helpful to create reports of computed data\n", + "\n", + "the `\\` signifies a special character e.g. `\\n` = newline, `\\t` = tab\n", + "\n", + "to actually print the \"\\\", use `\\\\`" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\\\n" + ] + } + ], + "source": [ + "fprintf('\\\\')" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false, + "scrolled": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[0;31mUndefined function or variable 'fid'.\n", + "\u001b[0m" + ] + } + ], + "source": [ + "%fid = fopen('file.txt','w');\n", + "fprintf(fid,[string1, ' ', string2])\n", + "fprintf(fid,'\\n')\n", + "fprintf(fid,string)\n", + "fprintf(fid,'\\n')\n", + "fprintf(fid,'are you awake?')" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 20\n" + ] + } + ], + "source": [ + "a=10;\n", + "a+a % add two 1x1 arrays" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 2 4 6\n", + " 8 10 12\n", + " 14 16 18\n", + " 20 22 24\n" + ] + } + ], + "source": [ + "A = [1 2 3;4,5,6;7,8,9;10,11,12];\n", + "A+A % add two 4 x 3 arrays" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 14 32 50 68\n", + " 32 77 122 167\n", + " 50 122 194 266\n", + " 68 167 266 365\n" + ] + } + ], + "source": [ + "A*A'" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1 4 9\n", + " 16 25 36\n", + " 49 64 81\n", + " 100 121 144\n" + ] + } + ], + "source": [ + "A.^2" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1 4 9\n", + " 16 25 36\n", + " 49 64 81\n", + " 100 121 144\n" + ] + } + ], + "source": [ + "A.*A" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\b> In pymat_eval (line 31)\n", + " In matlabserver (line 24)]\b \n", + "[\bWarning: Rank deficient, rank = 2, tol = 1.696862e-14.]\b \n", + "\n", + "ans =\n", + "\n", + " 1.0000 0 0 -0.0000\n", + " 0.6667 0 0 0.3333\n", + " 0.3333 0 0 0.6667\n", + " 0.0000 0 0 1.0000\n" + ] + } + ], + "source": [ + "A/A" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/ Slash or right matrix divide.\n", + " A/B is the matrix division of B into A, which is roughly the\n", + " same as A*INV(B) , except it is computed in a different way.\n", + " More precisely, A/B = (B'\\A')'. See MLDIVIDE for details.\n", + " \n", + " C = MRDIVIDE(A,B) is called for the syntax 'A / B' when A or B is an\n", + " object.\n", + " \n", + " See also MLDIVIDE, RDIVIDE, LDIVIDE.\n", + "\n", + " Reference page in Doc Center\n", + " doc mrdivide\n", + "\n", + " Other functions named mrdivide\n", + "\n", + " codistributed/mrdivide gf/mrdivide laurpoly/mrdivide\n", + " duration/mrdivide gpuArray/mrdivide StaticModel/mrdivide\n", + " DynamicSystem/mrdivide LagOp/mrdivide timeseries/mrdivide\n", + " fints/mrdivide\n" + ] + } + ], + "source": [ + "help /" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 1 1 1\n", + " 1 1 1\n", + " 1 1 1\n", + " 1 1 1\n" + ] + } + ], + "source": [ + "% element-by-element operation with '.'\n", + "A./A" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "But, for 1x1 arrays, these are considered scalars and you get a free-pass" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ans =\n", + "\n", + " 10 20 30\n", + " 40 50 60\n", + " 70 80 90\n", + " 100 110 120\n" + ] + } + ], + "source": [ + "a*A % where a=10 and A is 1:12 in a 3 x 4 matrix" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 4.con'd Other built-in functions" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t_linear =\n", + "\n", + " Columns 1 through 7\n", + "\n", + " 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000\n", + "\n", + " Columns 8 through 11\n", + "\n", + " 0.7000 0.8000 0.9000 1.0000\n" + ] + } + ], + "source": [ + "t_linear=linspace(0,1,11)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t_log =\n", + "\n", + " 1 10 100\n" + ] + } + ], + "source": [ + "t_log = logspace(0,2,3) % log interval from 10^0 to 10^2 split into 3 values" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "LOGSPACE Logarithmically spaced vector.\n", + " LOGSPACE(X1, X2) generates a row vector of 50 logarithmically\n", + " equally spaced points between decades 10^X1 and 10^X2. If X2\n", + " is pi, then the points are between 10^X1 and pi.\n", + " \n", + " LOGSPACE(X1, X2, N) generates N points.\n", + " For N = 1, LOGSPACE returns 10^X2.\n", + " \n", + " Class support for inputs X1,X2:\n", + " float: double, single\n", + " \n", + " See also LINSPACE, COLON.\n", + "\n", + " Reference page in Doc Center\n", + " doc logspace\n", + "\n", + " Other functions named logspace\n", + "\n", + " codistributed.logspace distributed.logspace\n", + " codistributor1d/logspace gpuArray/logspace\n", + " codistributor2dbc/logspace\n" + ] + } + ], + "source": [ + "help logspace" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## 4.con'd scripts, functions or classes (to define objects)\n", + "\n", + "When using the GUI, your command history is saved, \n", + "\n", + "Best practice: save your work either as a script or a function or combination of both\n", + "\n", + "Creating a default graph script:" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": true, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "set(0, 'defaultAxesFontSize', 16)\n", + "set(0,'defaultTextFontSize',14)\n", + "set(0,'defaultLineLineWidth',3)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjAAAAGkCAIAAACgjIjwAAAACXBIWXMAABcSAAAXEgFnn9JSAAAA\nB3RJTUUH4QUfFCcixdxSEwAAACR0RVh0U29mdHdhcmUATUFUTEFCLCBUaGUgTWF0aFdvcmtzLCBJ\nbmMuPFjdGAAAACJ0RVh0Q3JlYXRpb24gVGltZQAzMS1NYXktMjAxNyAxNjozOTozNKYQAKQAACAA\nSURBVHic7d17QFRlwj/wx5nh5ighggr8eLl4ARUCSZS1vIClRZq3fCWtFHfNjTDTddPEVEwt03JN\nxVwT8FJpRt4tLAlX41VAKC94JWBZGFAu7iAwMMzw++PxPe/sMHNmzlzPzHw/fz2cOZenbXa+Pc95\nLt06OzsJAACAtQmsXQEAAABCEEgAAMATCCQAAOAFBBIAAPACAgkAAHgBgQQAALyAQAIAAF5AIAEA\nAC8gkAAAgBcQSAAAwAsIJAAA4AUEEgAA8AICCQAAeAGBBAAAvIBAAgAAXkAgAQAALyCQAACAF0TG\nXCyXy5uamuRyuUKhcHJycnJycnd3FwhsO+QUCoVSqSSECAQCoVBo7eoAADgKzoFUWVn52WefXbly\npb6+XiaTdT1BLBb36dPnhRdeSEhI6Nu3rykqaV5yuTwvL+/evXtXr1799ddfa2pq6PGpU6du2rTJ\nunUDAHAc3To7O/U5r7q6+t133y0qKlIoFPrf3c3NLT4+funSpV5eXobW0LzOnj27aNEijR8hkAAA\nLEl399pPP/00atSo2NjYgoICTmlECGltbc3Kynr66afj4uJ+//13QytpRh0dHW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HwDwnbbFvLGSt2VwCCQfH5/jx4+bryoAAFakbTFvrORtMWi4AABoHciAObCWhEACANA6kAFp\nZEkIJABwdBjIwBMIJABwaCyLeSONLIzbKDs19+7dS0lJaWxslMvlSqVywIABe/fuNVXNAADMDYt5\n84qBgbR27dqvv/5a7WDPnj3VjkRFRTU3NxNCLl++7OHhYdizAADMBIt58wrnLjulUhkVFdU1jTRa\nunQpLezatYvrgwAAzAqLefMN50AKDw+njR5CiFAoDAgIiIyM1HbyjBkzaOHUqVOG1Q8AwBwwkIGH\nuHXZJSUldXR00PLKlSvnzp1Ly5GRka2trV3Pd3Nz8/Pzq6qqqqurk8vlTk5ORlYXAMB4iYduYjFv\nHuLQQnr06NG5c+do+YsvvmDSiF1Q0OMXgw8ePOBaOQAAk0vNLssskHQ9jsW8rY5DIOXn59PC+PHj\nR48eredVzGukxsZGTjUDADA5besDEUIyEoZYuDKghkMgbd++nRbee+89/a8Si8W00NbWpv9VAAAm\nl1vaqHGQNyHk56RhgZ6uFq4PqOEQSMxbol69DOljzczMNOAqAACTKG+QxaYVa/wIAxl4wuwrNTAx\nNmfOHHM/CwBAm9hdRRqPI434g0Mgubm50UJTU5P+V23ZsoUWMDEWAKyFZcoR0og/OATS1KlTaeHY\nsWP6X1Vc/LiN7O3trf9VAACmom3KETY64hsOgfT888/Twueff67nJVlZWXQWrZubm6enJ9fKAQAY\niSWNMMibbzgEUt++fb28vAghMpls4cKFOs8vLCxcuXIlLc+fP9+w+gEAGEzbBFhMOeInboMa0tLS\naCE3N/fpp5++d++extPa2to2bNjAjGIQiURvv/22MbUEAOBK2wTYQE/Xn5OiLF8f0Inb0kERERHz\n589PT08nhNTV1b344otubm5eXl50KN3du3enTZvW0NBQU1OjetWhQ4dMWGMAAJ1YJ8CibcRTnLef\nWL58uVAo3LNnD/2ztbW1srKS+bSkRH0b4IyMjPDwcGOqCADAibZdjggGefObIfOQli1b9v3339P3\nSSwGDRp05cqVUaNGGVQxAABDlDfIkEY2ysAN+oKD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mzpzZq1ev4uLia9eumfDOn3/+ea9evfr06bNy5UoT\n3hbsG94hAQAAL6CFBAAAvIBAAgAAXvj/u/Oe9/l6M9wAAAAASUVORK5CYII=\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plot(t_linear,t_linear.^2)\n", + "xlabel('time (s)')\n", + "ylabel('displacement (m)')" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Graphics can be produced with a number of functions\n", + "\n", + "2-D plots, 3-D plots, contour plots, 3D contour plots ... " + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "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\t-1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_3a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_4a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_5a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_6a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_7a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_8a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_9a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_10a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_11a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_12a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_13a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_14a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_15a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_16a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_17a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_18a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_19a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_20a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_21a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_22a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_23a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_24a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_25a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_26a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_27a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_28a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_29a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_30a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_31a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_32a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_33a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_34a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_35a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_36a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_37a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_38a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_39a\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_40a\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "x=linspace(-1,1,21); y=linspace(-1,1,21);\n", + "[X,Y]=meshgrid(x,y);\n", + "Z=(X.*Y.^3-X.^3.*Y);\n", + "\n", + "contour(X,Y,Z)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "mesh(X,Y,Z)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false, + "scrolled": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "pcolor(X,Y,Z)" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/03_Intro to matlab-octave/lecture_03.md b/03_Intro to matlab-octave/lecture_03.md new file mode 100644 index 0000000..ce76e7f --- /dev/null +++ b/03_Intro to matlab-octave/lecture_03.md @@ -0,0 +1,1447 @@ + +# Matlab basic use +## 1- the environment, path and working directory + +Matlab environment can be called by: +1. Starting the matlab executable (the gui) +2. Starting a jupyter notebook with Matlab kernel +3. Starting matlab with command-line interface (no gui) + +The main requirement is that matlab kernel (main matlab program) is running and accepting commands + +When you start, you can call matlab built-in functions or anything you write that is in your `MATLABPATH` or working directory (`pwd`) + + +```matlab +path +``` + + MATLABPATH + + /usr/local/lib/python2.7/dist-packages/matlab_kernel/toolbox + /usr/local/lib/python2.7/dist-packages/pymatbridge/matlab + /usr/local/lib/python2.7/dist-packages/pymatbridge/matlab/usrprog + /usr/local/lib/python2.7/dist-packages/pymatbridge/matlab/util + /usr/local/lib/python2.7/dist-packages/pymatbridge/matlab/util/json_v0.2.2 + /usr/local/lib/python2.7/dist-packages/pymatbridge/matlab/util/json_v0.2.2/json + /usr/local/lib/python2.7/dist-packages/pymatbridge/matlab/util/json_v0.2.2/json/java + /usr/local/lib/python2.7/dist-packages/pymatbridge/matlab/util/json_v0.2.2/test + /home/ryan/Documents/MATLAB + /usr/local/MATLAB/R2016a/toolbox/matlab/strfun + /usr/local/MATLAB/R2016a/toolbox/matlab/datatypes + /usr/local/MATLAB/R2016a/toolbox/matlab/elfun + /usr/local/MATLAB/R2016a/toolbox/matlab/ops + /usr/local/MATLAB/R2016a/toolbox/matlab/timefun + /usr/local/MATLAB/R2016a/toolbox/matlab/elmat + /usr/local/MATLAB/R2016a/toolbox/matlab/datafun + /usr/local/MATLAB/R2016a/toolbox/matlab/iofun + /usr/local/MATLAB/R2016a/toolbox/matlab/mvm + /usr/local/MATLAB/R2016a/toolbox/matlab/randfun + /usr/local/MATLAB/R2016a/toolbox/matlab/funfun + /usr/local/MATLAB/R2016a/toolbox/matlab/general + /usr/local/MATLAB/R2016a/toolbox/matlab/polyfun + /usr/local/MATLAB/R2016a/toolbox/matlab/matfun + /usr/local/MATLAB/R2016a/toolbox/matlab/lang + /usr/local/MATLAB/R2016a/toolbox/matlab/specfun + /usr/local/MATLAB/R2016a/toolbox/matlab/sparfun + /usr/local/MATLAB/R2016a/toolbox/matlab/images + /usr/local/MATLAB/R2016a/toolbox/matlab/testframework/performance + /usr/local/MATLAB/R2016a/toolbox/matlab/testframework/parallel + /usr/local/MATLAB/R2016a/toolbox/matlab/optimfun + /usr/local/MATLAB/R2016a/toolbox/matlab/testframework/ext + /usr/local/MATLAB/R2016a/toolbox/matlab/guide + /usr/local/MATLAB/R2016a/toolbox/matlab/testframework/measurement + /usr/local/MATLAB/R2016a/toolbox/matlab/icons + /usr/local/MATLAB/R2016a/toolbox/matlab/demos + /usr/local/MATLAB/R2016a/toolbox/matlab/helptools + /usr/local/MATLAB/R2016a/toolbox/matlab/winfun + /usr/local/MATLAB/R2016a/toolbox/matlab/winfun/NET + /usr/local/MATLAB/R2016a/toolbox/matlab/datamanager + /usr/local/MATLAB/R2016a/toolbox/matlab/verctrl + /usr/local/MATLAB/R2016a/toolbox/matlab/graph2d + /usr/local/MATLAB/R2016a/toolbox/matlab/graph3d + /usr/local/MATLAB/R2016a/toolbox/matlab/graphics + /usr/local/MATLAB/R2016a/toolbox/matlab/graphics/obsolete + /usr/local/MATLAB/R2016a/toolbox/matlab/plottools + /usr/local/MATLAB/R2016a/toolbox/matlab/scribe + /usr/local/MATLAB/R2016a/toolbox/matlab/scribe/obsolete + /usr/local/MATLAB/R2016a/toolbox/matlab/specgraph + /usr/local/MATLAB/R2016a/toolbox/matlab/uitools + /usr/local/MATLAB/R2016a/toolbox/matlab/uitools/obsolete + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/matlabhdlcoder/matlabhdlcoder + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/matlabhdlcoder + /usr/local/MATLAB/R2016a/toolbox/matlab/testframework/core + /usr/local/MATLAB/R2016a/toolbox/matlab/testframework/obsolete + /usr/local/MATLAB/R2016a/toolbox/matlab/hardware/stubs + /usr/local/MATLAB/R2016a/toolbox/local + /usr/local/MATLAB/R2016a/toolbox/matlab/datastoreio + /usr/local/MATLAB/R2016a/toolbox/matlab/codetools + /usr/local/MATLAB/R2016a/toolbox/matlab/codetools/embeddedoutputs + /usr/local/MATLAB/R2016a/toolbox/matlab/graphfun + /usr/local/MATLAB/R2016a/toolbox/matlab/depfun + /usr/local/MATLAB/R2016a/toolbox/matlab/mapreduceio + /usr/local/MATLAB/R2016a/toolbox/matlab/findfiles + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/asap2/asap2/dataclasses + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/asap2/asap2 + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/asap2/asap2/user + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/common/can/blocks/dataclasses + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/common/can/blocks + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/common/can/blocks/tlc_c + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/common/tgtcommon + /usr/local/MATLAB/R2016a/toolbox/coder/simulinkcoder/cgv/API + /usr/local/MATLAB/R2016a/toolbox/rtw/rtw/misra + /usr/local/MATLAB/R2016a/toolbox/coder/simulinkcoder + /usr/local/MATLAB/R2016a/toolbox/coder/simulinkcoder/templates + /usr/local/MATLAB/R2016a/toolbox/coder/simulinkcoder/targets + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/pil + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/AUTOSAR/AUTOSAR/dataclasses + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/AUTOSAR/AUTOSAR + /usr/local/MATLAB/R2016a/toolbox/rtw/accel + /usr/local/MATLAB/R2016a/toolbox/coder/simulinkcoder_core + /usr/local/MATLAB/R2016a/toolbox/rtw/rtwdemos + /usr/local/MATLAB/R2016a/toolbox/rtw/rtwdemos/rsimdemos + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/simfeatures + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/simfeatures/modelreference + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/simfeatures/datadictionary + /usr/local/MATLAB/R2016a/toolbox/simulink/sysarch/sysarch + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/simgeneral + /usr/local/MATLAB/R2016a/toolbox/slde/examples + /usr/local/MATLAB/R2016a/toolbox/coder/advisor + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/modeladvisor + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/modeladvisor/fixpt + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/automotive/fuelsys + /usr/local/MATLAB/R2016a/toolbox/simulink/components + /usr/local/MATLAB/R2016a/toolbox/simulink/dee + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/aerospace + /usr/local/MATLAB/R2016a/toolbox/simulinktest/core/simharness/simharness + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/frameedit + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/industrial + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/automotive + /usr/local/MATLAB/R2016a/toolbox/simulink/blocks/library + /usr/local/MATLAB/R2016a/toolbox/simulink/blocks/library/simulinkcoder + /usr/local/MATLAB/R2016a/toolbox/simulink/blocks/obsolete + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/dataclasses + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos + /usr/local/MATLAB/R2016a/toolbox/simulink/blocks + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/dataclasses + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/MPlayIO + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/dataobjectwizard + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/slresolve + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/units + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/resources + /usr/local/MATLAB/R2016a/toolbox/simulink/sdi + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/core_templates + /usr/local/MATLAB/R2016a/toolbox/simulinktest/core/testsequence/testsequence + /usr/local/MATLAB/R2016a/toolbox/simulink/simdemos/automotive/powerwindow + /usr/local/MATLAB/R2016a/toolbox/simulink/sldependency + /usr/local/MATLAB/R2016a/toolbox/simulink/hmi + /usr/local/MATLAB/R2016a/toolbox/coder/objectives + /usr/local/MATLAB/R2016a/toolbox/slde/slde + /usr/local/MATLAB/R2016a/toolbox/slde/slde/resources + /usr/local/MATLAB/R2016a/toolbox/stateflow/stateflow + /usr/local/MATLAB/R2016a/toolbox/stateflow/coder + /usr/local/MATLAB/R2016a/toolbox/stateflow/sfdemos + /usr/local/MATLAB/R2016a/toolbox/stateflow/sftemplates + /usr/local/MATLAB/R2016a/toolbox/shared/testmeaslib/general + /usr/local/MATLAB/R2016a/toolbox/simulink/blocks/sb2sl + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/DR/DR + /usr/local/MATLAB/R2016a/toolbox/shared/reqmgt + /usr/local/MATLAB/R2016a/toolbox/shared/reqmgt/mmutils + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/graphics + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/graphics/utils + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/graphics/plotoptions + /usr/local/MATLAB/R2016a/toolbox/simulink/sledittimecheck + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/slhdltemplates + /usr/local/MATLAB/R2016a/toolbox/distcomp + /usr/local/MATLAB/R2016a/toolbox/distcomp/distcomp + /usr/local/MATLAB/R2016a/toolbox/distcomp/user + /usr/local/MATLAB/R2016a/toolbox/distcomp/mpi + /usr/local/MATLAB/R2016a/toolbox/distcomp/parallel + /usr/local/MATLAB/R2016a/toolbox/distcomp/parallel/util + /usr/local/MATLAB/R2016a/toolbox/distcomp/lang + /usr/local/MATLAB/R2016a/toolbox/distcomp/cluster + /usr/local/MATLAB/R2016a/toolbox/distcomp/gpu + /usr/local/MATLAB/R2016a/toolbox/distcomp/array + /usr/local/MATLAB/R2016a/toolbox/target/codertarget + /usr/local/MATLAB/R2016a/toolbox/target/codertarget/rtw + /usr/local/MATLAB/R2016a/toolbox/target/codertarget/matlabcoder + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/simscapedemos + /usr/local/MATLAB/R2016a/toolbox/comm/templates + /usr/local/MATLAB/R2016a/toolbox/shared/simulink + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdlcoderdemos + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdlcoderdemos/matlabhdlcoderdemos + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic5000/tic5000demos + /usr/local/MATLAB/R2016a/toolbox/physmod/common/gl/sli/m + /usr/local/MATLAB/R2016a/toolbox/shared/system/simulink + /usr/local/MATLAB/R2016a/toolbox/images/colorspaces + /usr/local/MATLAB/R2016a/toolbox/images/images + /usr/local/MATLAB/R2016a/toolbox/images/imdata + /usr/local/MATLAB/R2016a/toolbox/images/imuitools + /usr/local/MATLAB/R2016a/toolbox/images/iptformats + /usr/local/MATLAB/R2016a/toolbox/images/iptutils + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic6000 + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic6000/rtw + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic6000/tfl + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic6000/utils + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic6000/blks/sysobj_mex + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic6000/blks/mex + /usr/local/MATLAB/R2016a/toolbox/distcomp/pctdemos + /usr/local/MATLAB/R2016a/toolbox/matlab/appdesigner/appdesigner + /usr/local/MATLAB/R2016a/toolbox/shared/mlreportgen/ppt + /usr/local/MATLAB/R2016a/toolbox/shared/mlreportgen/ppt/ppt + /usr/local/MATLAB/R2016a/toolbox/shared/mlreportgen/ppt/ppt/help + /usr/local/MATLAB/R2016a/toolbox/coder/matlabcoder + /usr/local/MATLAB/R2016a/toolbox/coder/matlabcoder/templates + /usr/local/MATLAB/R2016a/toolbox/dsp/templates + /usr/local/MATLAB/R2016a/toolbox/globaloptim + /usr/local/MATLAB/R2016a/toolbox/globaloptim/globaloptim + /usr/local/MATLAB/R2016a/toolbox/shared/appdes/services + /usr/local/MATLAB/R2016a/toolbox/coder/emlcodermex + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/powerdemo/power_electronics + /usr/local/MATLAB/R2016a/toolbox/pde/pdedemos + /usr/local/MATLAB/R2016a/toolbox/slvnv/slvnvdemos + /usr/local/MATLAB/R2016a/toolbox/sl_pir_cap + /usr/local/MATLAB/R2016a/toolbox/target + /usr/local/MATLAB/R2016a/toolbox/target/foundation + /usr/local/MATLAB/R2016a/toolbox/target/foundation/utils + /usr/local/MATLAB/R2016a/toolbox/target/foundation/utils/resource_config + /usr/local/MATLAB/R2016a/toolbox/target/foundation/blks + /usr/local/MATLAB/R2016a/toolbox/target/foundation/blks/mex + /usr/local/MATLAB/R2016a/toolbox/target/foundation/blks/masks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/shared + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/shared/ti + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/shared/ti/mdlinfo + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/shared/ti/utils + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/shared/ti/blks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/shared/ti/blks/mex + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/shared/ti/blks/masks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/ARM/tfl + /usr/local/MATLAB/R2016a/toolbox/shared/etargets/etargets + /usr/local/MATLAB/R2016a/toolbox/shared/etargets/etargets/demoutils + /usr/local/MATLAB/R2016a/toolbox/optim/optim + /usr/local/MATLAB/R2016a/toolbox/optim + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/advisor/m + /usr/local/MATLAB/R2016a/toolbox/target/targetdemos + /usr/local/MATLAB/R2016a/toolbox/shared/hadoopserializer + /usr/local/MATLAB/R2016a/toolbox/matlab/external/engines/engine_api + /usr/local/MATLAB/R2016a/toolbox/shared/siglib + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/performance + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/performance/performancea + /usr/local/MATLAB/R2016a/toolbox/simevents/examples + /usr/local/MATLAB/R2016a/toolbox/shared/hdlshared + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/local/m + /usr/local/MATLAB/R2016a/toolbox/matlab/uicomponents/uicomponents + /usr/local/MATLAB/R2016a/toolbox/matlab/uicomponents/uicomponents/pending + /usr/local/MATLAB/R2016a/toolbox/matlab/uicomponents/uicomponents/graphics + /usr/local/MATLAB/R2016a/toolbox/fixedpoint/fixedpointconverter + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/drives/drivesdemo + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/library/m + /usr/local/MATLAB/R2016a/toolbox/shared/sdi + /usr/local/MATLAB/R2016a/toolbox/shared/asynciolib + /usr/local/MATLAB/R2016a/toolbox/shared/cmlink/api + /usr/local/MATLAB/R2016a/toolbox/matlab/toolboxmanagement/matlab_api + /usr/local/MATLAB/R2016a/toolbox/mpc/mpcdemos + /usr/local/MATLAB/R2016a/toolbox/distcomp/mapreduce + /usr/local/MATLAB/R2016a/toolbox/matlab/networklib + /usr/local/MATLAB/R2016a/toolbox/dsp/dspdemos + /usr/local/MATLAB/R2016a/toolbox/shared/testmeaslib/simulink + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/general + /usr/local/MATLAB/R2016a/toolbox/shared/imaqlib + /usr/local/MATLAB/R2016a/toolbox/physmod/equation_language/equation_language + /usr/local/MATLAB/R2016a/toolbox/simulink/slmetrics + /usr/local/MATLAB/R2016a/toolbox/vision/vision + /usr/local/MATLAB/R2016a/toolbox/vision/visiondata + /usr/local/MATLAB/R2016a/toolbox/vision/visionutilities + /usr/local/MATLAB/R2016a/toolbox/vision/visionutilities/visioninit + /usr/local/MATLAB/R2016a/toolbox/vision/visionutilities/visionmex + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/foundation/simscape + /usr/local/MATLAB/R2016a/toolbox/shared/system/sfun + /usr/local/MATLAB/R2016a/toolbox/matlab/toolbox_packaging + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink_data_dictionary/sldd + /usr/local/MATLAB/R2016a/toolbox/shared/pdelib + /usr/local/MATLAB/R2016a/toolbox/compiler_sdk/java + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/scenarioconnector + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/scenarioconnector/ui + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/scenarioconnector/ui/toolstrip/modelsection + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/scenarioconnector/ui/toolstrip/filesection + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/editor/ui + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/comparisontool + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/mapping + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/mapping/callbacks + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/mapping/util + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/toolstrip + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/toolstrip/open/streaming + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/toolstrip/help + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/toolstrip/open + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/toolstrip/session + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/ui/toolstrip/report + /usr/local/MATLAB/R2016a/toolbox/globaloptim/globaloptimdemos + /usr/local/MATLAB/R2016a/toolbox/econ/econ + /usr/local/MATLAB/R2016a/toolbox/physmod/common/dataservices/sli/m + /usr/local/MATLAB/R2016a/toolbox/shared/sl_async_streaming + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/ccsblks + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/ccslinkblks + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/ccslinkblks/rtdxsimblks + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/mdlinfo + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/tfl + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/util + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/rtw + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/envChecker + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator/rtw + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator/tgtpref2 + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator/profiler + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator/mdlinfo + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator/blks + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator/blks/masks + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/pjtgenerator/blks/tlc_c + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/engine/core/m + /usr/local/MATLAB/R2016a/toolbox/shared/system/coder + /usr/local/MATLAB/R2016a/toolbox/wavelet/wavelet + /usr/local/MATLAB/R2016a/toolbox/wavelet/wmultisig1d + /usr/local/MATLAB/R2016a/toolbox/wavelet/compression + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdlcommon + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdlcommon/modelcheckeradvisor + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/library + /usr/local/MATLAB/R2016a/toolbox/slvnv/rmidemos + /usr/local/MATLAB/R2016a/toolbox/shared/eda/board + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdllib/sl_lib + /usr/local/MATLAB/R2016a/toolbox/bioinfo/bioinfodata + /usr/local/MATLAB/R2016a/toolbox/shared/coder/coder + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/visionhdl/simulink/dsp + /usr/local/MATLAB/R2016a/toolbox/shared/polyspace + /usr/local/MATLAB/R2016a/toolbox/robust/rctdemos + /usr/local/MATLAB/R2016a/toolbox/simulink/sltemplate + /usr/local/MATLAB/R2016a/toolbox/physmod/common/dataservices/core/m + /usr/local/MATLAB/R2016a/toolbox/matlab/system/editor + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdlcoder + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdlcoder/hdlwa + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/ecoder/ecoderdemos/dataclasses + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/ecoder/ecoderdemos + /usr/local/MATLAB/R2016a/toolbox/signal/signal + /usr/local/MATLAB/R2016a/toolbox/signal/sigtools + /usr/local/MATLAB/R2016a/toolbox/signal/sptoolgui + /usr/local/MATLAB/R2016a/toolbox/compiler/mlhadoop + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/wing_landing_gear + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/wing_landing_gear/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/cart_double_pendulum + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/cart_double_pendulum/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/stewart_platform + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/stewart_platform/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/double_crank_aiming + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/double_crank_aiming/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/bread_slicer + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/bread_slicer/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/import/stewart_platform + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/import/four_bar + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/radial_engine + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/radial_engine/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/double_wishbone_suspension + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/double_wishbone_suspension/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/import/robot + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/cardan_gear + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/cardan_gear/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/windshield_wiper + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/windshield_wiper/images + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/backhoe + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/robotic_wrist + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/carousel + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/welding_robot + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/import/robot_stepfiles + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/potters_wheel + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/linear_actuator + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/pto_shaft + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/smdemos/cam_flapping_wing + /usr/local/MATLAB/R2016a/toolbox/simulink/fixedandfloat/fxpdemos + /usr/local/MATLAB/R2016a/toolbox/vision/visiondemos + /usr/local/MATLAB/R2016a/toolbox/nnet/nndemos + /usr/local/MATLAB/R2016a/toolbox/nnet/nndemos/nndatasets + /usr/local/MATLAB/R2016a/toolbox/shared/hwconnectinstaller + /usr/local/MATLAB/R2016a/help/toolbox/comm/examples + /usr/local/MATLAB/R2016a/toolbox/bioinfo/bioinfo + /usr/local/MATLAB/R2016a/toolbox/bioinfo/biolearning + /usr/local/MATLAB/R2016a/toolbox/bioinfo/microarray + /usr/local/MATLAB/R2016a/toolbox/bioinfo/mass_spec + /usr/local/MATLAB/R2016a/toolbox/bioinfo/proteins + /usr/local/MATLAB/R2016a/toolbox/bioinfo/biomatrices + /usr/local/MATLAB/R2016a/toolbox/bioinfo/graphtheory + /usr/local/MATLAB/R2016a/toolbox/matlab/external/interfaces/webservices/restful + /usr/local/MATLAB/R2016a/toolbox/matlab/external/interfaces + /usr/local/MATLAB/R2016a/toolbox/matlab/external/interfaces/webservices + /usr/local/MATLAB/R2016a/toolbox/shared/slci/slci + /usr/local/MATLAB/R2016a/toolbox/sldv/sldv + /usr/local/MATLAB/R2016a/toolbox/fixedpoint/fixedpoint + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdlslrt + /usr/local/MATLAB/R2016a/toolbox/robotics/robotalgs + /usr/local/MATLAB/R2016a/toolbox/slvnv/metrics + /usr/local/MATLAB/R2016a/toolbox/physmod/pe/library/m + /usr/local/MATLAB/R2016a/toolbox/slvnv/do178b + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/DR/DRdemo + /usr/local/MATLAB/R2016a/toolbox/shared/sl_coverage_configset + /usr/local/MATLAB/R2016a/toolbox/robotics/robotsimulink + /usr/local/MATLAB/R2016a/toolbox/robotics/robotsimulink/robotslros + /usr/local/MATLAB/R2016a/toolbox/robotics/robotsimulink/robotslros/registry + /usr/local/MATLAB/R2016a/toolbox/shared/system/coreblocks + /usr/local/MATLAB/R2016a/toolbox/simevents/simevents + /usr/local/MATLAB/R2016a/toolbox/simevents/simevents/icons + /usr/local/MATLAB/R2016a/toolbox/physmod/common/external/mli/m + /usr/local/MATLAB/R2016a/toolbox/matlab/timeseries + /usr/local/MATLAB/R2016a/toolbox/matlab/hds + /usr/local/MATLAB/R2016a/toolbox/matlab/addons_zip + /usr/local/MATLAB/R2016a/toolbox/coder/xrel + /usr/local/MATLAB/R2016a/toolbox/slvnv/simcovdemos + /usr/local/MATLAB/R2016a/toolbox/matlab/apps + /usr/local/MATLAB/R2016a/toolbox/slvnv/iec61508 + /usr/local/MATLAB/R2016a/toolbox/shared/sldv_sfcn/sldv_sfcn + /usr/local/MATLAB/R2016a/help/toolbox/slcontrol/examples + /usr/local/MATLAB/R2016a/toolbox/robotics/robotcore + /usr/local/MATLAB/R2016a/toolbox/matlab/imagesci + /usr/local/MATLAB/R2016a/toolbox/econ/econdemos + /usr/local/MATLAB/R2016a/toolbox/shared/sldv + /usr/local/MATLAB/R2016a/toolbox/coder/codedescriptor_core + /usr/local/MATLAB/R2016a/toolbox/curvefit/curvefit + /usr/local/MATLAB/R2016a/toolbox/curvefit/splines + /usr/local/MATLAB/R2016a/toolbox/curvefit/sftoolgui + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic5000 + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic5000/blks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic5000/blks/mex + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic5000/blks/masks + /usr/local/MATLAB/R2016a/toolbox/shared/dastudio/dpvu/dpvu + /usr/local/MATLAB/R2016a/toolbox/shared/dastudio/dpvu/dpvu/metamodel + /usr/local/MATLAB/R2016a/toolbox/shared/dastudio/dpvu/dpvu/actions + /usr/local/MATLAB/R2016a/toolbox/shared/cgxe/cgxe + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/requirements + /usr/local/MATLAB/R2016a/toolbox/shared/testconsole + /usr/local/MATLAB/R2016a/toolbox/instrument/instrumentdemos + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/vision/matlab/utilities + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/vision/simulink/utilities + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/vision/matlab/utilities/mex + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/vision/simulink/utilities/mex + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/vision/matlab/utilities/init + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/vision/matlab/vision + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/vision/simulink/vision + /usr/local/MATLAB/R2016a/toolbox/nnet/cnn + /usr/local/MATLAB/R2016a/toolbox/shared/sl_messages + /usr/local/MATLAB/R2016a/toolbox/simbio/simbiodemos + /usr/local/MATLAB/R2016a/toolbox/matlab/uitools/uicomponents/components + /usr/local/MATLAB/R2016a/toolbox/shared/mlreportgen/dom + /usr/local/MATLAB/R2016a/toolbox/shared/mlreportgen/dom/dom + /usr/local/MATLAB/R2016a/toolbox/shared/mlreportgen/dom/dom/help + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/engine/sli/m + /usr/local/MATLAB/R2016a/toolbox/target/extensions/operatingsystem/linux/blks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/operatingsystem/linux/blks/masks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/operatingsystem/linux/blks/mex + /usr/local/MATLAB/R2016a/toolbox/target/extensions/operatingsystem/linux/src + /usr/local/MATLAB/R2016a/toolbox/realtime/realtime/hwconnection + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/ecoder + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/mpt + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/mpt/mpt + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/mpt/user_specific + /usr/local/MATLAB/R2016a/toolbox/coder/embeddedcoder + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/slproject/examples + /usr/local/MATLAB/R2016a/toolbox/slcontrol/slctrldemos + /usr/local/MATLAB/R2016a/toolbox/compiler + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/facts/factsdemo + /usr/local/MATLAB/R2016a/toolbox/slvnv/simcoverage + /usr/local/MATLAB/R2016a/toolbox/matlab/external/engines/python + /usr/local/MATLAB/R2016a/toolbox/physmod/common/dataservices/gui/m + /usr/local/MATLAB/R2016a/toolbox/fuzzy/fuzdemos + /usr/local/MATLAB/R2016a/toolbox/fininst/fininst + /usr/local/MATLAB/R2016a/toolbox/physmod/sps/sps + /usr/local/MATLAB/R2016a/toolbox/physmod/common/units/mli/m + /usr/local/MATLAB/R2016a/toolbox/coder/coder + /usr/local/MATLAB/R2016a/toolbox/sldv/slicer + /usr/local/MATLAB/R2016a/toolbox/sldv/slicer/gui + /usr/local/MATLAB/R2016a/toolbox/coder/codegendemos + /usr/local/MATLAB/R2016a/toolbox/wavelet/wavedemo + /usr/local/MATLAB/R2016a/toolbox/matlab/addons + /usr/local/MATLAB/R2016a/toolbox/matlab/addons/cef + /usr/local/MATLAB/R2016a/toolbox/matlab/addons/fallbackmanager + /usr/local/MATLAB/R2016a/toolbox/compiler/compilerdemos + /usr/local/MATLAB/R2016a/toolbox/shared/mapgeodesy + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/derivedSignals + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/sourceBlocks + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/docexamples + /usr/local/MATLAB/R2016a/toolbox/shared/cgir_fe + /usr/local/MATLAB/R2016a/toolbox/coder/float2fixed + /usr/local/MATLAB/R2016a/toolbox/coder/float2fixed/demos + /usr/local/MATLAB/R2016a/toolbox/coder/float2fixed/dmm_emlauthoring + /usr/local/MATLAB/R2016a/toolbox/fuzzy/fuzzy + /usr/local/MATLAB/R2016a/toolbox/fuzzy/fuzzyutil + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic2000 + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic2000/rtw + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/tic2000/utils + /usr/local/MATLAB/R2016a/toolbox/finance/finance + /usr/local/MATLAB/R2016a/toolbox/finance/calendar + /usr/local/MATLAB/R2016a/toolbox/finance/finsupport + /usr/local/MATLAB/R2016a/toolbox/finance/ftseries + /usr/local/MATLAB/R2016a/toolbox/realtime + /usr/local/MATLAB/R2016a/toolbox/realtime/realtime + /usr/local/MATLAB/R2016a/toolbox/realtime/realtime/rtw + /usr/local/MATLAB/R2016a/toolbox/shared/optimlib + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/upgradeadvisor + /usr/local/MATLAB/R2016a/toolbox/physmod/common/gl/mli/m + /usr/local/MATLAB/R2016a/toolbox/shared/spcuilib + /usr/local/MATLAB/R2016a/toolbox/physmod/pe/advisor/m + /usr/local/MATLAB/R2016a/toolbox/imaq/imaqblks/imaqblks + /usr/local/MATLAB/R2016a/toolbox/imaq/imaqblks/imaqmex + /usr/local/MATLAB/R2016a/toolbox/imaq/imaqblks/imaqmasks + /usr/local/MATLAB/R2016a/toolbox/shared/sl_web_widgets + /usr/local/MATLAB/R2016a/toolbox/physmod/common/foundation/mli/m + /usr/local/MATLAB/R2016a/toolbox/fixedpoint/fixedpointtool + /usr/local/MATLAB/R2016a/toolbox/simulink/compiled_model_interface + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/engine/mli/m + /usr/local/MATLAB/R2016a/toolbox/shared/hwconnectinstaller/common + /usr/local/MATLAB/R2016a/toolbox/database/dbdemos + /usr/local/MATLAB/R2016a/toolbox/javabuilder/javabuilder + /usr/local/MATLAB/R2016a/toolbox/shared/rptgen + /usr/local/MATLAB/R2016a/toolbox/images/imdemos + /usr/local/MATLAB/R2016a/help/toolbox/dsp/examples + /usr/local/MATLAB/R2016a/toolbox/shared/slvnv + /usr/local/MATLAB/R2016a/toolbox/slvnv/slvnv + /usr/local/MATLAB/R2016a/toolbox/stats/gpu + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/simscape/m + /usr/local/MATLAB/R2016a/toolbox/matlab/cefclient + /usr/local/MATLAB/R2016a/toolbox/sl3d/sl3ddemos + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/slproject/templates + /usr/local/MATLAB/R2016a/toolbox/shared/spcuilib/slscopes + /usr/local/MATLAB/R2016a/toolbox/matlab/supportpackagemanagement + /usr/local/MATLAB/R2016a/toolbox/control/ctrldemos + /usr/local/MATLAB/R2016a/toolbox/shared/dspblks/dspblks + /usr/local/MATLAB/R2016a/toolbox/shared/dspblks/dspmex + /usr/local/MATLAB/R2016a/toolbox/ident/iddemos + /usr/local/MATLAB/R2016a/toolbox/ident/iddemos/examples + /usr/local/MATLAB/R2016a/toolbox/idelink/idelinkdemos + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/ccsdemos + /usr/local/MATLAB/R2016a/toolbox/idelink/extensions/ticcs/ccsdemos/util + /usr/local/MATLAB/R2016a/toolbox/shared/eda/edagraph + /usr/local/MATLAB/R2016a/toolbox/matlab/external/interfaces/webservices/wsdl + /usr/local/MATLAB/R2016a/toolbox/fixedpoint/fidemos + /usr/local/MATLAB/R2016a/toolbox/map/map + /usr/local/MATLAB/R2016a/toolbox/map/mapgeodesy + /usr/local/MATLAB/R2016a/toolbox/map/mapdisp + /usr/local/MATLAB/R2016a/toolbox/map/mapformats + /usr/local/MATLAB/R2016a/toolbox/map/mapproj + /usr/local/MATLAB/R2016a/toolbox/map/mapdata + /usr/local/MATLAB/R2016a/toolbox/map/mapdata/sdts + /usr/local/MATLAB/R2016a/toolbox/shared/statslib + /usr/local/MATLAB/R2016a/toolbox/shared/statslib/sensitivity + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/drives/drives + /usr/local/MATLAB/R2016a/toolbox/slcontrol/slcontrol + /usr/local/MATLAB/R2016a/toolbox/slcontrol/slctrlguis + /usr/local/MATLAB/R2016a/toolbox/slcontrol/slctrlutil + /usr/local/MATLAB/R2016a/toolbox/slcontrol/slctrlobsolete + /usr/local/MATLAB/R2016a/toolbox/matlab/spf/matlabservices + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/dialog + /usr/local/MATLAB/R2016a/toolbox/imaq/imaqdemos + /usr/local/MATLAB/R2016a/toolbox/symbolic/symbolicdemos + /usr/local/MATLAB/R2016a/toolbox/instrument/instrument + /usr/local/MATLAB/R2016a/toolbox/instrument/instrumentblks/instrumentblks + /usr/local/MATLAB/R2016a/toolbox/instrument/instrumentblks/instrumentmex + /usr/local/MATLAB/R2016a/toolbox/instrument/instrumentblks/instrumentmasks + /usr/local/MATLAB/R2016a/toolbox/eml/eml + /usr/local/MATLAB/R2016a/toolbox/coder/profile + /usr/local/MATLAB/R2016a/toolbox/database/database + /usr/local/MATLAB/R2016a/toolbox/database/vqb + /usr/local/MATLAB/R2016a/toolbox/map/mapdemos + /usr/local/MATLAB/R2016a/toolbox/shared/cxxfe_mi/cxxfe_mi + /usr/local/MATLAB/R2016a/toolbox/stats/mlearnapp + /usr/local/MATLAB/R2016a/toolbox/shared/eda/fpgaautomation + /usr/local/MATLAB/R2016a/toolbox/shared/eda/fpgaautomation/obsolete + /usr/local/MATLAB/R2016a/toolbox/comm/commdemos + /usr/local/MATLAB/R2016a/toolbox/physmod/pe/pedemos + /usr/local/MATLAB/R2016a/toolbox/slrequirements + /usr/local/MATLAB/R2016a/toolbox/shared/slcontrollib + /usr/local/MATLAB/R2016a/toolbox/geoweb/geoweb + /usr/local/MATLAB/R2016a/toolbox/shared/configset + /usr/local/MATLAB/R2016a/toolbox/comm/cdma2000 + /usr/local/MATLAB/R2016a/toolbox/signal/signalanalyzer + /usr/local/MATLAB/R2016a/toolbox/robotics/robotics + /usr/local/MATLAB/R2016a/toolbox/shared/can + /usr/local/MATLAB/R2016a/toolbox/shared/can/canblks + /usr/local/MATLAB/R2016a/toolbox/shared/can/canmasks + /usr/local/MATLAB/R2016a/toolbox/shared/can/canmex + /usr/local/MATLAB/R2016a/toolbox/simulink/fixedandfloat + /usr/local/MATLAB/R2016a/toolbox/simulink/fixedandfloat/obsolete + /usr/local/MATLAB/R2016a/toolbox/physmod/common/data/mli/m + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/foundation/mech + /usr/local/MATLAB/R2016a/toolbox/imaq/imaq + /usr/local/MATLAB/R2016a/toolbox/physmod/pm_visimpl/pm_visimpl + /usr/local/MATLAB/R2016a/toolbox/bioinfo/biodemos + /usr/local/MATLAB/R2016a/toolbox/shared/sigbldr + /usr/local/MATLAB/R2016a/toolbox/dsp/dsp + /usr/local/MATLAB/R2016a/toolbox/dsp/dsputilities + /usr/local/MATLAB/R2016a/toolbox/dsp/dsputilities/dspinit + /usr/local/MATLAB/R2016a/toolbox/dsp/dsputilities/dspmex + /usr/local/MATLAB/R2016a/toolbox/dsp/dsp/compiled + /usr/local/MATLAB/R2016a/toolbox/symbolic/symbolic + /usr/local/MATLAB/R2016a/toolbox/optim/optimdemos + /usr/local/MATLAB/R2016a/toolbox/curvefit/curvefitdemos + /usr/local/MATLAB/R2016a/toolbox/shared/instrument + /usr/local/MATLAB/R2016a/toolbox/physmod/common/external/library/m + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/slproject + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/slproject/menu + /usr/local/MATLAB/R2016a/toolbox/physmod/mech/mech + /usr/local/MATLAB/R2016a/toolbox/physmod/mech/importer + /usr/local/MATLAB/R2016a/toolbox/shared/simulation_data_repository + /usr/local/MATLAB/R2016a/help/toolbox/control/examples + /usr/local/MATLAB/R2016a/help/toolbox/vision/examples + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/powerdemo + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/powerdemo/meascontrol + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/powerdemo/power_utility + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/ssci/m + /usr/local/MATLAB/R2016a/toolbox/simulink/sl_async_streaming + /usr/local/MATLAB/R2016a/toolbox/shared/simulink/slcheck_services + /usr/local/MATLAB/R2016a/toolbox/shared/measure + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/powerdemo/simple + /usr/local/MATLAB/R2016a/toolbox/coder/trace + /usr/local/MATLAB/R2016a/toolbox/compiler_sdk + /usr/local/MATLAB/R2016a/toolbox/shared/diagnostic + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/templates + /usr/local/MATLAB/R2016a/toolbox/sldv/sldvdemos + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/repository + /usr/local/MATLAB/R2016a/toolbox/simulink/sta/repository/util + /usr/local/MATLAB/R2016a/toolbox/stats/stats + /usr/local/MATLAB/R2016a/toolbox/stats/classreg + /usr/local/MATLAB/R2016a/toolbox/stats/clustering + /usr/local/MATLAB/R2016a/toolbox/hdlcoder/hdllib/ml_lib + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/iodata/ioformat + /usr/local/MATLAB/R2016a/toolbox/matlab/audiovideo + /usr/local/MATLAB/R2016a/toolbox/matlab/webcam + /usr/local/MATLAB/R2016a/toolbox/shared/mldatx + /usr/local/MATLAB/R2016a/toolbox/robust/robust + /usr/local/MATLAB/R2016a/toolbox/robust/rctlmi + /usr/local/MATLAB/R2016a/toolbox/robust/rctutil + /usr/local/MATLAB/R2016a/toolbox/robust/rctobsolete/robust + /usr/local/MATLAB/R2016a/toolbox/robust/rctobsolete/lmi + /usr/local/MATLAB/R2016a/toolbox/robust/rctobsolete/mutools/commands + /usr/local/MATLAB/R2016a/toolbox/robust/rctobsolete/mutools/subs + /usr/local/MATLAB/R2016a/toolbox/shared/codeinstrum/codeinstrum + /usr/local/MATLAB/R2016a/toolbox/control/control + /usr/local/MATLAB/R2016a/toolbox/control/ctrlmodels + /usr/local/MATLAB/R2016a/toolbox/control/ctrlanalysis + /usr/local/MATLAB/R2016a/toolbox/control/ctrldesign + /usr/local/MATLAB/R2016a/toolbox/control/ctrlplots + /usr/local/MATLAB/R2016a/toolbox/control/ctrlguis + /usr/local/MATLAB/R2016a/toolbox/control/ctrlobsolete + /usr/local/MATLAB/R2016a/toolbox/control/ctrlutil + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/compiler/sli/m + /usr/local/MATLAB/R2016a/toolbox/shared/dastudio + /usr/local/MATLAB/R2016a/toolbox/stats/statsdemos + /usr/local/MATLAB/R2016a/toolbox/shared/curvefitlib + /usr/local/MATLAB/R2016a/toolbox/shared/slpir + /usr/local/MATLAB/R2016a/toolbox/shared/eda/fpgabase + /usr/local/MATLAB/R2016a/toolbox/physmod/common/dataservices/mli/m + /usr/local/MATLAB/R2016a/toolbox/shared/hdlshared/hdlshared_gui + /usr/local/MATLAB/R2016a/toolbox/shared/eda/hdlparser + /usr/local/MATLAB/R2016a/toolbox/physmod/network_engine/network_engine + /usr/local/MATLAB/R2016a/toolbox/target/extensions/processor/intelhost/tfl + /usr/local/MATLAB/R2016a/toolbox/coder/coverage + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/hdl + /usr/local/MATLAB/R2016a/toolbox/matlab/spf/matlabhost + /usr/local/MATLAB/R2016a/toolbox/mpc/mpc + /usr/local/MATLAB/R2016a/toolbox/mpc/mpcguis + /usr/local/MATLAB/R2016a/toolbox/mpc/mpcobsolete + /usr/local/MATLAB/R2016a/toolbox/mpc/mpcutils + /usr/local/MATLAB/R2016a/toolbox/simulink/slexportprevious + /usr/local/MATLAB/R2016a/toolbox/sl3d/sl3d + /usr/local/MATLAB/R2016a/toolbox/comm/comm + /usr/local/MATLAB/R2016a/toolbox/comm/commutilities/comminit + /usr/local/MATLAB/R2016a/toolbox/comm/commutilities/commmex + /usr/local/MATLAB/R2016a/toolbox/comm/commutilities + /usr/local/MATLAB/R2016a/toolbox/comm/commdeprecated + /usr/local/MATLAB/R2016a/toolbox/comm/comm/compiled + /usr/local/MATLAB/R2016a/toolbox/coder/connectivity + /usr/local/MATLAB/R2016a/toolbox/rtw/targets/connectivity + /usr/local/MATLAB/R2016a/toolbox/simulink/slhistory + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/templates + /usr/local/MATLAB/R2016a/toolbox/shared/spreadsheet + /usr/local/MATLAB/R2016a/toolbox/fixpoint + /usr/local/MATLAB/R2016a/toolbox/fixpoint/fpca + /usr/local/MATLAB/R2016a/toolbox/robotics/ros + /usr/local/MATLAB/R2016a/toolbox/physmod/ne_sli/ne_sli + /usr/local/MATLAB/R2016a/toolbox/shared/dsp/simulink/dsp + /usr/local/MATLAB/R2016a/toolbox/matlab/system + /usr/local/MATLAB/R2016a/toolbox/shared/eda/fil + /usr/local/MATLAB/R2016a/toolbox/shared/eda/fil/filmapi + /usr/local/MATLAB/R2016a/toolbox/coder/rtiostream + /usr/local/MATLAB/R2016a/toolbox/pde + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/powersys + /usr/local/MATLAB/R2016a/toolbox/shared/hotpluglib + /usr/local/MATLAB/R2016a/toolbox/shared/multimedia + /usr/local/MATLAB/R2016a/toolbox/shared/testmeaslib/graphics + /usr/local/MATLAB/R2016a/toolbox/matlab/addons_toolbox + /usr/local/MATLAB/R2016a/toolbox/shared/imageslib + /usr/local/MATLAB/R2016a/toolbox/physmod/pm_sli/pm_sli + /usr/local/MATLAB/R2016a/toolbox/shared/dastudio/seqdiagram + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/templates + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/gui/m + /usr/local/MATLAB/R2016a/toolbox/ident/ident + /usr/local/MATLAB/R2016a/toolbox/ident/nlident + /usr/local/MATLAB/R2016a/toolbox/ident/idobsolete + /usr/local/MATLAB/R2016a/toolbox/ident/idguis + /usr/local/MATLAB/R2016a/toolbox/ident/idutils + /usr/local/MATLAB/R2016a/toolbox/ident/idrecursive + /usr/local/MATLAB/R2016a/toolbox/ident/idhelp + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/powerdemo/machines + /usr/local/MATLAB/R2016a/toolbox/target/extensions/operatingsystem/windows/blks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/operatingsystem/windows/blks/masks + /usr/local/MATLAB/R2016a/toolbox/target/extensions/operatingsystem/windows/blks/mex + /usr/local/MATLAB/R2016a/toolbox/shared/networklib + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/sli/m + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/sm/m + /usr/local/MATLAB/R2016a/toolbox/shared/advisor + /usr/local/MATLAB/R2016a/toolbox/shared/filterdesignlib + /usr/local/MATLAB/R2016a/toolbox/matlab/connector/connector + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/util + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/errorhandler + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/xmakefile + /usr/local/MATLAB/R2016a/toolbox/idelink/foundation/hookpoints + /usr/local/MATLAB/R2016a/toolbox/shared/comparisons + /usr/local/MATLAB/R2016a/toolbox/signal/sigdemos + /usr/local/MATLAB/R2016a/toolbox/matlab/configtools + /usr/local/MATLAB/R2016a/toolbox/simbio/simbio + /usr/local/MATLAB/R2016a/toolbox/matlab/external/interfaces/python + /usr/local/MATLAB/R2016a/toolbox/shared/m3i + /usr/local/MATLAB/R2016a/toolbox/matlab/toolstrip + /usr/local/MATLAB/R2016a/toolbox/dsp/dspdeployabledemos + /usr/local/MATLAB/R2016a/toolbox/slvnv/styleguide + /usr/local/MATLAB/R2016a/help/toolbox/robust/examples + /usr/local/MATLAB/R2016a/toolbox/shared/deviceplugindetection + /usr/local/MATLAB/R2016a/toolbox/physmod/simscape/compiler/mli/m + /usr/local/MATLAB/R2016a/toolbox/physmod/gui/gfx/m + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/import/m + /usr/local/MATLAB/R2016a/toolbox/compiler/java + /usr/local/MATLAB/R2016a/toolbox/physmod/pe/utils/m + /usr/local/MATLAB/R2016a/toolbox/rtw/rtw + /usr/local/MATLAB/R2016a/toolbox/coder/foundation + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/build + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/build/tools/registry + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/tfl + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/tfl/AUTOSAR/AUTOSAR4p0/IFX + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/tfl/AUTOSAR/AUTOSAR4p0/IFL + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/tfl/gui + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/templates + /usr/local/MATLAB/R2016a/toolbox/shared/simtargets + /usr/local/MATLAB/R2016a/toolbox/physmod/mech/mechdemos + /usr/local/MATLAB/R2016a/toolbox/shared/maputils + /usr/local/MATLAB/R2016a/toolbox/coder/foundation/passmanager + /usr/local/MATLAB/R2016a/toolbox/simulink/simulink/iodata/iomap + /usr/local/MATLAB/R2016a/toolbox/fininst/fininstdemos + /usr/local/MATLAB/R2016a/toolbox/nnet + /usr/local/MATLAB/R2016a/toolbox/nnet/nncontrol + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnadapt + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nndatafun + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnderivative + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nndistance + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nndivision + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nninitlayer + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nninitnetwork + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nninitweight + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnlearn + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnnetfun + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnnetinput + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnnetwork + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnperformance + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnplot + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnprocess + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnsearch + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nntopology + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nntrain + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nntransfer + /usr/local/MATLAB/R2016a/toolbox/nnet/nnet/nnweight + /usr/local/MATLAB/R2016a/toolbox/nnet/nnguis + /usr/local/MATLAB/R2016a/toolbox/nnet/nnobsolete + /usr/local/MATLAB/R2016a/toolbox/nnet/nnutils + /usr/local/MATLAB/R2016a/toolbox/matlab/addons_product + /usr/local/MATLAB/R2016a/toolbox/shared/tracking/trackinglib + /usr/local/MATLAB/R2016a/toolbox/shared/simulink/sysarch/sysarch + /usr/local/MATLAB/R2016a/toolbox/shared/slreportgen/reportexplorer + /usr/local/MATLAB/R2016a/toolbox/coder/embeddedcoder_templates + /usr/local/MATLAB/R2016a/toolbox/coder/wizard + /usr/local/MATLAB/R2016a/toolbox/physmod/sm/core/m + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/ros + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/ros/helpers + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/robotalgs + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/robotalgs/helpers + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/robotcore + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/robotcore/helpers + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/robotsimulink + /usr/local/MATLAB/R2016a/toolbox/robotics/robotexamples/robotsimulink/helpers + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/engine + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/engine/numerics + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/engine/options + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/engine/optim + /usr/local/MATLAB/R2016a/toolbox/shared/controllib/engine/blocks + /usr/local/MATLAB/R2016a/toolbox/dsp/filterdesign + /usr/local/MATLAB/R2016a/toolbox/finance/findemos + /usr/local/MATLAB/R2016a/toolbox/physmod/powersys/facts/facts + + + +```matlab +pwd +``` + + ans = + + /home/ryan/Documents/UConn/ME3255/me3255_S2017/lecture_03 + + + +path + +## Assignments (`=`-operator) + +Matlab is interpreted language so each line of code (either saved text file or command-line) is executed as a standalone command + +These are reffered to "scripts" + + +```matlab +a=10; % line one assigns a to 10 +b=a*3; % line two assigns b to 10 times 3 by calling 'a' from line one +a+b % line three does not assign anything directly, but leaving off the ";" prints the result + % ans +``` + + ans = + + 40 + + +Matlab has a number of "objects" that you can assign to variables +1. arrays (vectors and matrices `[`...`]`) +2. strings (text `"`...`"` ) +3. cells (combination of strings, text, even function calls `{`...`}`) +3. functions (both built-in, defined or developed) +4. and more... (classes defined by `classdef` - you can create your own object to help organize data) + +### 1- Arrays + +Default in matlab is that when you assign a value to a variable, it is stored as an array + +arrays are N x M x ... values of integers or floating point numbers or complex integers/floating point numbers + +Use the parantheses to access values in an array `...(n,m)` + + +```matlab +a=10; % a is 1x1 array where a(1,1)==10 +a(1,1)==10 + +``` + + ans = + + 1 + + + +```matlab +a(2) +``` + + Index exceeds matrix dimensions. +  + + +```matlab +A = [1 2 3;4,5,6;7,8,9;10,11,12] +fprintf('size of A is %i x %i\n',size(A)) +A(3,1) +A(6) +``` + + A = + + 1 2 3 + 4 5 6 + 7 8 9 + 10 11 12 + + size of A is 4 x 3 + + ans = + + 7 + + + ans = + + 5 + + +vectors are either 1xN or Nx1 arrays for row and column + + +```matlab +v_row = [1,2,3] %row vector +v_column = [1;2;3] %column vector + +``` + + v_row = + + 1 2 3 + + + v_column = + + 1 + 2 + 3 + + +Matrices are MxN arrays +the `:`-symbol can substitute for a counting + + +```matlab +A(1,:) % the colon assumes you want the first value, 1, counting up by 1 to the last value, 4 +``` + + ans = + + 1 2 3 + + +You can also use every 2nd value or any other integer up to `end` which is the largest value of that row or column of the array + + +```matlab +A(1:2:end,1) % you can also use `end` +``` + + ans = + + 1 + 7 + + + +```matlab +A(:) +``` + + ans = + + 1 + 4 + 7 + 10 + 2 + 5 + 8 + 11 + 3 + 6 + 9 + 12 + + +In general, arrays can be any size + +take rolling 4 die and determining the sum of the components + + +```matlab +A_6666 = zeros(6,6,6,6); %make a 6 x 6 x 6 x 6 array (1296 different values) +for i=1:6 + for j=1:6 + for k=1:6 + for l=1:6 + A_6666(i,j,k,l)=i+j+k+l; % each value is the sum of the indices + end + end + end +end + +``` + + +```matlab +mean(A_6666(:)) +std(A_6666(:)) +``` + + ans = + + 14 + + + ans = + + 3.4170 + + + +```matlab +A_6666(1,4,2,5) +``` + + ans = + + 12 + + +## Cells combine different size arrays and text +### but, you cannot use math operators 'binary operators' + + +```matlab +C={}; +C{1}=linspace(0,1,10); +C{2}=linspace(0,1,3); +C{'z'}='holy cow'; +``` + + +```matlab +C{1}*C{1}' +``` + + ans = + + 3.5185 + + +## Strings can be combined and printed + + +```matlab +string1 = 'computational'; string2 = 'mechanics'; +[string1, ' ', string2] +``` + + ans = + + computational mechanics + + +use `fprintf` to format strings and numbers for output and `sprintf` to save variables + + + +```matlab +fprintf([string1,' ',string2,'\n\n']) +string = sprintf('the dog had %i legs and weighed %1.1f lbs',4,10.0) +``` + + computational mechanics + + + string = + + the dog had 4 legs and weighed 10.0 lbs + + +the `\` signifies a special character e.g. `\n` = newline, `\t` = tab + +to actually print the "\", use `\\` + + +```matlab +fprintf('\\') +``` + + \ + + +## This is helpful to create reports of computed data + + +```matlab +%fid = fopen('file.txt','w'); +fprintf(fid,[string1, ' ', string2]) +fprintf(fid,'\n') +fprintf(fid,string) +fprintf(fid,'\n') +fprintf(fid,'are you awake?') +``` + + ans = + + 23 + + + ans = + + 1 + + + ans = + + 39 + + + ans = + + 1 + + + ans = + + 14 + + +## Math operators (=, +, -, /, *, ^) + +Because matlab assumes all variables are matrices, then all operators are matrix operations + + +```matlab +a+a % add two 1x1 arrays +``` + + ans = 20 + + + +```matlab +A+A % add two 4 x 3 arrays +``` + + ans = + + 2 4 6 + 8 10 12 + 14 16 18 + 20 22 24 + + + + +```matlab +A*A' +``` + + ans = + + 14 32 50 68 + 32 77 122 167 + 50 122 194 266 + 68 167 266 365 + + + +```matlab +A.^2 +``` + + ans = + + 1 4 9 + 16 25 36 + 49 64 81 + 100 121 144 + + + +```matlab +A.*A +``` + + ans = + + 1 4 9 + 16 25 36 + 49 64 81 + 100 121 144 + + + +```matlab +A/A +``` + + [> In pymat_eval (line 31) + In matlabserver (line 24)] + [Warning: Rank deficient, rank = 2, tol = 1.696862e-14.] + + ans = + + 1.0000 0 0 -0.0000 + 0.6667 0 0 0.3333 + 0.3333 0 0 0.6667 + 0.0000 0 0 1.0000 + + + +```matlab +help / +``` + + / Slash or right matrix divide. + A/B is the matrix division of B into A, which is roughly the + same as A*INV(B) , except it is computed in a different way. + More precisely, A/B = (B'\A')'. See MLDIVIDE for details. + + C = MRDIVIDE(A,B) is called for the syntax 'A / B' when A or B is an + object. + + See also MLDIVIDE, RDIVIDE, LDIVIDE. + + Reference page in Doc Center + doc mrdivide + + Other functions named mrdivide + + codistributed/mrdivide gf/mrdivide laurpoly/mrdivide + duration/mrdivide gpuArray/mrdivide StaticModel/mrdivide + DynamicSystem/mrdivide LagOp/mrdivide timeseries/mrdivide + fints/mrdivide + + +To accomplish one-by-one operations, need to include a `.` + + +```matlab +A./A +``` + + ans = + + 1 1 1 + 1 1 1 + 1 1 1 + 1 1 1 + + + +But, for 1x1 arrays, these are considered scalars and you get a free-pass + + +```matlab +a*A % where a=10 and A is 1:12 in a 3 x 4 matrix +``` + + ans = + + 10 20 30 + 40 50 60 + 70 80 90 + 100 110 120 + + + +Some built in Matlab functions (e.g. the reasons to run Matlab) + + +```matlab +t_linear=linspace(0,1,11) +``` + + t_linear = + + Columns 1 through 7 + + 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 + + Columns 8 through 11 + + 0.7000 0.8000 0.9000 1.0000 + + + +```matlab +t_log = logspace(0,2,3) % log interval from 10^0 to 10^2 split into 3 values +``` + + t_log = + + 1 10 100 + + + +```matlab +help logspace +``` + + 'logspace' is a function from the file /usr/share/octave/4.0.0/m/general/logspace.m + + -- Function File: logspace (A, B) + -- Function File: logspace (A, B, N) + -- Function File: logspace (A, pi, N) + Return a row vector with N elements logarithmically spaced from + 10^A to 10^B. + + If N is unspecified it defaults to 50. + + If B is equal to pi, the points are between 10^A and pi, _not_ 10^A + and 10^pi, in order to be compatible with the corresponding MATLAB + function. + + Also for compatibility with MATLAB, return the second argument B if + fewer than two values are requested. + + See also: linspace. + + Additional help for built-in functions and operators is + available in the online version of the manual. Use the command + 'doc ' to search the manual index. + + Help and information about Octave is also available on the WWW + at http://www.octave.org and via the help@octave.org + mailing list. + + +## When using the command prompt, anything in your path or working directory can be run either as a script, function or class (to define objects) + + +```matlab +%myscript +``` + + +```matlab +%plot --format svg +``` + +When using the GUI, your command history is saved, but it is better to save your work either as a script or a function or combination of both + +Creating a default graph script: + + +```matlab +set(0, 'defaultAxesFontSize', 16) +set(0,'defaultTextFontSize',14) +set(0,'defaultLineLineWidth',3) +``` + + +```matlab +plot(t_linear,t_linear.^2) +xlabel('time (s)') +ylabel('displacement (m)') +``` + + +![png](output_58_0.png) + + +#EOL + +## Graphics can be produced with a number of functions + +2-D plots, 3-D plots, contour plots, 3D contour plots ... + + +```matlab +x=linspace(-1,1,21); y=linspace(-1,1,21); +[X,Y]=meshgrid(x,y); +Z=(X.*Y.^3-X.^3.*Y) +``` + + Z = + + Columns 1 through 8: + + 0.00000 0.17100 0.28800 0.35700 0.38400 0.37500 0.33600 0.27300 + -0.17100 0.00000 0.12240 0.20160 0.24300 0.25200 0.23400 0.19440 + -0.28800 -0.12240 0.00000 0.08400 0.13440 0.15600 0.15360 0.13200 + -0.35700 -0.20160 -0.08400 0.00000 0.05460 0.08400 0.09240 0.08400 + -0.38400 -0.24300 -0.13440 -0.05460 0.00000 0.03300 0.04800 0.04860 + -0.37500 -0.25200 -0.15600 -0.08400 -0.03300 0.00000 0.01800 0.02400 + -0.33600 -0.23400 -0.15360 -0.09240 -0.04800 -0.01800 0.00000 0.00840 + -0.27300 -0.19440 -0.13200 -0.08400 -0.04860 -0.02400 -0.00840 0.00000 + -0.19200 -0.13860 -0.09600 -0.06300 -0.03840 -0.02100 -0.00960 -0.00300 + -0.09900 -0.07200 -0.05040 -0.03360 -0.02100 -0.01200 -0.00600 -0.00240 + 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 + 0.09900 0.07200 0.05040 0.03360 0.02100 0.01200 0.00600 0.00240 + 0.19200 0.13860 0.09600 0.06300 0.03840 0.02100 0.00960 0.00300 + 0.27300 0.19440 0.13200 0.08400 0.04860 0.02400 0.00840 -0.00000 + 0.33600 0.23400 0.15360 0.09240 0.04800 0.01800 -0.00000 -0.00840 + 0.37500 0.25200 0.15600 0.08400 0.03300 0.00000 -0.01800 -0.02400 + 0.38400 0.24300 0.13440 0.05460 -0.00000 -0.03300 -0.04800 -0.04860 + 0.35700 0.20160 0.08400 -0.00000 -0.05460 -0.08400 -0.09240 -0.08400 + 0.28800 0.12240 0.00000 -0.08400 -0.13440 -0.15600 -0.15360 -0.13200 + 0.17100 -0.00000 -0.12240 -0.20160 -0.24300 -0.25200 -0.23400 -0.19440 + 0.00000 -0.17100 -0.28800 -0.35700 -0.38400 -0.37500 -0.33600 -0.27300 + + Columns 9 through 16: + + 0.19200 0.09900 0.00000 -0.09900 -0.19200 -0.27300 -0.33600 -0.37500 + 0.13860 0.07200 0.00000 -0.07200 -0.13860 -0.19440 -0.23400 -0.25200 + 0.09600 0.05040 0.00000 -0.05040 -0.09600 -0.13200 -0.15360 -0.15600 + 0.06300 0.03360 0.00000 -0.03360 -0.06300 -0.08400 -0.09240 -0.08400 + 0.03840 0.02100 0.00000 -0.02100 -0.03840 -0.04860 -0.04800 -0.03300 + 0.02100 0.01200 0.00000 -0.01200 -0.02100 -0.02400 -0.01800 0.00000 + 0.00960 0.00600 0.00000 -0.00600 -0.00960 -0.00840 0.00000 0.01800 + 0.00300 0.00240 0.00000 -0.00240 -0.00300 0.00000 0.00840 0.02400 + 0.00000 0.00060 0.00000 -0.00060 0.00000 0.00300 0.00960 0.02100 + -0.00060 0.00000 0.00000 0.00000 0.00060 0.00240 0.00600 0.01200 + 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 + 0.00060 -0.00000 0.00000 0.00000 -0.00060 -0.00240 -0.00600 -0.01200 + -0.00000 -0.00060 0.00000 0.00060 0.00000 -0.00300 -0.00960 -0.02100 + -0.00300 -0.00240 0.00000 0.00240 0.00300 0.00000 -0.00840 -0.02400 + -0.00960 -0.00600 0.00000 0.00600 0.00960 0.00840 0.00000 -0.01800 + -0.02100 -0.01200 0.00000 0.01200 0.02100 0.02400 0.01800 0.00000 + -0.03840 -0.02100 0.00000 0.02100 0.03840 0.04860 0.04800 0.03300 + -0.06300 -0.03360 0.00000 0.03360 0.06300 0.08400 0.09240 0.08400 + -0.09600 -0.05040 0.00000 0.05040 0.09600 0.13200 0.15360 0.15600 + -0.13860 -0.07200 0.00000 0.07200 0.13860 0.19440 0.23400 0.25200 + -0.19200 -0.09900 0.00000 0.09900 0.19200 0.27300 0.33600 0.37500 + + Columns 17 through 21: + + -0.38400 -0.35700 -0.28800 -0.17100 0.00000 + -0.24300 -0.20160 -0.12240 0.00000 0.17100 + -0.13440 -0.08400 0.00000 0.12240 0.28800 + -0.05460 0.00000 0.08400 0.20160 0.35700 + 0.00000 0.05460 0.13440 0.24300 0.38400 + 0.03300 0.08400 0.15600 0.25200 0.37500 + 0.04800 0.09240 0.15360 0.23400 0.33600 + 0.04860 0.08400 0.13200 0.19440 0.27300 + 0.03840 0.06300 0.09600 0.13860 0.19200 + 0.02100 0.03360 0.05040 0.07200 0.09900 + 0.00000 0.00000 0.00000 0.00000 0.00000 + -0.02100 -0.03360 -0.05040 -0.07200 -0.09900 + -0.03840 -0.06300 -0.09600 -0.13860 -0.19200 + -0.04860 -0.08400 -0.13200 -0.19440 -0.27300 + -0.04800 -0.09240 -0.15360 -0.23400 -0.33600 + -0.03300 -0.08400 -0.15600 -0.25200 -0.37500 + 0.00000 -0.05460 -0.13440 -0.24300 -0.38400 + 0.05460 0.00000 -0.08400 -0.20160 -0.35700 + 0.13440 0.08400 0.00000 -0.12240 -0.28800 + 0.24300 0.20160 0.12240 0.00000 -0.17100 + 0.38400 0.35700 0.28800 0.17100 0.00000 + + + + +```matlab +contour(X,Y,Z) +``` + + +![svg](output_63_0.svg) + + + +```matlab +mesh(X,Y,Z) +``` + + +![svg](output_64_0.svg) + + + +```matlab +pcolor(X,Y,Z) +``` + + +![svg](output_65_0.svg) + + +## diff --git a/03_Intro to matlab-octave/octave-workspace b/03_Intro to matlab-octave/octave-workspace new file mode 100644 index 0000000..8c437bb Binary files /dev/null and b/03_Intro to matlab-octave/octave-workspace differ diff --git a/03_Intro to matlab-octave/output_58_0.png b/03_Intro to matlab-octave/output_58_0.png new file mode 100644 index 0000000..1737c76 Binary files /dev/null and b/03_Intro to matlab-octave/output_58_0.png differ diff --git a/03_Intro to matlab-octave/output_63_0.svg b/03_Intro to matlab-octave/output_63_0.svg new file mode 100644 index 0000000..3ed45d2 --- /dev/null +++ b/03_Intro to matlab-octave/output_63_0.svg @@ -0,0 +1,270 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1 + + + + + -0.5 + + + + + 0 + + + + + 0.5 + + + + + 1 + + + + + -1 + + + + + -0.5 + + + + + 0 + + + + + 0.5 + + + + + 1 + + + + + + + + + gnuplot_plot_1a + + + + gnuplot_plot_2a + + + + gnuplot_plot_3a + + + + gnuplot_plot_4a + + + + gnuplot_plot_5a + + + + gnuplot_plot_6a + + + + gnuplot_plot_7a + + + + gnuplot_plot_8a + + + + gnuplot_plot_9a + + + + gnuplot_plot_10a + + + + gnuplot_plot_11a + + + + gnuplot_plot_12a + + + + gnuplot_plot_13a + + + + gnuplot_plot_14a + + + + gnuplot_plot_15a + + + + gnuplot_plot_16a + + + + gnuplot_plot_17a + + + + gnuplot_plot_18a + + + + gnuplot_plot_19a + + + + gnuplot_plot_20a + + + + gnuplot_plot_21a + + + + gnuplot_plot_22a + + + + gnuplot_plot_23a + + + + gnuplot_plot_24a + + + + gnuplot_plot_25a + + + + gnuplot_plot_26a + + + + gnuplot_plot_27a + + + + gnuplot_plot_28a + + + + gnuplot_plot_29a + + + + gnuplot_plot_30a + + + + gnuplot_plot_31a + + + + gnuplot_plot_32a + + + + gnuplot_plot_33a + + + + gnuplot_plot_34a + + + + gnuplot_plot_35a + + + + gnuplot_plot_36a + + + + gnuplot_plot_37a + + + + gnuplot_plot_38a + + + + gnuplot_plot_39a + + + + gnuplot_plot_40a + + + + + + + + + + + + + \ No newline at end of file diff --git a/03_Intro to matlab-octave/output_64_0.svg b/03_Intro to matlab-octave/output_64_0.svg new file mode 100644 index 0000000..509634c --- /dev/null +++ b/03_Intro to matlab-octave/output_64_0.svg @@ -0,0 +1,1632 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gnuplot_plot_1a + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gnuplot_plot_2a + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1 + + + + + + + + + + + + + -0.5 + + + + + + + + + 0 + + + + + + + + + 0.5 + + + + + + + + + + + 1 + + + + + + + + + + + -1 + + + + + + + + + + + -0.5 + + + + + + + + + + + 0 + + + + + + + + + + + + + 0.5 + + + + + + + + + 1 + + + + + + + + + + + + + -0.4 + + + + + + + + + + + + + + + -0.3 + + + + + + + + + + + + + -0.2 + + + + + + + + + + + + + + + + + -0.1 + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + 0.1 + + + + + + + + + + + + + + + + + + + 0.2 + + + + + + + + + + + + + + + + + 0.3 + + + + + + + + + + + + + 0.4 + + + + + + + + \ No newline at end of file diff --git a/03_Intro to matlab-octave/output_65_0.svg b/03_Intro to matlab-octave/output_65_0.svg new file mode 100644 index 0000000..5ce036b --- /dev/null +++ b/03_Intro to matlab-octave/output_65_0.svg @@ -0,0 +1,2146 @@ + + +Gnuplot +Produced by GNUPLOT 5.0 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gnuplot_plot_1a + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1 + + + + + + + + + -0.5 + + + + + + + + + 0 + + + + + + + + + 0.5 + + + + + + + + + 1 + + + + + + + + + -1 + + + + + + + + + -0.5 + + + + + + + + + 0 + + + + + + + + + 0.5 + + + + + + + + + 1 + + + + + + \ No newline at end of file diff --git a/04_intro to m-files/.ipynb_checkpoints/04_intro to m-files-checkpoint.ipynb b/04_intro to m-files/.ipynb_checkpoints/04_intro to m-files-checkpoint.ipynb new file mode 100644 index 0000000..2d8f07b --- /dev/null +++ b/04_intro to m-files/.ipynb_checkpoints/04_intro to m-files-checkpoint.ipynb @@ -0,0 +1,1612 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "setdefaults" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Functions\n", + "\n", + "So far, everything has been executed as a script, or calling a built-in function. \n", + "\n", + "Now we begin building our own functions.\n", + "\n", + "Functions are saved in memory (or better yet) in a folder in your path or current directory\n", + "\n", + "Example of storing a function in memory\n", + "\n", + "$f(x,y) = (xy^{3}-x^{3}y)$" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "f =\n", + "\n", + "@(x, y) (x .* y .^ 3 - x .^ 3 .* y)\n", + "\n" + ] + } + ], + "source": [ + "f= @(x,y) (x.*y.^3-x.^3.*y)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "x=linspace(-1,1,10); % 10 data points from -1 to 1\n", + "y=linspace(-1,1,10); % 10 data points from -1 to 1\n", + "[X,Y]=meshgrid(x,y); % 100 data points from -1 to 1 on the x- and y-axes\n", + "Z=f(X,Y); % Z=f(X,Y) evaluated at the 100 data points\n", + "\n", + "mesh(X,Y,Z)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Here we will save a function called `my_velocity` as `my_velocity.m`\n", + "\n", + "```matlab \n", + "function [vx,vy] = my_velocity(x,y,t)\n", + " % Help documentation of \"my_velocity\"\n", + " % This function computes the velocity in the x- and y-directions given\n", + " % three vectors of position in x- and y-directions as a function of time\n", + " % x = x-position\n", + " % y = y-position\n", + " % t = time\n", + " % output\n", + " % vx = velocity in x-direction\n", + " % vy = velocity in y-direction\n", + " \n", + " vx=zeros(length(t),1);\n", + " vy=zeros(length(t),1);\n", + " \n", + " vx(1:end-1) = diff(x)./diff(t); % calculate vx as delta x/delta t\n", + " vy(1:end-1) = diff(y)./diff(t); % calculate vy as delta y/delta t\n", + " \n", + " vx(end) = vx(end-1);\n", + " vy(end) = vy(end-1);\n", + "\n", + "end\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'my_velocity' is a function from the file /home/ryan/Documents/UConn/ME3255/me3255_S2017/course_git/lecture_04/my_velocity.m\n", + "\n", + " Help documentation of \"my_velocity\"\n", + " This function computes the velocity in the x- and y-directions given\n", + " three vectors of position in x- and y-directions as a function of time\n", + " x = x-position\n", + " y = y-position\n", + " t = time\n", + " output\n", + " vx = velocity in x-direction\n", + " vy = velocity in y-direction\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help my_velocity" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "t=linspace(0,10,100)'; \n", + "x=t.^3; % vx = 3*t^2\n", + "y=t.^2/2; % vy = t\n", + "[vx,vy]=my_velocity(x,y,t);" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t100\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t150\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t200\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t250\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t300\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tvx\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\ttime\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\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", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tvy\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1b\n", + "\n", + "\n", + "\n", + "\t\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_2b\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": [ + "[axes,h1,h2] = plotyy(t(1:10:end),vx(1:10:end), t(1:10:end),vy(1:10:end));\n", + "set([h1,h2],\"marker\",\"o\")\n", + "set([h1,h2],\"linewidth\",0)\n", + "hold on\n", + "[~,h3,h4]=plotyy(t,3*t.^2,t,1*t);\n", + "xlabel (\"time\");\n", + "ylabel (axes(1), \"v_{x}\");\n", + "ylabel (axes(2), \"v_{y}\");" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "COLORMAP Color look-up table.\n", + " COLORMAP(MAP) sets the current figure's colormap to MAP.\n", + " COLORMAP('default') sets the current figure's colormap to\n", + " the root's default, whose setting is PARULA.\n", + " MAP = COLORMAP returns the three-column matrix of RGB triplets defining \n", + " the colormap for the current figure.\n", + " COLORMAP(FIG,...) sets the colormap for the figure specified by FIG.\n", + " COLORMAP(AX,...) sets the colormap for the axes specified by AX. \n", + " Each axes within a figure can have a unique colormap. After you set\n", + " an axes colormap, changing the figure colormap does not affect the axes.\n", + " MAP = COLORMAP(FIG) returns the colormap for the figure specified by FIG.\n", + " MAP = COLORMAP(AX) returns the colormap for the axes specified by AX.\n", + " \n", + " A color map matrix may have any number of rows, but it must have\n", + " exactly 3 columns. Each row is interpreted as a color, with the\n", + " first element specifying the intensity of red light, the second\n", + " green, and the third blue. Color intensity can be specified on the\n", + " interval 0.0 to 1.0.\n", + " For example, [0 0 0] is black, [1 1 1] is white,\n", + " [1 0 0] is pure red, [.5 .5 .5] is gray, and\n", + " [127/255 1 212/255] is aquamarine.\n", + " \n", + " Graphics objects that use pseudocolor -- SURFACE and PATCH objects,\n", + " which are created by the functions MESH, SURF, and PCOLOR -- map\n", + " a color matrix, C, whose values are in the range [Cmin, Cmax],\n", + " to an array of indices, k, in the range [1, m].\n", + " The values of Cmin and Cmax are either min(min(C)) and max(max(C)),\n", + " or are specified by CAXIS. The mapping is linear, with Cmin\n", + " mapping to index 1 and Cmax mapping to index m. The indices are\n", + " then used with the colormap to determine the color associated\n", + " with each matrix element. See CAXIS for details.\n", + " \n", + " Type HELP GRAPH3D to see a number of useful colormaps.\n", + " \n", + " COLORMAP is a function that sets the Colormap property of a figure.\n", + " \n", + " See also HSV, CAXIS, SPINMAP, BRIGHTEN, RGBPLOT, FIGURE, COLORMAPEDITOR.\n", + "\n", + " Reference page in Doc Center\n", + " doc colormap\n" + ] + } + ], + "source": [ + "help colormap" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Create a new function that calls 'my_velocity' called, `my_acceleration.m`\n", + "\n", + "```matlab\n", + "function [ax,ay]=my_acceleration(x,y,t)\n", + " % Help documentation of \"my_acceleration\"\n", + " % This function computes the acceleration in the x- and y-directions given\n", + " % three vectors of position in x- and y-directions as a function of time\n", + " % x = x-position\n", + " % y = y-position\n", + " % t = time\n", + " % output\n", + " % ax = acceleration in x-direction\n", + " % ay = acceleration in y-direction\n", + "\n", + " function v=diff_match_dims(x,t)\n", + " v=zeros(length(t),1);\n", + " v(1:end-1)=diff(x)./diff(t);\n", + " v(end)=v(end-1);\n", + " end\n", + "\n", + " [vx,vy]=my_velocity(x,y,t);\n", + "\n", + " ax = diff_match_dims(vx,t);\n", + " ay = diff_match_dims(vy,t);\n", + "\n", + "end\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'my_acceleration' is a function from the file /home/ryan/Documents/UConn/ME3255/me3255_S2017/course_git/lecture_04/my_acceleration.m\n", + "\n", + " Help documentation of \"my_acceleration\"\n", + " This function computes the acceleration in the x- and y-directions given\n", + " three vectors of position in x- and y-directions as a function of time\n", + " x = x-position\n", + " y = y-position\n", + " t = time\n", + " output\n", + " ax = acceleration in x-direction\n", + " ay = acceleration in y-direction\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help my_acceleration" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "[ax,ay]=my_acceleration(x,y,t);" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t40\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t60\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tax\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\ttime\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\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", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.85\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.9\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.95\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1.05\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1.1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1.15\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1b\n", + "\n", + "\n", + "\n", + "\t\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_2b\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": [ + "[axes,h1,h2] = plotyy(t(1:10:end),ax(1:10:end), t(1:10:end),ay(1:10:end));\n", + "set([h1,h2],\"linewidth\",0)\n", + "set([h1,h2],\"marker\",'s')\n", + "hold on\n", + "[~,h3,h4]=plotyy(t,6*t,t,1*t./t);\n", + "xlabel (\"time\");\n", + "ylabel (axes(1), \"a_{x}\");\n", + "ylabel (axes(2), \"a_{y}\");\n" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "error: 'diff_match_dims' undefined near line 1 column 1\r\n" + ] + } + ], + "source": [ + "diff_match_dims(x,t)" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/04_intro to m-files/04_intro to m-files.ipynb b/04_intro to m-files/04_intro to m-files.ipynb new file mode 100644 index 0000000..45bb1a0 --- /dev/null +++ b/04_intro to m-files/04_intro to m-files.ipynb @@ -0,0 +1,1603 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "setdefaults" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Intro to functions and m-files" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Building our own functions." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "source": [ + "Functions are saved in memory (or better yet) in a folder in your path or current directory\n", + "\n", + "Example of storing a function in memory\n", + "\n", + "$f(x,y) = (xy^{3}-x^{3}y)$" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "f =\n", + "\n", + "@(x, y) (x .* y .^ 3 - x .^ 3 .* y)\n", + "\n", + "ans = 6\n" + ] + } + ], + "source": [ + "f= @(x,y) (x.*y.^3-x.^3.*y)\n", + "f(1,2)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\n", + "\tgnuplot_plot_2a\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.1\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "x=linspace(-1,1,10); % 10 data points from -1 to 1\n", + "y=linspace(-1,1,10); % 10 data points from -1 to 1\n", + "[X,Y]=meshgrid(x,y); % 100 data points from -1 to 1 on the x- and y-axes\n", + "Z=f(X,Y); % Z=f(X,Y) evaluated at the 100 data points\n", + "\n", + "mesh(X,Y,Z)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Here we will save a function called `my_velocity` as `my_velocity.m`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [], + "source": [ + "function [vx,vy] = my_velocity(x,y,t)\n", + " % Help documentation of \"my_velocity\"\n", + " % This function computes the velocity in the x- and y-directions given\n", + " % three vectors of position in x- and y-directions as a function of time\n", + " % x = x-position\n", + " % y = y-position\n", + " % t = time\n", + " % output\n", + " % vx = velocity in x-direction\n", + " % vy = velocity in y-direction\n", + " \n", + " vx=zeros(length(t),1);\n", + " vy=zeros(length(t),1);\n", + " \n", + " vx(1:end-1) = diff(x)./diff(t); % calculate vx as delta x/delta t\n", + " vy(1:end-1) = diff(y)./diff(t); % calculate vy as delta y/delta t\n", + " \n", + " vx(end) = vx(end-1);\n", + " vy(end) = vy(end-1);\n", + "\n", + "end" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'my_velocity' is a function from the file /home/ryan/Documents/UConn/ME3255/course_git_S2017/04_intro to m-files/my_velocity.m\n", + "\n", + " Help documentation of \"my_velocity\"\n", + " This function computes the velocity in the x- and y-directions given\n", + " three vectors of position in x- and y-directions as a function of time\n", + " x = x-position\n", + " y = y-position\n", + " t = time\n", + " output\n", + " vx = velocity in x-direction\n", + " vy = velocity in y-direction\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help my_velocity" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "t=linspace(0,10,100)'; \n", + "x=t.^3; % vx = 3*t^2\n", + "y=t.^2/2; % vy = t\n", + "[vx,vy]=my_velocity(x,y,t);" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t100\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t150\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t200\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t250\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t300\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tvx\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\ttime\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\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", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tvy\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1b\n", + "\n", + "\n", + "\n", + "\t\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_2b\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": [ + "[axes,h1,h2] = plotyy(t(1:10:end),vx(1:10:end), t(1:10:end),vy(1:10:end));\n", + "set([h1,h2],\"marker\",\"o\")\n", + "set([h1,h2],\"linewidth\",0)\n", + "hold on\n", + "[~,h3,h4]=plotyy(t,3*t.^2,t,1*t);\n", + "xlabel (\"time\");\n", + "ylabel (axes(1), \"v_{x}\");\n", + "ylabel (axes(2), \"v_{y}\");" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "Create a new function that calls 'my_velocity' called, `my_acceleration.m`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "fragment" + } + }, + "outputs": [], + "source": [ + "function [ax,ay]=my_acceleration(x,y,t)\n", + " % Help documentation of \"my_acceleration\"\n", + " % This function computes the acceleration in the x- and y-directions given\n", + " % three vectors of position in x- and y-directions as a function of time\n", + " % x = x-position\n", + " % y = y-position\n", + " % t = time\n", + " % output\n", + " % ax = acceleration in x-direction\n", + " % ay = acceleration in y-direction\n", + "\n", + " function v=diff_match_dims(x,t)\n", + " v=zeros(length(t),1);\n", + " v(1:end-1)=diff(x)./diff(t);\n", + " v(end)=v(end-1);\n", + " end\n", + "\n", + " [vx,vy]=my_velocity(x,y,t);\n", + "\n", + " ax = diff_match_dims(vx,t);\n", + " ay = diff_match_dims(vy,t);\n", + "\n", + "end" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'my_acceleration' is a function from the file /home/ryan/Documents/UConn/ME3255/me3255_S2017/course_git/lecture_04/my_acceleration.m\n", + "\n", + " Help documentation of \"my_acceleration\"\n", + " This function computes the acceleration in the x- and y-directions given\n", + " three vectors of position in x- and y-directions as a function of time\n", + " x = x-position\n", + " y = y-position\n", + " t = time\n", + " output\n", + " ax = acceleration in x-direction\n", + " ay = acceleration in y-direction\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help my_acceleration" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "t=linspace(0,10,100)'; \n", + "x=t.^3; % ax = 6*t\n", + "y=t.^2/2; % ay = 1\n", + "[ax,ay]=my_acceleration(x,y,t);" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t40\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t50\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t60\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\t\tax\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\ttime\n", + "\t\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\t\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", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t2\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t4\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t6\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t8\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.85\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.9\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t0.95\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1.05\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1.1\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t1.15\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\tgnuplot_plot_1b\n", + "\n", + "\n", + "\n", + "\t\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_2b\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": [ + "[axes,h1,h2] = plotyy(t(1:10:end),ax(1:10:end), t(1:10:end),ay(1:10:end));\n", + "set([h1,h2],\"linewidth\",0)\n", + "set([h1,h2],\"marker\",'s')\n", + "hold on\n", + "[~,h3,h4]=plotyy(t,6*t,t,1*t./t);\n", + "xlabel (\"time\");\n", + "ylabel (axes(1), \"a_{x}\");\n", + "ylabel (axes(2), \"a_{y}\");\n" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "error: help: 'diff_match_dims' not found\r\n" + ] + } + ], + "source": [ + "help diff_match_dims" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Thanks " + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/04_intro to m-files/lecture_4.md b/04_intro to m-files/lecture_4.md new file mode 100644 index 0000000..dd549aa --- /dev/null +++ b/04_intro to m-files/lecture_4.md @@ -0,0 +1,339 @@ + +## When using the command prompt, anything in your path or working directory can be run either as a script, function or class (to define objects) + +Questions from last class: +- I downloaded GitHub to my desktop but I cannot sign into my UConn account like I can online. +- I checked my grades on HuskyCt recently and I received a 0 / 100 for Homework 1. +- It is very hard to tell if what I'm doing on github is right or wrong. +- How often will be using our laptops during the lecture? +- How many frogs would it take to move a car that is stuck in the snow? And what would be the approximate cost to do so + +$m_{frog}$=22.7 g (https://en.wikipedia.org/wiki/Common_frog) + +$v_{frog}$=17 kph = 4.72 m/s (http://purelyfacts.com/question/14/is-a-toad-faster-than-a-frog?DDA=113&DDB=40) + +$m_{car}$=1000 kg (reasonable guess) + +conservation of momentum: + +$mv_{1} +mv_{2} = mv_{1}'+mv_{2}' = m_{total}v_{2}'$ + + +```matlab +number_of_frogs = 1; +v2=0; +while v2 < 1 % 1 m/s + m_frogs=number_of_frogs*22.7e-3; + number_of_frogs=number_of_frogs+1; + p1=(m_frogs)*4.72; % momentum 1 + v2=p1/(m_frogs+1000); % p2=p1, so v2=p1/m_total +end +number_of_frogs + +``` + + number_of_frogs = + + 11844 + + + +```matlab +%myscript +``` + + +```matlab +%plot --format svg +``` + +When using the GUI, your command history is saved, but it is better to save your work either as a script or a function or combination of both + +Creating a default graph script: `setdefaults.m` + +```matlab +set(0, 'defaultAxesFontSize', 16) +set(0,'defaultTextFontSize',14) +set(0,'defaultLineLineWidth',3) +``` + + +```matlab +set(0, 'defaultAxesFontSize', 16) +set(0,'defaultTextFontSize',14) +set(0,'defaultLineLineWidth',3) +``` + + +```matlab +t_linear=linspace(0,10,100); +plot(t_linear,t_linear.^2) +xlabel('time (s)') +ylabel('displacement (m)') +``` + + +![png](lecture_4_files/lecture_4_7_0.png) + + +#EOL + +## Graphics can be produced with a number of functions + +2-D plots, 3-D plots, contour plots, 3D contour plots ... + + +```matlab +x=linspace(-1,1,21); y=linspace(-1,1,21); +[X,Y]=meshgrid(x,y); +Z=(X.*Y.^3-X.^3.*Y) +``` + + Z = + + Columns 1 through 7 + + 0 0.1710 0.2880 0.3570 0.3840 0.3750 0.3360 + -0.1710 0 0.1224 0.2016 0.2430 0.2520 0.2340 + -0.2880 -0.1224 0 0.0840 0.1344 0.1560 0.1536 + -0.3570 -0.2016 -0.0840 0 0.0546 0.0840 0.0924 + -0.3840 -0.2430 -0.1344 -0.0546 0 0.0330 0.0480 + -0.3750 -0.2520 -0.1560 -0.0840 -0.0330 0 0.0180 + -0.3360 -0.2340 -0.1536 -0.0924 -0.0480 -0.0180 0 + -0.2730 -0.1944 -0.1320 -0.0840 -0.0486 -0.0240 -0.0084 + -0.1920 -0.1386 -0.0960 -0.0630 -0.0384 -0.0210 -0.0096 + -0.0990 -0.0720 -0.0504 -0.0336 -0.0210 -0.0120 -0.0060 + 0 0 0 0 0 0 0 + 0.0990 0.0720 0.0504 0.0336 0.0210 0.0120 0.0060 + 0.1920 0.1386 0.0960 0.0630 0.0384 0.0210 0.0096 + 0.2730 0.1944 0.1320 0.0840 0.0486 0.0240 0.0084 + 0.3360 0.2340 0.1536 0.0924 0.0480 0.0180 0.0000 + 0.3750 0.2520 0.1560 0.0840 0.0330 0 -0.0180 + 0.3840 0.2430 0.1344 0.0546 -0.0000 -0.0330 -0.0480 + 0.3570 0.2016 0.0840 0 -0.0546 -0.0840 -0.0924 + 0.2880 0.1224 0 -0.0840 -0.1344 -0.1560 -0.1536 + 0.1710 0.0000 -0.1224 -0.2016 -0.2430 -0.2520 -0.2340 + 0 -0.1710 -0.2880 -0.3570 -0.3840 -0.3750 -0.3360 + + Columns 8 through 14 + + 0.2730 0.1920 0.0990 0 -0.0990 -0.1920 -0.2730 + 0.1944 0.1386 0.0720 0 -0.0720 -0.1386 -0.1944 + 0.1320 0.0960 0.0504 0 -0.0504 -0.0960 -0.1320 + 0.0840 0.0630 0.0336 0 -0.0336 -0.0630 -0.0840 + 0.0486 0.0384 0.0210 0 -0.0210 -0.0384 -0.0486 + 0.0240 0.0210 0.0120 0 -0.0120 -0.0210 -0.0240 + 0.0084 0.0096 0.0060 0 -0.0060 -0.0096 -0.0084 + 0 0.0030 0.0024 0 -0.0024 -0.0030 0 + -0.0030 0 0.0006 0 -0.0006 0 0.0030 + -0.0024 -0.0006 0 0 0.0000 0.0006 0.0024 + 0 0 0 0 0 0 0 + 0.0024 0.0006 -0.0000 0 0 -0.0006 -0.0024 + 0.0030 0 -0.0006 0 0.0006 0 -0.0030 + 0 -0.0030 -0.0024 0 0.0024 0.0030 0 + -0.0084 -0.0096 -0.0060 0 0.0060 0.0096 0.0084 + -0.0240 -0.0210 -0.0120 0 0.0120 0.0210 0.0240 + -0.0486 -0.0384 -0.0210 0 0.0210 0.0384 0.0486 + -0.0840 -0.0630 -0.0336 0 0.0336 0.0630 0.0840 + -0.1320 -0.0960 -0.0504 0 0.0504 0.0960 0.1320 + -0.1944 -0.1386 -0.0720 0 0.0720 0.1386 0.1944 + -0.2730 -0.1920 -0.0990 0 0.0990 0.1920 0.2730 + + Columns 15 through 21 + + -0.3360 -0.3750 -0.3840 -0.3570 -0.2880 -0.1710 0 + -0.2340 -0.2520 -0.2430 -0.2016 -0.1224 -0.0000 0.1710 + -0.1536 -0.1560 -0.1344 -0.0840 0 0.1224 0.2880 + -0.0924 -0.0840 -0.0546 0 0.0840 0.2016 0.3570 + -0.0480 -0.0330 0.0000 0.0546 0.1344 0.2430 0.3840 + -0.0180 0 0.0330 0.0840 0.1560 0.2520 0.3750 + -0.0000 0.0180 0.0480 0.0924 0.1536 0.2340 0.3360 + 0.0084 0.0240 0.0486 0.0840 0.1320 0.1944 0.2730 + 0.0096 0.0210 0.0384 0.0630 0.0960 0.1386 0.1920 + 0.0060 0.0120 0.0210 0.0336 0.0504 0.0720 0.0990 + 0 0 0 0 0 0 0 + -0.0060 -0.0120 -0.0210 -0.0336 -0.0504 -0.0720 -0.0990 + -0.0096 -0.0210 -0.0384 -0.0630 -0.0960 -0.1386 -0.1920 + -0.0084 -0.0240 -0.0486 -0.0840 -0.1320 -0.1944 -0.2730 + 0 -0.0180 -0.0480 -0.0924 -0.1536 -0.2340 -0.3360 + 0.0180 0 -0.0330 -0.0840 -0.1560 -0.2520 -0.3750 + 0.0480 0.0330 0 -0.0546 -0.1344 -0.2430 -0.3840 + 0.0924 0.0840 0.0546 0 -0.0840 -0.2016 -0.3570 + 0.1536 0.1560 0.1344 0.0840 0 -0.1224 -0.2880 + 0.2340 0.2520 0.2430 0.2016 0.1224 0 -0.1710 + 0.3360 0.3750 0.3840 0.3570 0.2880 0.1710 0 + + + +```matlab +contour(X,Y,Z) +``` + + +![png](lecture_4_files/lecture_4_12_0.png) + + + +```matlab +mesh(X,Y,Z) +``` + + +![png](lecture_4_files/lecture_4_13_0.png) + + + +```matlab +pcolor(X,Y,Z) +``` + + +![png](lecture_4_files/lecture_4_14_0.png) + + +## Functions + +So far, everything has been executed as a script, or calling a built-in function. Now we begin building our own functions. + +Functions are saved in memory (or better yet) in a folder in your path or current directory + +Example of storing function in memory + +$f(x,y) = (xy^{3}-x^{3}y)$ + + +```matlab +f= @(x,y) (x.*y.^3-x.^3.*y) +``` + + f = + + @(x,y)(x.*y.^3-x.^3.*y) + + + +```matlab +f(0.1,-0.5) +``` + + ans = + + -0.0120 + + +Here we will save a function called `my_function` as `my_function.m` + +```matlab +function [vx,vy] = my_function(x,y,t) + % Help documentation of "my_function" + % This function computes the velocity in the x- and y-directions given + % three vectors of position in x- and y-directions as a function of time + % x = x-position + % y = y-position + % t = time + % output + % vx = velocity in x-direction + % vy = velocity in y-direction + + vx=zeros(length(t),1); + vy=zeros(length(t),1); + + vx(1:end-1) = diff(x)./diff(t); % calculate vx as delta x/delta t + vy(1:end-1) = diff(y)./diff(t); % calculate vy as delta y/delta t + + vx(end) = vx(end-1); + vy(end) = vy(end-1); + +end +``` + + +```matlab +help my_function +``` + + Help documentation of "my_function" + This function computes the velocity in the x- and y-directions given + three vectors of position in x- and y-directions as a function of time + x = x-position + y = y-position + t = time + output + vx = velocity in x-direction + vy = velocity in y-direction + + + +```matlab +t=linspace(0,10,100)'; +x=t.^3; % vx = 3*t^2 +y=t.^2/2; % vy = t +[vx,vy]=my_function(x,y,t); +``` + + +```matlab +yyaxis left +plot(t(1:10:end),vx(1:10:end),'o',t,3*t.^2) +ylabel('v_{x}') +yyaxis right +plot(t(1:10:end),vy(1:10:end),'s',t, t) +ylabel('v_{y}') +xlabel('time') +``` + + +![png](lecture_4_files/lecture_4_22_0.png) + + +Now, create a new function that calls 'my_function' called, `my_caller.m` + + +```matlab +help my_caller +``` + + Help documentation of "my_caller" + This function computes the acceleration in the x- and y-directions given + three vectors of position in x- and y-directions as a function of time + x = x-position + y = y-position + t = time + output + ax = velocity in x-direction + ay = velocity in y-direction + + + +```matlab +[ax,ay]=my_caller(x,y,t); +``` + + +```matlab +yyaxis left +plot(t(1:10:end),ax(1:10:end),'o',t,6*t) +ylabel('a_{x}') +yyaxis right +plot(t(1:10:end),ay(1:10:end),'s',t, 1*t./t) +ylabel('a_{x}') +xlabel('time') +axis([0,10,0,3]) +``` + + +![png](lecture_4_files/lecture_4_26_0.png) + + + +```matlab +diff_match_dims(x,t) +``` + + Undefined function 'diff_match_dims' for input arguments of type 'double'. +  + + +```matlab + +``` diff --git a/04_intro to m-files/lecture_4.pdf b/04_intro to m-files/lecture_4.pdf new file mode 100644 index 0000000..db18202 Binary files /dev/null and b/04_intro to m-files/lecture_4.pdf differ diff --git a/04_intro to m-files/lecture_4_files/lecture_4_12_0.png b/04_intro to m-files/lecture_4_files/lecture_4_12_0.png new file mode 100644 index 0000000..3d8bd34 Binary files /dev/null and b/04_intro to m-files/lecture_4_files/lecture_4_12_0.png differ diff --git a/04_intro to m-files/lecture_4_files/lecture_4_13_0.png b/04_intro to m-files/lecture_4_files/lecture_4_13_0.png new file mode 100644 index 0000000..fbf56f7 Binary files /dev/null and b/04_intro to m-files/lecture_4_files/lecture_4_13_0.png differ diff --git a/04_intro to m-files/lecture_4_files/lecture_4_14_0.png b/04_intro to m-files/lecture_4_files/lecture_4_14_0.png new file mode 100644 index 0000000..b982415 Binary files /dev/null and b/04_intro to m-files/lecture_4_files/lecture_4_14_0.png differ diff --git a/04_intro to m-files/lecture_4_files/lecture_4_22_0.png b/04_intro to m-files/lecture_4_files/lecture_4_22_0.png new file mode 100644 index 0000000..ed48529 Binary files /dev/null and b/04_intro to m-files/lecture_4_files/lecture_4_22_0.png differ diff --git a/04_intro to m-files/lecture_4_files/lecture_4_26_0.png b/04_intro to m-files/lecture_4_files/lecture_4_26_0.png new file mode 100644 index 0000000..df1b771 Binary files /dev/null and b/04_intro to m-files/lecture_4_files/lecture_4_26_0.png differ diff --git a/04_intro to m-files/lecture_4_files/lecture_4_7_0.png b/04_intro to m-files/lecture_4_files/lecture_4_7_0.png new file mode 100644 index 0000000..1584226 Binary files /dev/null and b/04_intro to m-files/lecture_4_files/lecture_4_7_0.png differ diff --git a/04_intro to m-files/my_acceleration.m b/04_intro to m-files/my_acceleration.m new file mode 100644 index 0000000..7132f5b --- /dev/null +++ b/04_intro to m-files/my_acceleration.m @@ -0,0 +1,23 @@ +function [ax,ay]=my_acceleration(x,y,t) + % Help documentation of "my_acceleration" + % This function computes the acceleration in the x- and y-directions given + % three vectors of position in x- and y-directions as a function of time + % x = x-position + % y = y-position + % t = time + % output + % ax = acceleration in x-direction + % ay = acceleration in y-direction + + function v=diff_match_dims(x,t) + v=zeros(length(t),1); + v(1:end-1)=diff(x)./diff(t); + v(end)=v(end-1); + end + + [vx,vy]=my_velocity(x,y,t); + + ax = diff_match_dims(vx,t); + ay = diff_match_dims(vy,t); + +end diff --git a/04_intro to m-files/my_velocity.m b/04_intro to m-files/my_velocity.m new file mode 100644 index 0000000..7a1fdef --- /dev/null +++ b/04_intro to m-files/my_velocity.m @@ -0,0 +1,21 @@ +function [vx,vy] = my_velocity(x,y,t) + % Help documentation of "my_velocity" + % This function computes the velocity in the x- and y-directions given + % three vectors of position in x- and y-directions as a function of time + % x = x-position + % y = y-position + % t = time + % output + % vx = velocity in x-direction + % vy = velocity in y-direction + + vx=zeros(length(t),1); + vy=zeros(length(t),1); + + vx(1:end-1) = diff(x)./diff(t); % calculate vx as delta x/delta t + vy(1:end-1) = diff(y)./diff(t); % calculate vy as delta y/delta t + + vx(end) = vx(end-1); + vy(end) = vy(end-1); + +end diff --git a/04_intro to m-files/myscript.m b/04_intro to m-files/myscript.m new file mode 100644 index 0000000..4488e0f --- /dev/null +++ b/04_intro to m-files/myscript.m @@ -0,0 +1,11 @@ +f=100; + +for i=1:10 + g=i^2; + if f==g + fprintf('we made it\n') + else + fprintf('not yet\n') + end +end + diff --git a/04_intro to m-files/octave-workspace b/04_intro to m-files/octave-workspace new file mode 100644 index 0000000..b841141 Binary files /dev/null and b/04_intro to m-files/octave-workspace differ diff --git a/05_consistent coding/.ipynb_checkpoints/05_consistent-coding and functions-checkpoint.ipynb b/05_consistent coding/.ipynb_checkpoints/05_consistent-coding and functions-checkpoint.ipynb new file mode 100644 index 0000000..08483c4 --- /dev/null +++ b/05_consistent coding/.ipynb_checkpoints/05_consistent-coding and functions-checkpoint.ipynb @@ -0,0 +1,1005 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Good coding habits\n", + "## naming folders and files" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "# [Stanford file naming best practices](https://library.stanford.edu/research/data-management-services/data-best-practices/best-practices-file-naming)\n", + "\n", + "1. Include information to distinguish file name e.g. project name, objective of function, name/initials, type of data, conditions, version of file, \n", + "2. if using dates, use YYYYMMDD, so the computer organizes by year, then month, then day\n", + "3. avoid special characters e.g. !, #, \\$, ...\n", + "4. avoid using spaces if not necessary, some programs consider a space as a break in code use dashes `-` or underscores `_` or CamelCase" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Commenting your code\n", + "\n", + "Its important to comment your code \n", + "\n", + "what are variable's units,\n", + "\n", + "what the is the function supposed to do, \n", + "\n", + "etc. \n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "function i=code(j)\n", + " % Example of bad variable names and bad function name\n", + " for w=1:j\n", + " i(w)=w;\n", + " end\n", + "end" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'code' is a command-line function\n", + "\n", + " Example of bad variable names and bad function name\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help code" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Choose variable names that describe the variable" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "function count_vector=counting_function(max_value)\n", + " % Good variable names and better help documentation\n", + " % \n", + " % counting function creates a vector from 1 to max_value where each \n", + " % index, i, is stored in each vector spot\n", + " for i=1:max_value\n", + " count_vector(i)=i; % set each element in count_vector to i\n", + " end\n", + "end " + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'counting_function' is a command-line function\n", + "\n", + " Good variable names and better help documentation\n", + " \n", + " counting function creates a vector from 1 to max_value where each \n", + " index, i, is stored in each vector spot\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help counting_function" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Putting it all together" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "1. Clone your \"ideal-gas\" repository to your computer\n", + "2. open Matlab (cli, jupyter or gui)\n", + "3. Change working directory to homework_1 *e.g.* \n", + " Windows:`cd('C:\\Users\\rcc02007\\Documents\\Github\\ideal-gas')`, \n", + " Mac: `cd('/Users/rcc02007/Documents/Github/ideal-gas')`\n", + "4. You have already created your first script `setdefaults.m` (if not see lecture_4)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "5\\. Run `>> setdefaults.m`\n", + "\n", + "6\\. Create a new m-file called nitrogen_pressure.m\n", + "\n", + "7\\. Create a function based upon the ideal gas law for nitrogen, Pv=RT\n", + " 1. R=0.2968 kJ/(kg-K)\n", + " 2. inputs to function are v (specific volume m^3/kg), and T, temperature (K)\n", + " 3. output is P, pressure (kPa)\n", + "\n", + "8\\. Once the function works, commit the change to the repository (add a message, like 'added file nitrogen_pressure.m'\n", + "\n", + "9\\. After file is 'committed', 'push' the changes to your github account" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "for the command-line git user, this is steps 8 and 9:\n", + "1. `$ git add *`\n", + "2. `$ git commit -m 'added file nitrogen_pressure.m'`\n", + "3. `$ git push -u origin master\n", + " Username for 'https://github.uconn.edu':rcc02007 \n", + " Password for 'https://rcc02007@github.uconn.edu': `\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "Now, use this function to plot the range of pressures that a pressure vessel would experience if it is 1000 gallons (3.79 m^3) with 10-20 kg of Nitrogen and temperatures range from -10 to 35 degrees C. \n", + "\n", + "```matlab\n", + "v=0.379/linspace(10,20,10);\n", + "T=273.15+linspace(-10,35,10);\n", + "[v_grid,T_grid]=meshgrid(v,T);\n", + "P = nitrogen_pressure(v,T);\n", + "pcolor(v_grid,T_grid,P)\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.15\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.25\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.35\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t15\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t25\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t35\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\tTemperature (C)\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\tgnuplot_plot_1b\n", + "\n", + "\n", + "\n", + ";\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t150\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t200\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t250\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t300\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t350\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "setdefaults;\n", + "v=3.79./linspace(10,20,10);\n", + "T=273.15+linspace(-10,35,10);\n", + "[v_grid,T_grid]=meshgrid(v,T);\n", + "P = nitrogen_pressure(v_grid,T_grid);\n", + "pcolor(v_grid,T_grid-273.15,P-100)\n", + "xlabel('specific volume (m^3/kg)')\n", + "ylabel('Temperature (C)')\n", + "zlabel('Pressure (kPa)')\n", + "\n", + "%colormap winter\n", + "%colormap summer\n", + "%colormap jet\n", + "colorbar()" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/05_consistent coding/05_consistent-coding and functions.ipynb b/05_consistent coding/05_consistent-coding and functions.ipynb new file mode 100644 index 0000000..08483c4 --- /dev/null +++ b/05_consistent coding/05_consistent-coding and functions.ipynb @@ -0,0 +1,1005 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "skip" + } + }, + "outputs": [], + "source": [ + "%plot --format svg" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "# Good coding habits\n", + "## naming folders and files" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "# [Stanford file naming best practices](https://library.stanford.edu/research/data-management-services/data-best-practices/best-practices-file-naming)\n", + "\n", + "1. Include information to distinguish file name e.g. project name, objective of function, name/initials, type of data, conditions, version of file, \n", + "2. if using dates, use YYYYMMDD, so the computer organizes by year, then month, then day\n", + "3. avoid special characters e.g. !, #, \\$, ...\n", + "4. avoid using spaces if not necessary, some programs consider a space as a break in code use dashes `-` or underscores `_` or CamelCase" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Commenting your code\n", + "\n", + "Its important to comment your code \n", + "\n", + "what are variable's units,\n", + "\n", + "what the is the function supposed to do, \n", + "\n", + "etc. \n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "function i=code(j)\n", + " % Example of bad variable names and bad function name\n", + " for w=1:j\n", + " i(w)=w;\n", + " end\n", + "end" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'code' is a command-line function\n", + "\n", + " Example of bad variable names and bad function name\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help code" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Choose variable names that describe the variable" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ + "function count_vector=counting_function(max_value)\n", + " % Good variable names and better help documentation\n", + " % \n", + " % counting function creates a vector from 1 to max_value where each \n", + " % index, i, is stored in each vector spot\n", + " for i=1:max_value\n", + " count_vector(i)=i; % set each element in count_vector to i\n", + " end\n", + "end " + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'counting_function' is a command-line function\n", + "\n", + " Good variable names and better help documentation\n", + " \n", + " counting function creates a vector from 1 to max_value where each \n", + " index, i, is stored in each vector spot\n", + "\n", + "\n", + "Additional help for built-in functions and operators is\n", + "available in the online version of the manual. Use the command\n", + "'doc ' to search the manual index.\n", + "\n", + "Help and information about Octave is also available on the WWW\n", + "at http://www.octave.org and via the help@octave.org\n", + "mailing list.\n" + ] + } + ], + "source": [ + "help counting_function" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Putting it all together" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "1. Clone your \"ideal-gas\" repository to your computer\n", + "2. open Matlab (cli, jupyter or gui)\n", + "3. Change working directory to homework_1 *e.g.* \n", + " Windows:`cd('C:\\Users\\rcc02007\\Documents\\Github\\ideal-gas')`, \n", + " Mac: `cd('/Users/rcc02007/Documents/Github/ideal-gas')`\n", + "4. You have already created your first script `setdefaults.m` (if not see lecture_4)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "5\\. Run `>> setdefaults.m`\n", + "\n", + "6\\. Create a new m-file called nitrogen_pressure.m\n", + "\n", + "7\\. Create a function based upon the ideal gas law for nitrogen, Pv=RT\n", + " 1. R=0.2968 kJ/(kg-K)\n", + " 2. inputs to function are v (specific volume m^3/kg), and T, temperature (K)\n", + " 3. output is P, pressure (kPa)\n", + "\n", + "8\\. Once the function works, commit the change to the repository (add a message, like 'added file nitrogen_pressure.m'\n", + "\n", + "9\\. After file is 'committed', 'push' the changes to your github account" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "for the command-line git user, this is steps 8 and 9:\n", + "1. `$ git add *`\n", + "2. `$ git commit -m 'added file nitrogen_pressure.m'`\n", + "3. `$ git push -u origin master\n", + " Username for 'https://github.uconn.edu':rcc02007 \n", + " Password for 'https://rcc02007@github.uconn.edu': `\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true, + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "Now, use this function to plot the range of pressures that a pressure vessel would experience if it is 1000 gallons (3.79 m^3) with 10-20 kg of Nitrogen and temperatures range from -10 to 35 degrees C. \n", + "\n", + "```matlab\n", + "v=0.379/linspace(10,20,10);\n", + "T=273.15+linspace(-10,35,10);\n", + "[v_grid,T_grid]=meshgrid(v,T);\n", + "P = nitrogen_pressure(v,T);\n", + "pcolor(v_grid,T_grid,P)\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "slideshow": { + "slide_type": "subslide" + } + }, + "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", + "\n", + "\n", + "\t\n", + "\tgnuplot_plot_1a\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.15\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.2\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.25\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.3\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.35\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0.4\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t-5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t0\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t5\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t10\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t15\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t20\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t25\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t30\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\t\t\n", + "\t\t35\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\tTemperature (C)\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\t\t\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\tgnuplot_plot_1b\n", + "\n", + "\n", + "\n", + ";\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "\t\t\n", + "\t\t150\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t200\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t250\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t300\n", + "\t\n", + "\n", + "\n", + "\t\t\n", + "\t\t350\n", + "\t\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "setdefaults;\n", + "v=3.79./linspace(10,20,10);\n", + "T=273.15+linspace(-10,35,10);\n", + "[v_grid,T_grid]=meshgrid(v,T);\n", + "P = nitrogen_pressure(v_grid,T_grid);\n", + "pcolor(v_grid,T_grid-273.15,P-100)\n", + "xlabel('specific volume (m^3/kg)')\n", + "ylabel('Temperature (C)')\n", + "zlabel('Pressure (kPa)')\n", + "\n", + "%colormap winter\n", + "%colormap summer\n", + "%colormap jet\n", + "colorbar()" + ] + } + ], + "metadata": { + "celltoolbar": "Slideshow", + "kernelspec": { + "display_name": "Octave", + "language": "octave", + "name": "octave" + }, + "language_info": { + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "octave", + "version": "0.19.14" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/05_consistent coding/gp_image_01.png b/05_consistent coding/gp_image_01.png new file mode 100644 index 0000000..ef291b5 Binary files /dev/null and b/05_consistent coding/gp_image_01.png differ diff --git a/05_consistent coding/lecture_05.md b/05_consistent coding/lecture_05.md new file mode 100644 index 0000000..11c2894 --- /dev/null +++ b/05_consistent coding/lecture_05.md @@ -0,0 +1,325 @@ + + +```octave +%plot --format svg +``` + +## Questions from last class + +When you execute the given function + +my_function.m: + +```matlab +function [x,y] = my_function(max_time) + N=100; + t=linspace(0,max_time,N); + x=t.^2; + y=2*t; +end +``` + +as + +```>> [x,y] = my_function(20);``` + +What variables are saved to your workspace? + +![responses](q1.png) + +How do you write a help description for a function? + +![responses to question 2](q2.png) + + +How to keep our forked ME3255S page up to date with the original +pretty tired this morning + +How do I use the Github Desktop? + +whats your favorite football team? + +Will UConn's github get updated to the newest version of github? +As u said in class trail and error is the best way of learning. + +I believe the % is the same as matlab where it de-links your code into text + +Does the @ symbol designate a pointer? + +Given the change of air pressure as altitude increases, how fast would a frisbee have to travel (and spin) to hit an airplane? + +What is a gui? + + +could you go over a nested for loop example + +Can't seem to get this function to produce any graph and am not sure why + +When are these google forms due? + +how do I create a new function using Github on my desktop? + +Can you explain the first question more in class? + +What is the meaning of life? + +Should I just know how or what these topics are or will we learn them in the future? + + + +```octave +f =@(x) x.^2 + + +``` + + f = + + @(x)x.^2 + + + +```octave +f([1:2:10]) +f(4) +``` + + ans = + + 1 9 25 49 81 + + + ans = + + 16 + + + +```octave +% nested for loop example +for i = [1:6] + for j = [1:3] + fprintf('i=%i and j=%i\n',i,j) + end +end + +``` + + i=1 and j=1 + i=1 and j=2 + i=1 and j=3 + i=2 and j=1 + i=2 and j=2 + i=2 and j=3 + i=3 and j=1 + i=3 and j=2 + i=3 and j=3 + i=4 and j=1 + i=4 and j=2 + i=4 and j=3 + i=5 and j=1 + i=5 and j=2 + i=5 and j=3 + i=6 and j=1 + i=6 and j=2 + i=6 and j=3 + + +# From last class + + +```octave +help my_function +``` + + Help documentation of "my_function" + This function computes the velocity in the x- and y-directions given + three vectors of position in x- and y-directions as a function of time + x = x-position + y = y-position + t = time + output + vx = velocity in x-direction + vy = velocity in y-direction + + + +```octave +help my_caller +``` + + Help documentation of "my_caller" + This function computes the acceleration in the x- and y-directions given + three vectors of position in x- and y-directions as a function of time + x = x-position + y = y-position + t = time + output + ax = acceleration in x-direction + ay = acceleration in y-direction + + + +```octave +t=linspace(0,10,100)'; +x=t.^3; % vx = 3*t^2 +y=t.^2/2; % vy = t +[vx,vy]=my_function(x,y,t); +[ax,ay]=my_caller(x,y,t); +yyaxis left +plot(t(1:10:end),ax(1:10:end),'o',t,6*t) +ylabel('a_{x}') +yyaxis right +plot(t(1:10:end),ay(1:10:end),'s',t, 1*t./t) +ylabel('a_{y}') +xlabel('time') +axis([0,10,0,3]) +``` + + +![png](lecture_05_files/lecture_05_11_0.png) + + + +```octave +diff_match_dims(x,t) +``` + + Undefined function 'diff_match_dims' for input arguments of type 'double'. +  + +# Good coding habits +## naming folders and files + +[Stanford file naming best practices](https://library.stanford.edu/research/data-management-services/data-best-practices/best-practices-file-naming) + +1. Include information to distinguish file name e.g. project name, objective of function, name/initials, type of data, conditions, version of file, +2. if using dates, use YYYYMMDD, so the computer organizes by year, then month, then day +3. avoid special characters e.g. !, #, \$, ... +4. avoid using spaces if not necessary, some programs consider a space as a break in code use dashes `-` or underscores `_` or CamelCase + +## Commenting your code + +Its important to comment your code to mention what a variable's units are, what the function is supposed to do, etc. + + + +```octave +function i=code(j) + % Example of bad variable names and bad function name + for w=1:j + i(w)=w; + end +end +``` + + Error: Function definitions are not permitted in this context. +  + + +```octave +help code +``` + + code not found. + + Use the Help browser search field to search the documentation, or + type "help help" for help command options, such as help for methods. + + +## Choose variable names that describe the variable + + +```octave +function count_vector=counting_function(max_value) + % Good variable names and better help documentation + % + % counting function creates a vector from 1 to max_value where each index, i, is + % stored in each vector spot + for i=1:max_value + count_vector(i)=i; % set each element in count_vector to i + end +end +``` + + +```octave +help counting_function +``` + + 'counting_function' is a command-line function + + Good variable names and better help documentation + + counting function creates a vector from 1 to max_value where each index, i, is + stored in each vector spot + + + Additional help for built-in functions and operators is + available in the online version of the manual. Use the command + 'doc ' to search the manual index. + + Help and information about Octave is also available on the WWW + at http://www.octave.org and via the help@octave.org + mailing list. + + +## Putting it all together + +1. Clone your homework_1 to your computer +2. open Matlab (cli, jupyter or gui) +3. Change working directory to homework_1 *e.g.* Windows:`cd('C:\Users\rcc02007\Documents\Github\homework_1')`, Mac: `cd('/Users/rcc02007/Documents/Github/homework_1')` +4. You have already created your first script `setdefaults.m` (if not see lecture_4) +5. Run `>> setdefaults.m` +6. Create a new m-file called nitrogen_pressure.m +7. Create a function based upon the ideal gas law for nitrogen, Pv=RT + 1. R=0.2968 kJ/(kg-K) + 2. inputs to function are v (specific volume m^3/kg), and T, temperature (K) + 3. output is P, pressure (kPa) +8. Once the function works, commit the change to the repository (add a message, like 'added file nitrogen_pressure.m' +9. After file is 'committed', 'push' the changes to your github account + +for the command-line git user, this is steps 8 and 9: +1. `$ git add *` +2. `$ git commit -m 'added file nitrogen_pressure.m'` +3. `$ git push -u origin master + Username for 'https://github.uconn.edu':rcc02007 + Password for 'https://rcc02007@github.uconn.edu': ` + + +Now, use this function to plot the range of pressures that a pressure vessel would experience if it is 1000 gallons (3.79 m^3) with 10-20 kg of Nitrogen and temperatures range from -10 to 35 degrees C. + +```matlab +v=0.379/linspace(50,20,10); +T=273.15+linspace(-10,35,10); +[v_grid,T_grid]=meshgrid(v,T); +P = nitrogen_pressure(v,T); +pcolor(v_grid,T_grid,P) +``` + + +```octave +setdefaults; +v=3.79./linspace(10,20,10); +T=273.15+linspace(-10,35,10); +[v_grid,T_grid]=meshgrid(v,T); +P = nitrogen_pressure(v_grid,T_grid); +pcolor(v_grid,T_grid-273.15,P-100) +xlabel('specific volume (m^3/kg)') +ylabel('Temperature (C)') +%zlabel('Pressure (kPa)') + +%colormap winter +%colormap summer +%colormap jet +colorbar() +``` + + +![png](lecture_05_files/lecture_05_25_0.png) + + + +```octave + +``` diff --git a/05_consistent coding/lecture_05.pdf b/05_consistent coding/lecture_05.pdf new file mode 100644 index 0000000..589a854 Binary files /dev/null and b/05_consistent coding/lecture_05.pdf differ diff --git a/05_consistent coding/lecture_05_files/lecture_05_11_0.png b/05_consistent coding/lecture_05_files/lecture_05_11_0.png new file mode 100644 index 0000000..b5a8ed1 Binary files /dev/null and b/05_consistent coding/lecture_05_files/lecture_05_11_0.png differ diff --git a/05_consistent coding/lecture_05_files/lecture_05_25_0.png b/05_consistent coding/lecture_05_files/lecture_05_25_0.png new file mode 100644 index 0000000..70aa9ce Binary files /dev/null and b/05_consistent coding/lecture_05_files/lecture_05_25_0.png differ diff --git a/05_consistent coding/my_caller.m b/05_consistent coding/my_caller.m new file mode 100644 index 0000000..f0cd536 --- /dev/null +++ b/05_consistent coding/my_caller.m @@ -0,0 +1,23 @@ +function [ax,ay]=my_caller(x,y,t) + % Help documentation of "my_caller" + % This function computes the acceleration in the x- and y-directions given + % three vectors of position in x- and y-directions as a function of time + % x = x-position + % y = y-position + % t = time + % output + % ax = acceleration in x-direction + % ay = acceleration in y-direction + + function v=diff_match_dims(x,t) + v=zeros(length(t),1); + v(1:end-1)=diff(x)./diff(t); + v(end)=v(end-1); + end + + [vx,vy]=my_function(x,y,t); + + ax = diff_match_dims(vx,t); + ay = diff_match_dims(vy,t); + +end diff --git a/05_consistent coding/my_function.m b/05_consistent coding/my_function.m new file mode 100644 index 0000000..5953061 --- /dev/null +++ b/05_consistent coding/my_function.m @@ -0,0 +1,21 @@ +function [vx,vy] = my_function(x,y,t) + % Help documentation of "my_function" + % This function computes the velocity in the x- and y-directions given + % three vectors of position in x- and y-directions as a function of time + % x = x-position + % y = y-position + % t = time + % output + % vx = velocity in x-direction + % vy = velocity in y-direction + + vx=zeros(length(t),1); + vy=zeros(length(t),1); + + vx(1:end-1) = diff(x)./diff(t); % calculate vx as delta x/delta t + vy(1:end-1) = diff(y)./diff(t); % calculate vy as delta y/delta t + + vx(end) = vx(end-1); + vy(end) = vy(end-1); + +end diff --git a/05_consistent coding/nitrogen_pressure.m b/05_consistent coding/nitrogen_pressure.m new file mode 100644 index 0000000..a76abf3 --- /dev/null +++ b/05_consistent coding/nitrogen_pressure.m @@ -0,0 +1,10 @@ +function P=nitrogen_pressure(v,T) + % function to calculate Pressure of Nitrogen using ideal gas law given the specific + % volume, v (m^3/kg), and temperature, T (K) + % Pv = RT + % R=0.2968; % kJ/kg-K + % P [in kPa] = nitrogen_pressure(v [in m^3/kg], T[in K]) + R=0.2968; % kJ/kg-K + P=R*T./v; +end + diff --git a/05_consistent coding/octave-workspace b/05_consistent coding/octave-workspace new file mode 100644 index 0000000..22452b7 Binary files /dev/null and b/05_consistent coding/octave-workspace differ diff --git a/05_consistent coding/q1.png b/05_consistent coding/q1.png new file mode 100644 index 0000000..bdc10e5 Binary files /dev/null and b/05_consistent coding/q1.png differ diff --git a/05_consistent coding/q2.png b/05_consistent coding/q2.png new file mode 100644 index 0000000..db02f0c Binary files /dev/null and b/05_consistent coding/q2.png differ diff --git a/05_consistent coding/setdefaults.m b/05_consistent coding/setdefaults.m new file mode 100644 index 0000000..8c3c5c8 --- /dev/null +++ b/05_consistent coding/setdefaults.m @@ -0,0 +1,3 @@ +set(0, 'defaultAxesFontSize', 16) +set(0,'defaultTextFontSize',14) +set(0,'defaultLineLineWidth',3) diff --git a/README.html b/README.html new file mode 100644 index 0000000..70d844e --- /dev/null +++ b/README.html @@ -0,0 +1,285 @@ + + + + + + + + + + +

Computational Mechanics

+

ME 3255 Spring 2017

+

Public (ipynb rendering) https://github.com/cooperrc/ME3255F2017

+

Github page: https://github.uconn.edu/rcc02007/ME3255F2017.git

+

Course Description

+

This course introduces students to scientific programming utilizing Matlab/Octave. Numerical methods, best programming practices and version control are introduced. These methods will be applied to a number of physics-based problems.

+

Course Expectations

+

Students are expected to create numerical approximations for linear and nonlinear problems, understand approximations due to floating point operations and numerical approaches and solve differential equations using numerical differentiation and integration. Students are also expected to learn basics of git version control, matlab/octave functions and programming best practices.

+

Lectures:

+
    +
  • 001 MoWeFr 10:10-11:00 am, Philip E. Austin bdg (Aust) rm 434

  • +
  • 002 TuTh 12:30-1:45 PM, Charles Lewis Beach Hall (BCH) rm 317

  • +
+

Instructor: Prof. Ryan C. Cooper (ryan.c.cooper@uconn.edu)

+

Office hours: TuTh 1:00-3:00pm in Engineering II room 314

+

Teaching Assistants:

+
    +
  • Graduate: Zhiqiang Shen
  • +
  • Office hours: TBD in Engineering II room 315
  • +
+

Course Information

+

Prerequisite: CE 3110, MATH 2410Q

+

Textbook: Chapra, Steven, Applied Numerical Methods with MATLAB for Engineers and Scientists 3rd edition.

+

Tools used: Matlab, Octave , Github.

+

Recommended tools: Github Desktop, git, Atom (text editor), Vim (text editor), Jupyter notebook (with matlab or octave kernel)

+

Grading

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ItemPercentRequirement
Homework40 %Turn in homeworks by assigned due date
Midterm Exam20 %One midterm exam
Final Project30 %A final project that will consist of code and documentation
Participation10 %Online video-quizzes and Google Forms
+

Note on Homework and online forms

+

The Homeworks are graded based upon effort, correctness, and completeness. The forms and video-quizzes are graded based upon completion, if they are completed you get credit. It is your responsibility to make sure your answers are correct. Use the homeworks, videos, and forms as a study guide for the midterm and final project. In general, I will not post homework solutions, but I will review solutions in class.

+

Academic Integrity:

+
    +
  • The instructors of this class have a zero-tolerance policy for academic misconduct, that is copying others’ work either in the lab, field, or on an exam. Any student work that is found to be in violation of the university policy regarding academic misconduct will be assigned a grade of zero at a minimum.
  • +
  • Read and understand The UConn Student Code of Conduct. Students will follow all University regulations concerning the final exam.
  • +
+

Course Schedule (which is subject to change based upon feedback and pace of course)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WeekDateChapterTopic
18/281Introduction to Numerical Methods and Github
4Intro con’d and Roundoff/Truncation Errors
29/42Intro to Matlab/Octave
3Intro to m-files
39/11Consistent Coding habits
Using Github and writing functions
49/185Root Finding
6Root Finding con’d
59/257Optimization
8Linear Algebra
610/239Linear systems: Gauss elimination
10Linear Systems: LU factorization
710/911Linear Systems: Error analysis
12Eigenvalues
810/161-10Midterm Review
1-10Midterm
910/2312Linear Systems: Iterative methods
14Curve fitting: linear regression
1010/3015Curve fitting: least squares and nonlinear regression
17Polynomial interpolation
1111/618Splines and Piecewise Interpolation
19Numerical Integration Formulas
1211/1320Numerical Integration of Functions
21Numerical Differentiation
1411/20Thanksgiving break
Thanksgiving break
1511/2822ODEs: Initial value problem
23ODEs: Adaptive methods and stiff systems
1612/424ODEs: Boundary value problems
Wrap up and final project discussions
1712/11FinalsFinals Best of Lucks!
+ + diff --git a/README.md b/README.md index 5c24dbb..8a47602 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Computational Mechanics ## ME 3255 Spring 2017 -### Public (ipynb rendering)[https://github.com/cooperrc/ME3255F2017] -### Github page: [https://github.uconn.edu/rcc02007/ME3255F2017.git] +### Public (ipynb rendering) [https://github.com/cooperrc/ME3255F2017](https://github.com/cooperrc/ME3255F2017) +### Github page: [https://github.uconn.edu/rcc02007/ME3255F2017.git](https://github.uconn.edu/rcc02007/ME3255F2017.git) ### Course Description This course introduces students to scientific programming utilizing Matlab/Octave. @@ -17,6 +17,7 @@ matlab/octave functions and programming best practices. **Lectures**: + - 001 MoWeFr 10:10-11:00 am, Philip E. Austin bdg (Aust) rm 434 - 002 TuTh 12:30-1:45 PM, Charles Lewis Beach Hall (BCH) rm 317 @@ -53,7 +54,7 @@ Jupyter notebook (with matlab or octave kernel) The Homeworks are graded based upon effort, correctness, and completeness. The forms and video-quizzes are graded based upon completion, if they are completed you get credit. It -is *your* responsibility to make sure your answers are correct. Use the homeworks and +is *your* responsibility to make sure your answers are correct. Use the homeworks, videos, and forms as a study guide for the midterm and final project. In general, I will not post homework solutions, but I will review solutions in class.