Skip to content
Permalink
ee2c3e2428
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
430 lines (430 sloc) 29.5 KB
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"%plot --format svg"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"setdefaults"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![q1](q1.png)\n",
"\n",
"![q2](q2.png)\n",
"\n",
"## Reduce Noise in derivative of data\n",
"\n",
"![reduce noise](reduce_noise.png)\n",
"\n",
"- Turn the volume down!\n",
"\n",
"- Use robust statistics like median and mean absolute deviation\n",
"\n",
"- Gauss quadrature\n",
"\n",
"- Put a filter on it\n",
"\n",
"- Take the average\n",
"\n",
"- Low-pass filter\n",
"\n",
"- Expand the Taylor series\n",
"\n",
"- Fit a function and derive that\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"error: subscript indices must be either positive integers less than 2^31 or logicals\n",
"ans =\n",
"\n",
" 1 100\n",
"\n"
]
},
{
"data": {
"image/svg+xml": [
"<svg height=\"420px\" viewBox=\"0 0 560 420\" width=\"560px\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"\n",
"<title>Gnuplot</title>\n",
"<desc>Produced by GNUPLOT 5.0 patchlevel 3 </desc>\n",
"\n",
"<g id=\"gnuplot_canvas\">\n",
"\n",
"<rect fill=\"none\" height=\"420\" width=\"560\" x=\"0\" y=\"0\"/>\n",
"<defs>\n",
"\n",
"\t<circle id=\"gpDot\" r=\"0.5\" stroke-width=\"0.5\"/>\n",
"\t<path d=\"M-1,0 h2 M0,-1 v2\" id=\"gpPt0\" stroke=\"currentColor\" stroke-width=\"0.222\"/>\n",
"\t<path d=\"M-1,-1 L1,1 M1,-1 L-1,1\" id=\"gpPt1\" stroke=\"currentColor\" stroke-width=\"0.222\"/>\n",
"\t<path d=\"M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1\" id=\"gpPt2\" stroke=\"currentColor\" stroke-width=\"0.222\"/>\n",
"\t<rect height=\"2\" id=\"gpPt3\" stroke=\"currentColor\" stroke-width=\"0.222\" width=\"2\" x=\"-1\" y=\"-1\"/>\n",
"\t<rect fill=\"currentColor\" height=\"2\" id=\"gpPt4\" stroke=\"currentColor\" stroke-width=\"0.222\" width=\"2\" x=\"-1\" y=\"-1\"/>\n",
"\t<circle cx=\"0\" cy=\"0\" id=\"gpPt5\" r=\"1\" stroke=\"currentColor\" stroke-width=\"0.222\"/>\n",
"\t<use fill=\"currentColor\" id=\"gpPt6\" stroke=\"none\" xlink:href=\"#gpPt5\"/>\n",
"\t<path d=\"M0,-1.33 L-1.33,0.67 L1.33,0.67 z\" id=\"gpPt7\" stroke=\"currentColor\" stroke-width=\"0.222\"/>\n",
"\t<use fill=\"currentColor\" id=\"gpPt8\" stroke=\"none\" xlink:href=\"#gpPt7\"/>\n",
"\t<use id=\"gpPt9\" stroke=\"currentColor\" transform=\"rotate(180)\" xlink:href=\"#gpPt7\"/>\n",
"\t<use fill=\"currentColor\" id=\"gpPt10\" stroke=\"none\" xlink:href=\"#gpPt9\"/>\n",
"\t<use id=\"gpPt11\" stroke=\"currentColor\" transform=\"rotate(45)\" xlink:href=\"#gpPt3\"/>\n",
"\t<use fill=\"currentColor\" id=\"gpPt12\" stroke=\"none\" xlink:href=\"#gpPt11\"/>\n",
"\t<path d=\"M0,1.330 L1.265,0.411 L0.782,-1.067 L-0.782,-1.076 L-1.265,0.411 z\" id=\"gpPt13\" stroke=\"currentColor\" stroke-width=\"0.222\"/>\n",
"\t<use fill=\"currentColor\" id=\"gpPt14\" stroke=\"none\" xlink:href=\"#gpPt13\"/>\n",
"\t<filter filterUnits=\"objectBoundingBox\" height=\"1\" id=\"textbox\" width=\"1\" x=\"0\" y=\"0\">\n",
"\t <feFlood flood-color=\"white\" flood-opacity=\"1\" result=\"bgnd\"/>\n",
"\t <feComposite in=\"SourceGraphic\" in2=\"bgnd\" operator=\"atop\"/>\n",
"\t</filter>\n",
"\t<filter filterUnits=\"objectBoundingBox\" height=\"1\" id=\"greybox\" width=\"1\" x=\"0\" y=\"0\">\n",
"\t <feFlood flood-color=\"lightgrey\" flood-opacity=\"1\" result=\"grey\"/>\n",
"\t <feComposite in=\"SourceGraphic\" in2=\"grey\" operator=\"atop\"/>\n",
"\t</filter>\n",
"</defs>\n",
"<g color=\"white\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"1.00\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"1.00\">\n",
"\t<g shape-rendering=\"crispEdges\" stroke=\"none\">\n",
"\t\t<polygon fill=\"rgb(255, 255, 255)\" points=\"53.9,384.0 534.9,384.0 534.9,16.8 53.9,16.8 \"/>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"rgb(255, 255, 255)\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,384.0 L66.4,384.0 M535.0,384.0 L522.5,384.0 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(45.6,390.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">-1.5</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,322.8 L66.4,322.8 M535.0,322.8 L522.5,322.8 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(45.6,328.8)\">\n",
"\t\t<text><tspan font-family=\"{}\">-1</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,261.6 L66.4,261.6 M535.0,261.6 L522.5,261.6 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(45.6,267.6)\">\n",
"\t\t<text><tspan font-family=\"{}\">-0.5</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,200.3 L66.4,200.3 M535.0,200.3 L522.5,200.3 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(45.6,206.3)\">\n",
"\t\t<text><tspan font-family=\"{}\">0</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,139.1 L66.4,139.1 M535.0,139.1 L522.5,139.1 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(45.6,145.1)\">\n",
"\t\t<text><tspan font-family=\"{}\">0.5</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,77.9 L66.4,77.9 M535.0,77.9 L522.5,77.9 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(45.6,83.9)\">\n",
"\t\t<text><tspan font-family=\"{}\">1</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,16.7 L66.4,16.7 M535.0,16.7 L522.5,16.7 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(45.6,22.7)\">\n",
"\t\t<text><tspan font-family=\"{}\">1.5</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,384.0 L53.9,371.5 M53.9,16.7 L53.9,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(53.9,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">-4</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M114.0,384.0 L114.0,371.5 M114.0,16.7 L114.0,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(114.0,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">-3</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M174.2,384.0 L174.2,371.5 M174.2,16.7 L174.2,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(174.2,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">-2</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M234.3,384.0 L234.3,371.5 M234.3,16.7 L234.3,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(234.3,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">-1</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M294.5,384.0 L294.5,371.5 M294.5,16.7 L294.5,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(294.5,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">0</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M354.6,384.0 L354.6,371.5 M354.6,16.7 L354.6,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(354.6,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">1</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M414.7,384.0 L414.7,371.5 M414.7,16.7 L414.7,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(414.7,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">2</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M474.9,384.0 L474.9,371.5 M474.9,16.7 L474.9,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(474.9,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">3</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M535.0,384.0 L535.0,371.5 M535.0,16.7 L535.0,29.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"16.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(535.0,408.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">4</tspan></text>\n",
"\t</g>\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"\t<path d=\"M53.9,16.7 L53.9,384.0 L535.0,384.0 L535.0,16.7 L53.9,16.7 Z \" stroke=\"black\"/></g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"</g>\n",
"\t<g id=\"gnuplot_plot_1a\"><title>gnuplot_plot_1a</title>\n",
"<g color=\"white\" fill=\"none\" stroke=\"black\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"3.00\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"3.00\">\n",
"\t<path d=\"M105.5,195.2 L109.3,195.2 L113.2,214.1 L117.0,220.4 L120.8,229.0 L124.6,227.0 L128.4,238.3 L132.2,241.8 L136.1,258.1 L139.9,262.0 L143.7,264.0 L147.5,272.3 L151.3,274.5 L155.1,279.4 L159.0,289.8 L162.8,292.9 L166.6,302.9 L170.4,306.7 L174.2,303.3 L178.0,312.7 L181.9,309.7 L185.7,313.0 L189.5,319.3 L193.3,317.0 L197.1,327.8 L200.9,319.0 L204.8,328.3 L208.6,319.9 L212.4,318.4 L216.2,318.6 L220.0,323.6 L223.8,310.2 L227.7,315.2 L231.5,312.7 L235.3,301.6 L239.1,299.3 L242.9,295.0 L246.7,287.4 L250.6,292.9 L254.4,287.8 L258.2,270.3 L262.0,274.7 L265.8,263.9 L269.6,259.1 L273.5,248.8 L277.3,239.3 L281.1,236.1 L284.9,223.6 L288.7,222.6 L292.5,214.9 L296.4,206.9 L300.2,190.4 L304.0,183.1 L307.8,180.2 L311.6,169.5 L315.4,160.1 L319.3,154.7 L323.1,145.8 L326.9,140.4 L330.7,143.1 L334.5,133.6 L338.3,119.3 L342.2,115.9 L346.0,116.8 L349.8,108.8 L353.6,100.7 L357.4,101.7 L361.2,89.5 L365.1,86.0 L368.9,85.1 L372.7,81.9 L376.5,81.0 L380.3,79.1 L384.1,73.8 L388.0,82.8 L391.8,72.1 L395.6,74.2 L399.4,83.6 L403.2,85.7 L407.0,83.0 L410.9,81.2 L414.7,83.2 L418.5,84.7 L422.3,86.6 L426.1,90.8 L429.9,105.9 L433.8,107.1 L437.6,115.5 L441.4,112.4 L445.2,126.3 L449.0,125.3 L452.8,134.0 L456.7,136.1 L460.5,148.4 L464.3,154.2 L468.1,158.3 L471.9,166.3 L475.7,177.1 L479.6,180.5 L483.4,192.6 \" stroke=\"rgb( 0, 0, 255)\"/></g>\n",
"\t</g>\n",
"\t<g id=\"gnuplot_plot_2a\"><title>gnuplot_plot_2a</title>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"3.00\">\n",
"\t<g onmousemove=\"gnuplot_svg.showHypertext(evt,'')\" onmouseout=\"gnuplot_svg.hideHypertext()\"><title> </title>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(105.5,195.2) scale(4.00)\" xlink:href=\"#gpPt6\"/></g>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(109.3,214.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(113.2,220.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(117.0,229.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(120.8,227.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(124.6,238.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(128.4,241.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(132.2,258.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(136.1,262.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(139.9,264.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(143.7,272.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(147.5,274.5) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(151.3,279.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(155.1,289.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(159.0,292.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(162.8,302.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(166.6,306.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(170.4,303.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(174.2,312.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(178.0,309.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(181.9,313.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(185.7,319.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(189.5,317.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(193.3,327.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(197.1,319.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(200.9,328.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(204.8,319.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(208.6,318.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(212.4,318.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(216.2,323.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(220.0,310.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(223.8,315.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(227.7,312.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(231.5,301.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(235.3,299.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(239.1,295.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(242.9,287.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(246.7,292.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(250.6,287.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(254.4,270.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(258.2,274.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(262.0,263.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(265.8,259.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(269.6,248.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(273.5,239.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(277.3,236.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(281.1,223.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(284.9,222.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(288.7,214.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(292.5,206.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(296.4,190.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(300.2,183.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(304.0,180.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(307.8,169.5) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(311.6,160.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(315.4,154.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(319.3,145.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(323.1,140.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(326.9,143.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(330.7,133.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(334.5,119.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(338.3,115.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(342.2,116.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(346.0,108.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(349.8,100.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(353.6,101.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(357.4,89.5) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(361.2,86.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(365.1,85.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(368.9,81.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(372.7,81.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(376.5,79.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(380.3,73.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(384.1,82.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(388.0,72.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(391.8,74.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(395.6,83.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(399.4,85.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(403.2,83.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(407.0,81.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(410.9,83.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(414.7,84.7) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(418.5,86.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(422.3,90.8) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(426.1,105.9) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(429.9,107.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(433.8,115.5) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(437.6,112.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(441.4,126.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(445.2,125.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(449.0,134.0) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(452.8,136.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(456.7,148.4) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(460.5,154.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(464.3,158.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(468.1,166.3) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(471.9,177.1) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(475.7,180.5) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(479.6,192.6) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(483.4,196.2) scale(4.00)\" xlink:href=\"#gpPt6\"/>\n",
"</g>\n",
"\t</g>\n",
"<g color=\"white\" fill=\"none\" stroke=\"rgb( 0, 128, 0)\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"2.00\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"2.00\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"black\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"0.50\">\n",
"</g>\n",
"</g>\n",
"</svg>"
],
"text/plain": [
"<IPython.core.display.SVG object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"x=linspace(-pi,pi);\n",
"y_smooth=sin(x);\n",
"y_noise =y_smooth+rand(size(x))*0.1-0.05;\n",
"\n",
"% Smooth data\n",
"N=20; % average data between 10 points (forward/backward)\n",
"y_data=[y_noise(N/2:-1:1) y_noise y_noise(end:-1:end-N/2+1)];\n",
"y_filter=y_data;\n",
"for i=6:length(x)\n",
" y_filter(i)=mean(y_data(i-10:i));\n",
"end\n",
"y_filter=y_filter(N/2:end-N/2-1);\n",
"size(y_filter)\n",
"plot(x,y_filter,x,y_noise,'.')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Homework Review\n",
"\n",
"### HW #4\n",
"\n",
"![collar mass](../HW4/collar_mass.png)\n",
"\n",
"$E_{total}=m x_C g\\sin(\\theta)+\\frac{K}{2}\\left(0.5 - \\sqrt{0.5^2+(0.5-x_C)^2}\\right)^{2}$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```matlab\n",
"% Define function ...\n",
"function collar_potential_energy(x,theta)\n",
" % function to evaluate E_total\n",
" Etotal = m*x*g.*sin(theta)+K/2*(0.5-sqrt(0.5^2+(0.5-x).^2);\n",
"end\n",
"\n",
"% solve for x\n",
"\n",
"x=goldmin(@(x) collar_potential_energy(x,theta),xl,xu)\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## HW #5\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Initial Value Problem"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"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
}