Skip to content
Permalink
07d05ee117
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
548 lines (548 sloc) 22.5 KB
{
"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": "fragment"
}
},
"source": [
"|Question|\tAnswered Right|\tAnswered Wrong\t|Total % Right\n",
"|-----------------------------|---|---|---|\n",
"|What is the 32-bit representation of e \"exp(1)\"?\t|37|\t26|\t58.7%|\n",
"|The command \">10+eps-10\" results in:\t|24|\t39\t|38.1%|\n",
"|Using a first-order Taylor series expansion and a time step, h, of 0.1 s, the order of expected truncation error is:\t|37\t|26|\t58.7%|"
]
},
{
"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",
"$R_{1}=O(\\Delta t^{2})$\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": [
"<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.190\"/>\n",
"\t<path d=\"M-1,-1 L1,1 M1,-1 L-1,1\" id=\"gpPt1\" stroke=\"currentColor\" stroke-width=\"0.190\"/>\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.190\"/>\n",
"\t<rect height=\"2\" id=\"gpPt3\" stroke=\"currentColor\" stroke-width=\"0.190\" width=\"2\" x=\"-1\" y=\"-1\"/>\n",
"\t<rect fill=\"currentColor\" height=\"2\" id=\"gpPt4\" stroke=\"currentColor\" stroke-width=\"0.190\" width=\"2\" x=\"-1\" y=\"-1\"/>\n",
"\t<circle cx=\"0\" cy=\"0\" id=\"gpPt5\" r=\"1\" stroke=\"currentColor\" stroke-width=\"0.190\"/>\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.190\"/>\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.190\"/>\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=\"43.6,378.0 530.7,378.0 530.7,19.6 43.6,19.6 \"/>\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=\"M43.6,378.0 L58.3,378.0 M530.8,378.0 L516.1,378.0 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(33.9,384.7)\">\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=\"M43.6,306.3 L58.3,306.3 M530.8,306.3 L516.1,306.3 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(33.9,313.0)\">\n",
"\t\t<text><tspan font-family=\"{}\">10</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=\"M43.6,234.6 L58.3,234.6 M530.8,234.6 L516.1,234.6 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(33.9,241.3)\">\n",
"\t\t<text><tspan font-family=\"{}\">20</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=\"M43.6,162.9 L58.3,162.9 M530.8,162.9 L516.1,162.9 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(33.9,169.6)\">\n",
"\t\t<text><tspan font-family=\"{}\">30</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=\"M43.6,91.2 L58.3,91.2 M530.8,91.2 L516.1,91.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(33.9,97.9)\">\n",
"\t\t<text><tspan font-family=\"{}\">40</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=\"M43.6,19.5 L58.3,19.5 M530.8,19.5 L516.1,19.5 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"end\" transform=\"translate(33.9,26.2)\">\n",
"\t\t<text><tspan font-family=\"{}\">50</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=\"M43.6,378.0 L43.6,363.3 M43.6,19.5 L43.6,34.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(43.6,405.7)\">\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=\"M124.8,378.0 L124.8,363.3 M124.8,19.5 L124.8,34.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(124.8,405.7)\">\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=\"M206.0,378.0 L206.0,363.3 M206.0,19.5 L206.0,34.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(206.0,405.7)\">\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=\"M287.2,378.0 L287.2,363.3 M287.2,19.5 L287.2,34.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(287.2,405.7)\">\n",
"\t\t<text><tspan font-family=\"{}\">6</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=\"M368.4,378.0 L368.4,363.3 M368.4,19.5 L368.4,34.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(368.4,405.7)\">\n",
"\t\t<text><tspan font-family=\"{}\">8</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=\"M449.6,378.0 L449.6,363.3 M449.6,19.5 L449.6,34.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(449.6,405.7)\">\n",
"\t\t<text><tspan font-family=\"{}\">10</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=\"M530.8,378.0 L530.8,363.3 M530.8,19.5 L530.8,34.2 \" stroke=\"black\"/>\t<g fill=\"rgb(0,0,0)\" font-family=\"{}\" font-size=\"18.00\" stroke=\"none\" text-anchor=\"middle\" transform=\"translate(530.8,405.7)\">\n",
"\t\t<text><tspan font-family=\"{}\">12</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=\"M43.6,19.5 L43.6,378.0 L530.8,378.0 L530.8,19.5 L43.6,19.5 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=\"4.00\">\n",
"</g>\n",
"<g color=\"black\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-width=\"4.00\">\n",
"\t<path d=\"M43.6,378.0 L87.9,302.5 L132.2,233.8 L176.5,176.4 L220.8,131.8 L265.1,99.2 L309.3,76.2 L353.6,60.4 L397.9,49.9 L442.2,43.0 L486.5,38.4 L530.8,35.5 \" 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=\"4.00\">\n",
"\t<path d=\"M43.6,378.0 L87.9,301.3 L132.2,228.3 L176.5,165.7 L220.8,117.6 L265.1,83.8 L309.3,62.0 L353.6,48.6 L397.9,40.6 L442.2,36.1 L486.5,33.4 L530.8,32.0 \" stroke=\"rgb( 0, 128, 0)\"/>\t<g onmousemove=\"gnuplot_svg.showHypertext(evt,'')\" onmouseout=\"gnuplot_svg.hideHypertext()\"><title> </title>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(43.6,378.0) scale(10.50)\" xlink:href=\"#gpPt5\"/></g>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(87.9,301.3) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(132.2,228.3) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(176.5,165.7) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(220.8,117.6) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(265.1,83.8) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(309.3,62.0) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(353.6,48.6) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(397.9,40.6) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(442.2,36.1) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(486.5,33.4) scale(10.50)\" xlink:href=\"#gpPt5\"/>\n",
"\t<use color=\"rgb( 0, 128, 0)\" transform=\"translate(530.8,32.0) scale(10.50)\" xlink:href=\"#gpPt5\"/>\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": [
"[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
}