{"nbformat_minor": 0, "metadata": {"signature": "sha256:887371762f8d1f21e2af1c8864c8bf87c103070e4a756cb0d5825bf10f269951", "name": ""}, "nbformat": 3, "worksheets": [{"metadata": {}, "cells": [{"source": ["# Taking Derivatives with Vandermonde Matrices"], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [], "input": ["import numpy as np\n", "import numpy.linalg as la\n", "import matplotlib.pyplot as pt"], "metadata": {}, "language": "python", "prompt_number": 1, "cell_type": "code"}, {"source": ["Here are a few functions:"], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [], "input": ["if 1:\n", " def f(x):\n", " return np.sin(5*x)\n", " def df(x):\n", " return 5*np.cos(5*x)\n", "elif 0:\n", " gamma = 0.15\n", " def f(x):\n", " return np.sin(1/(gamma+x))\n", " def df(x):\n", " return -np.cos(1/(gamma+x))/(gamma+x)**2\n", "else:\n", " def f(x):\n", " return np.abs(x-0.5)\n", " def df(x):\n", " # Well...\n", " return -1 + 2*(x<=0.5).astype(np.float)"], "metadata": {}, "language": "python", "prompt_number": 205, "cell_type": "code"}, {"collapsed": false, "outputs": [{"text": ["[]"], "metadata": {}, "prompt_number": 206, "output_type": "pyout"}, {"png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEACAYAAAC08h1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH1BJREFUeJzt3Xu8lWPex/HPbyo8iE6DVI6FdJrKoYNqU0ZCkhlJQyWk\n5DChSKYYBhlD6VE0DtFMiaGUGkotkkqRDqqhoUc5pANlFNPhev64dmqavdtr77XXfd1rre/79dqv\n9tr7bq2vW/u3r3UdzTmHiIjkjp+FDiAiItFS4RcRyTEq/CIiOUaFX0Qkx6jwi4jkGBV+EZEck3Lh\nN7OnzGytmS3ZxzXDzOxjM1tkZg1TfU0RESm50mjxPw20LeybZtYOqOmcqwVcA4wohdcUEZESSrnw\nO+dmAd/s45L2wOj8a+cBFczs8FRfV0RESiaKPv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z3wIrAuynARS+ZeXAb8zTm3BsA5tz7ijFFJ5l58CRyS\n//khwAbnxxWzinNuFvDNPi4pdt2MsvAXtJirWhLXZGPBS+Ze7KkHkK3nBBV5L8ysGv6HfkT+l7J1\nYCqZfxe1gEpmNtPMFpjZ5ZGli1Yy92IUUMfMvgAWATdGlC1uil03071yd0/J/rDuPa0zG3/Ik/5v\nMrMzgSuB5umLE1Qy9+IR4DbnnDMzo/Dpw5kumXtRDmgEtAYOBOaY2Vzn3MdpTRa9ZO7FAOAD51ye\nmR0PTDOzBs6579KcLY6KVTejLPyfAzX2eFwD/5tpX9dUz/9atknmXpA/oDsKaOuc29dbvUyWzL1o\nDIzzNZ8qwLlmts0590o0ESOTzL1YDax3zm0FtprZW0ADINsKfzL3ohlwL4Bz7p9m9ilwIn79UC4p\ndt2Msqvnp8VcZrYffjHX3j+4rwBXwE+rfr91zq2NMGNUirwXZnYU8BLwG+dcDHcDLzVF3gvn3HHO\nuWOdc8fi+/l7ZWHRh+R+RiYCZ5hZGTM7ED+YtyzinFFI5l6sANoA5Pdpnwhk6dEp+1TsuhlZi985\nt93Mdi3mKgM86ZxbbmY987//uHNuipm1M7OVwPdA96jyRSmZewH8DqgIjMhv6W5zzqWwH188JXkv\nckKSPyMrzOzvwGJgJzDKOZd1hT/Jfxd/AJ42s0X4Rmw/59zGYKHTxMzGAq2AKvmLZgfhu/xKXDe1\ngEtEJMfo6EURkRyjwi8ikmNU+EVEcowKv4hIjlHhFxHJMSr8IiI5RoVfRCTHqPCLiOSY/wdy58uN\nmfOjdAAAAABJRU5ErkJggg==\n", "text": [""], "metadata": {}, "output_type": "display_data"}], "input": ["x_01 = np.linspace(0, 1, 1000)\n", "pt.plot(x_01, f(x_01))"], "metadata": {}, "language": "python", "prompt_number": 206, "cell_type": "code"}, {"collapsed": false, "outputs": [{"text": ["array([ 0. , 0.25, 0.5 , 0.75, 1. ])"], "metadata": {}, "prompt_number": 246, "output_type": "pyout"}], "input": ["degree = 4\n", "h = 1\n", "\n", "nodes = 0.5 + np.linspace(-h/2, h/2, degree+1)\n", "nodes"], "metadata": {}, "language": "python", "prompt_number": 246, "cell_type": "code"}, {"source": ["Build the gen. Vandermonde matrix and find the coefficients:"], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [], "input": ["V = np.array([\n", " nodes**i\n", " for i in range(degree+1)\n", "]).T"], "metadata": {}, "language": "python", "prompt_number": 247, "cell_type": "code"}, {"collapsed": false, "outputs": [], "input": ["coeffs = la.solve(V, f(nodes))"], "metadata": {}, "language": "python", "prompt_number": 256, "cell_type": "code"}, {"source": ["Evaluate the interpolant:"], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [], "input": ["x_0h = 0.5+np.linspace(-h/2, h/2, 1000)"], "metadata": {}, "language": "python", "prompt_number": 249, "cell_type": "code"}, {"collapsed": false, "outputs": [], "input": ["interp_0h = 0*x_0h\n", "for i in range(degree+1):\n", " interp_0h += coeffs[i] * x_0h**i"], "metadata": {}, "language": "python", "prompt_number": 250, "cell_type": "code"}, {"collapsed": false, "outputs": [{"text": [""], "metadata": {}, "prompt_number": 251, "output_type": "pyout"}, {"png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEACAYAAAC08h1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VFX6x/HPkxAChBIgFCFAgKWJBVGaIAQQSEKR3gVc\nUGSluLs/FUElwLKry2IBXWURBAUBBVQklCASQYUgSFEhUhSE0EuEIOnn98eNSEnCJJPMzcw879dr\nXmRmbuZ+c5l5cnLuueeIMQallFLew8fuAEoppVxLC79SSnkZLfxKKeVltPArpZSX0cKvlFJeRgu/\nUkp5GacLv4jME5FTIvJdDtvMFJEDIrJbRO5xdp9KKaXyLj9a/O8AYdk9KSIRwJ+MMXWAx4A382Gf\nSiml8sjpwm+M2QxcyGGTbsCCzG1jgUARqeTsfpVSSuWNK/r4qwJHr7l/DAh2wX6VUkpl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jsWrwHhjjBERwXOnAHHkWPgBjYH2QAlgi4hsNcYcKNBkrufIsZgA7DLG\nhIpIbawLRO82xlwq4GyFUa7qpisLfzxQ7Zr71bB+M+W0TXDmY57GkWNB5gndOUCYMSanP/XcmSPH\n4l5giVXzCQLCRSTVGLPSNRFdxpFjcRQ4a4y5AlwRkU3A3YCnFX5HjsX9wDQAY8whEfkZqAdsd0nC\nwiPXddOVXT3bgToiEiIiRYF+wI0f3JXAEAARaQ4kGGNOuTCjq9zyWIhIdWAFMNgYc9CGjK5yy2Nh\njKlljKlpjKmJ1c8/ygOLPjj2GfkEaCUivpkXSDYD9ro4pys4cizigAcBMvu06wE/uTRl4ZDruumy\nFr8xJk1ERgPrsM7YzzXG7BORkZnPzzbGrBaRCBE5CFwGHnFVPldy5FgALwBlgTczW7qpxgOntXbw\nWHgFBz8jcSKyFtgDZABzjDEeV/gdfF/8E3hHRHZjNWKfNsacty10ARGRxUAbICjzotlJWF1+ea6b\negGXUkp5GV16USmlvIwWfqWU8jJa+JVSysto4VdKKS+jhV8ppbyMFn6llPIyWviVUsrLaOFXSikv\n8/8fyAPKscyX9AAAAABJRU5ErkJggg==\n", "text": [""], "metadata": {}, "output_type": "display_data"}], "input": ["pt.plot(x_01, f(x_01), \"--\", color=\"gray\", label=\"$f$\")\n", "pt.plot(x_0h, interp_0h, color=\"red\", label=\"Interpolant\")\n", "pt.plot(nodes, f(nodes), \"or\")\n", "pt.legend(loc=\"best\")"], "metadata": {}, "language": "python", "prompt_number": 251, "cell_type": "code"}, {"source": ["Now build the gen. Vandermonde matrix $V'=$`Vprime` of the derivatives:"], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [], "input": ["def monomial_deriv(i, x):\n", " if i == 0:\n", " return 0*x\n", " else:\n", " return i*nodes**(i-1)\n", "\n", "Vprime = np.array([\n", " monomial_deriv(i, nodes)\n", " for i in range(degree+1)\n", "]).T"], "metadata": {}, "language": "python", "prompt_number": 252, "cell_type": "code"}, {"source": ["Compute the value of the derivative at the nodes as `fderiv`:"], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [], "input": ["fderiv = Vprime.dot(la.inv(V)).dot(f(nodes))"], "metadata": {}, "language": "python", "prompt_number": 257, "cell_type": "code"}, {"source": ["And plot vs `df`, the exact derivative:"], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [{"text": [""], "metadata": {}, "prompt_number": 258, "output_type": "pyout"}, {"png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHF9JREFUeJzt3X1wVHWeLvDnm3dIQF5neAmREEBNMqIjRpS3BiUgLwJB\nS0CuOms5zNa9YN17d3dmdWZl6u7c3am7tTPondm6g4OOirwYSBTCqy9NVNaIkXeCQggDCcRAEt7y\nnvT3/kGDEhLodJ/uX5/Tz6cqVUn3yTmPh+Tx5Jzf+R1RVRARkTNEmQ5ARETWYakTETkIS52IyEFY\n6kREDsJSJyJyEJY6EZGDBFzqItJLRHJFpEREDovIGCuCERFR18VYsI7lADar6uMiEgMg0YJ1EhGR\nHySQm49E5DYAe1R1mHWRiIjIX4GefkkFcFZEXheRr0RkhYh0tyIYERF1XaClHgPgxwD+qKo/BlAH\n4BcBpyIiIr8Eek69HEC5qu72fp2LdqUuIpxchojID6oqXf2egI7UVbUSwCkRGel96REAh25Yzvvx\n8sSJUNWI/Xj55ZeNZwiXD+4L7gvui5t/+MuK0S9LAKwSkTgApQB+0tmCbQkJFmyOiIg6E3Cpq+o+\nAPffarkX09IwbcmSQDdHREQ3YcWR+i39aupUTFuyBBNmzAjF5sKWy+UyHSFscF98h/viO9wXgQto\nnLpPGxDRYG+DiMhpRATqx4XSkBypExFZRaTLPRf2rDzwZakTke046a9/q/8nxVkaiYgchKVOROQg\nLHUiIgdhqRMROQhLnYjIQTj6hYgoiH73u9/h3LlzSElJweLFi4O+PZY6EVGQXLhwAevWrcPy5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uVLACNEZKiIxAF4EkD7X8r3\n4R3LLiJjAJxX1W8t2n44ueW+EJEUABsALFLVYwYyhsot94WqDlPVVFVNxZXz6n/rwEIHfPsdeQ/A\nOBGJFpHuuHJh7HCIc4aCL/viCIBHAMB7DvkOAMdDmjI8dLk3LTlSV9VWEflvALbhypXtP6tqiYgs\n9r7//1R1s4hM904nUAfgJ1ZsO9z4si8A/BOA3gD+w3uE2qKqWaYyB4uP+yIi+Pg7ckREtgLYD8AD\nYIWqOq7Uffy5+N8AXheRfbhy8PkPqlpjLHSQiMhqABMB9BORUwBexpXTcH73Jm8+IiJyED7OjojI\nQVjqREQOwlInInIQljoRkYOw1ImIHISlTkTkICx1IiIHYakTETnI/wdtQeOamDJ+YAAAAABJRU5E\nrkJggg==\n", "text": [""], "metadata": {}, "output_type": "display_data"}], "input": ["pt.plot(x_01, df(x_01), \"--\", color=\"gray\", label=\"$f$\")\n", "pt.plot(nodes, fderiv, \"or\")\n", "pt.legend(loc=\"best\")"], "metadata": {}, "language": "python", "prompt_number": 258, "cell_type": "code"}, {"source": ["* Why don't we hit the values of the derivative exactly?\n", "* Do an accuracy study."], "metadata": {}, "cell_type": "markdown"}, {"collapsed": false, "outputs": [{"text": ["1.85604897639\n"], "stream": "stdout", "output_type": "stream"}], "input": ["print(np.max(np.abs(df(nodes) - fderiv)))"], "metadata": {}, "language": "python", "prompt_number": 255, "cell_type": "code"}]}]}