Last active
July 6, 2017 06:32
-
-
Save akaysh/43ed7dfa7721523f6284ff691f936693 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 18, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"\u001b[1m\u001b[34mINFO: Cloning cache of GR from https://github.com/jheinen/GR.jl.git\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Installing GR v0.22.0\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Building GR\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Downloading pre-compiled GR 0.25.0 Ubuntu binary\n", | |
"\u001b[0m % Total % Received % Xferd Average Speed Time Time Time Current\n", | |
" Dload Upload Total Spent Left Speed\n", | |
"100 8004k 100 8004k 0 0 103k 0 0:01:17 0:01:17 --:--:-- 128k\n", | |
"\u001b[1m\u001b[34mINFO: Package database updated\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: METADATA is out-of-date — you may not have the latest version of GR\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Use `Pkg.update()` to get the latest versions of your packages\n", | |
"\u001b[0m" | |
] | |
} | |
], | |
"source": [ | |
"Pkg.add(\"GR\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 19, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"\u001b[1m\u001b[34mINFO: Updating METADATA...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of DiffEqBase...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of RecursiveArrayTools...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of DiffEqFinancial...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of StochasticDiffEq...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of DelayDiffEq...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of GenericSVD...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of MultiScaleArrays...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of FileIO...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of NLsolve...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of TensorFlow...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of OrdinaryDiffEq...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of LearnBase...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of DiffEqJump...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of DiffEqNoiseProcess...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of ParameterizedFunctions...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of DiffEqDevTools...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Updating cache of PyCall...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: Computing changes...\n", | |
"\u001b[0m\u001b[1m\u001b[34mINFO: No packages to install, update or remove\n", | |
"\u001b[0m" | |
] | |
} | |
], | |
"source": [ | |
"Pkg.update(\"GR\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"\u001b[1m\u001b[34mINFO: Precompiling module GR.\n", | |
"\u001b[0mWARNING: using GR.plot in module Main conflicts with an existing identifier.\n" | |
] | |
} | |
], | |
"source": [ | |
"using NeuralNetDiffEq\n", | |
"using Base.Test\n", | |
"#using Plots; plotly()\n", | |
"using GR; gr()\n", | |
"using DiffEqBase, ParameterizedFunctions\n", | |
"using DiffEqProblemLibrary, DiffEqDevTools\n", | |
"using Knet" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Test 1" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"WARNING: Method definition SODE_2(Any, Any) in module Main at In[2]:2 overwritten at In[14]:2.\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"SODE_2 (generic function with 1 method)" | |
] | |
}, | |
"execution_count": 14, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"function SODE_2(t,u)\n", | |
" du1 = -u[1]/5 + exp(-t/5)*cos(t)\n", | |
" du2 = -u[2]\n", | |
" [du1,du2]\n", | |
"end" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_2,Void,UniformScaling{Int64}}(SODE_2,Float32[0.0,1.0],(0.0f0,2.0f0),nothing,UniformScaling{Int64}\n", | |
"1*I)" | |
] | |
}, | |
"execution_count": 15, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"prob1 = ODEProblem(SODE_2,Float32[0.0,1.0],(Float32(0.0),Float32(2.0)))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 16, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"(:iteration,100,:loss,0.056779962f0)\n", | |
"(:iteration,200,:loss,0.025023488f0)\n", | |
"(:iteration,300,:loss,0.011247986f0)\n", | |
"(:iteration,400,:loss,0.010076475f0)\n", | |
"(:iteration,500,:loss,0.0047588036f0)\n", | |
"(:iteration,600,:loss,0.0035654646f0)\n", | |
"(:iteration,700,:loss,0.002517598f0)\n", | |
"(:iteration,800,:loss,0.0064811353f0)\n", | |
"(:iteration,900,:loss,0.0049035056f0)\n", | |
"(:iteration,1000,:loss,0.0032021091f0)\n", | |
" 82.887497 seconds (268.48 M allocations: 12.598 GB, 3.83% gc time)\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"DiffEqBase.ODESolution{Any,2,Array{Array{Any,1},1},Void,Void,LinSpace{Float32},Array{Any,1},DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_2,Void,UniformScaling{Int64}},NeuralNetDiffEq.nnode,DiffEqBase.LinearInterpolation{LinSpace{Float32},Array{Array{Any,1},1}}}(Array{Any,1}[Any[0.0,1.0],Any[0.212861,0.799015],Any[0.397781,0.638066],Any[0.54676,0.508428],Any[0.655869,0.404192],Any[0.724561,0.320949],Any[0.752817,0.25408],Any[0.740966,0.199549],Any[0.692261,0.154956],Any[0.614865,0.119459]],nothing,nothing,linspace(0.0f0,2.0f0,10),Any[],DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_2,Void,UniformScaling{Int64}}(SODE_2,Float32[0.0,1.0],(0.0f0,2.0f0),nothing,UniformScaling{Int64}\n", | |
"1*I),NeuralNetDiffEq.nnode(10),DiffEqBase.LinearInterpolation{LinSpace{Float32},Array{Array{Any,1},1}}(linspace(0.0f0,2.0f0,10),Array{Any,1}[Any[0.0,1.0],Any[0.212861,0.799015],Any[0.397781,0.638066],Any[0.54676,0.508428],Any[0.655869,0.404192],Any[0.724561,0.320949],Any[0.752817,0.25408],Any[0.740966,0.199549],Any[0.692261,0.154956],Any[0.614865,0.119459]]),false,0,:Success)" | |
] | |
}, | |
"execution_count": 16, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"sol1 = solve(prob1,nnode(10),dt=0.2,iterations=1000)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", | |
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 600 400\">\n", | |
"<defs>\n", | |
" <clipPath id=\"clip00\">\n", | |
" <rect x=\"0\" y=\"0\" width=\"600\" height=\"400\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"0,400 600,400 600,0 0,0 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<defs>\n", | |
" <clipPath id=\"clip01\">\n", | |
" <rect x=\"120\" y=\"0\" width=\"421\" height=\"400\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"39.3701,368.504 592.126,368.504 592.126,7.87402 39.3701,7.87402 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<defs>\n", | |
" <clipPath id=\"clip02\">\n", | |
" <rect x=\"39\" y=\"7\" width=\"554\" height=\"362\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 39.3701,363.094 39.3701,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 177.559,363.094 177.559,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 315.748,363.094 315.748,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 453.937,363.094 453.937,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 592.126,363.094 592.126,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,368.504 583.835,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,296.378 583.835,296.378 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,224.252 583.835,224.252 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,152.126 583.835,152.126 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,80 583.835,80 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,7.87402 583.835,7.87402 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 592.126,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 39.3701,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 177.559,368.504 177.559,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 315.748,368.504 315.748,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 453.937,368.504 453.937,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 592.126,368.504 592.126,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 39.3701,7.87402 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 47.6614,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,296.378 47.6614,296.378 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,224.252 47.6614,224.252 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,152.126 47.6614,152.126 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,80 47.6614,80 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,7.87402 47.6614,7.87402 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 39.3701, 382.304)\" x=\"39.3701\" y=\"382.304\">0.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 177.559, 382.304)\" x=\"177.559\" y=\"382.304\">0.5</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 315.748, 382.304)\" x=\"315.748\" y=\"382.304\">1.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 453.937, 382.304)\" x=\"453.937\" y=\"382.304\">1.5</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 592.126, 382.304)\" x=\"592.126\" y=\"382.304\">2.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 373.004)\" x=\"33.3701\" y=\"373.004\">0.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 300.878)\" x=\"33.3701\" y=\"300.878\">0.2</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 228.752)\" x=\"33.3701\" y=\"228.752\">0.4</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 156.626)\" x=\"33.3701\" y=\"156.626\">0.6</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 84.5)\" x=\"33.3701\" y=\"84.5\">0.8</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 12.374)\" x=\"33.3701\" y=\"12.374\">1.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:16; text-anchor:middle;\" transform=\"rotate(0, 315.748, 397.6)\" x=\"315.748\" y=\"397.6\">t</text>\n", | |
"</g>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#009af9; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 100.787,291.74 162.205,225.052 223.622,171.326 285.039,131.978 346.457,107.206 407.874,97.0157 469.291,101.29 530.709,118.854 592.126,146.765 \n", | |
" \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#e26f46; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,7.87402 100.787,80.3551 162.205,138.398 223.622,185.149 285.039,222.74 346.457,252.76 407.874,276.875 469.291,296.541 530.709,312.622 592.126,325.423 \n", | |
" \n", | |
" \"/>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"489.759,74.114 574.126,74.114 574.126,28.754 489.759,28.754 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 489.759,74.114 574.126,74.114 574.126,28.754 489.759,28.754 489.759,74.114 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#009af9; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 495.759,43.874 531.759,43.874 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.759, 48.374)\" x=\"537.759\" y=\"48.374\">u1(t)</text>\n", | |
"</g>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#e26f46; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 495.759,58.994 531.759,58.994 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.759, 63.494)\" x=\"537.759\" y=\"63.494\">u2(t)</text>\n", | |
"</g>\n", | |
"</svg>\n" | |
] | |
}, | |
"execution_count": 21, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"plot(sol1)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Test 2" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"SODE_3 (generic function with 1 method)" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"function SODE_3(t,u)\n", | |
" du1 = -u[1]/5 + exp(-t/5)*cos(t)\n", | |
" du2 = -u[2]/5 + exp(-t/5)*cos(t)\n", | |
" [du1,du2]\n", | |
"end" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_3,Void,UniformScaling{Int64}}(SODE_3,Float32[0.0,0.0],(0.0f0,2.0f0),nothing,UniformScaling{Int64}\n", | |
"1*I)" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"prob2 = ODEProblem(SODE_3,Float32[0.0,0.0],(Float32(0.0),Float32(2.0)))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"(:iteration,100,:loss,0.0061395993f0)\n", | |
"(:iteration,200,:loss,0.0018329715f0)\n", | |
"(:iteration,300,:loss,0.0037576563f0)\n", | |
"(:iteration,400,:loss,0.013650687f0)\n", | |
"(:iteration,500,:loss,0.013106221f0)\n", | |
"(:iteration,600,:loss,0.0030063726f0)\n", | |
"(:iteration,700,:loss,0.016314188f0)\n", | |
"(:iteration,800,:loss,0.006872811f0)\n", | |
"(:iteration,900,:loss,0.0098809f0)\n", | |
"(:iteration,1000,:loss,0.014690644f0)\n", | |
" 75.637094 seconds (277.72 M allocations: 12.982 GB, 3.84% gc time)\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"DiffEqBase.ODESolution{Any,2,Array{Array{Any,1},1},Void,Void,LinSpace{Float32},Array{Any,1},DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_3,Void,UniformScaling{Int64}},NeuralNetDiffEq.nnode,DiffEqBase.LinearInterpolation{LinSpace{Float32},Array{Array{Any,1},1}}}(Array{Any,1}[Any[0.0,0.0],Any[0.202073,0.203002],Any[0.377527,0.379463],Any[0.518296,0.521317],Any[0.620764,0.624932],Any[0.684342,0.689747],Any[0.708203,0.714916],Any[0.692398,0.700331],Any[0.64122,0.650023],Any[0.564301,0.57341]],nothing,nothing,linspace(0.0f0,2.0f0,10),Any[],DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_3,Void,UniformScaling{Int64}}(SODE_3,Float32[0.0,0.0],(0.0f0,2.0f0),nothing,UniformScaling{Int64}\n", | |
"1*I),NeuralNetDiffEq.nnode(10),DiffEqBase.LinearInterpolation{LinSpace{Float32},Array{Array{Any,1},1}}(linspace(0.0f0,2.0f0,10),Array{Any,1}[Any[0.0,0.0],Any[0.202073,0.203002],Any[0.377527,0.379463],Any[0.518296,0.521317],Any[0.620764,0.624932],Any[0.684342,0.689747],Any[0.708203,0.714916],Any[0.692398,0.700331],Any[0.64122,0.650023],Any[0.564301,0.57341]]),false,0,:Success)" | |
] | |
}, | |
"execution_count": 8, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"sol2 = solve(prob2,nnode(10),dt=0.2,iterations=1000)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", | |
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 600 400\">\n", | |
"<defs>\n", | |
" <clipPath id=\"clip00\">\n", | |
" <rect x=\"0\" y=\"0\" width=\"600\" height=\"400\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"0,400 600,400 600,0 0,0 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<defs>\n", | |
" <clipPath id=\"clip01\">\n", | |
" <rect x=\"120\" y=\"0\" width=\"421\" height=\"400\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"39.3701,368.504 592.126,368.504 592.126,7.87402 39.3701,7.87402 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<defs>\n", | |
" <clipPath id=\"clip02\">\n", | |
" <rect x=\"39\" y=\"7\" width=\"554\" height=\"362\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 39.3701,363.094 39.3701,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 177.559,363.094 177.559,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 315.748,363.094 315.748,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 453.937,363.094 453.937,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 592.126,363.094 592.126,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,368.504 583.835,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,267.617 583.835,267.617 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,166.729 583.835,166.729 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,65.8419 583.835,65.8419 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 592.126,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 39.3701,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 177.559,368.504 177.559,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 315.748,368.504 315.748,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 453.937,368.504 453.937,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 592.126,368.504 592.126,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 39.3701,7.87402 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 47.6614,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,267.617 47.6614,267.617 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,166.729 47.6614,166.729 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,65.8419 47.6614,65.8419 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 39.3701, 382.304)\" x=\"39.3701\" y=\"382.304\">0.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 177.559, 382.304)\" x=\"177.559\" y=\"382.304\">0.5</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 315.748, 382.304)\" x=\"315.748\" y=\"382.304\">1.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 453.937, 382.304)\" x=\"453.937\" y=\"382.304\">1.5</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 592.126, 382.304)\" x=\"592.126\" y=\"382.304\">2.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 373.004)\" x=\"33.3701\" y=\"373.004\">0.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 272.117)\" x=\"33.3701\" y=\"272.117\">0.2</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 171.229)\" x=\"33.3701\" y=\"171.229\">0.4</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 70.3419)\" x=\"33.3701\" y=\"70.3419\">0.6</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:16; text-anchor:middle;\" transform=\"rotate(0, 315.748, 397.6)\" x=\"315.748\" y=\"397.6\">t</text>\n", | |
"</g>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#009af9; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 100.787,266.571 162.205,178.065 223.622,107.056 285.039,55.3678 346.457,23.2967 407.874,11.2605 469.291,19.2327 530.709,45.049 592.126,83.8496 \n", | |
" \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#e26f46; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 100.787,266.102 162.205,177.089 223.622,105.532 285.039,53.2654 346.457,20.5702 407.874,7.87402 469.291,15.2312 530.709,40.6082 592.126,79.2548 \n", | |
" \n", | |
" \"/>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"489.759,74.114 574.126,74.114 574.126,28.754 489.759,28.754 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 489.759,74.114 574.126,74.114 574.126,28.754 489.759,28.754 489.759,74.114 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#009af9; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 495.759,43.874 531.759,43.874 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.759, 48.374)\" x=\"537.759\" y=\"48.374\">u1(t)</text>\n", | |
"</g>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#e26f46; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 495.759,58.994 531.759,58.994 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.759, 63.494)\" x=\"537.759\" y=\"63.494\">u2(t)</text>\n", | |
"</g>\n", | |
"</svg>\n" | |
] | |
}, | |
"execution_count": 22, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"plot(sol2)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"SODE_4 (generic function with 1 method)" | |
] | |
}, | |
"execution_count": 10, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"function SODE_4(t,u)\n", | |
" du1 = cos(t) + u[1]^2 + u[2] - (1+ t^2 + (sin(t))^2)\n", | |
" du2 = 2t - (1+t^2)*sin(t) + u[1]*u[2]\n", | |
" [du1,du2]\n", | |
"end" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_4,Void,UniformScaling{Int64}}(SODE_4,Float32[0.0,1.0],(0.0f0,3.0f0),nothing,UniformScaling{Int64}\n", | |
"1*I)" | |
] | |
}, | |
"execution_count": 11, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"prob4 = ODEProblem(SODE_4,Float32[0.0,1.0],(Float32(0.0),Float32(3.0)))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"(:iteration,100,:loss,3.975262f0)\n", | |
"(:iteration,200,:loss,0.7860724f0)\n", | |
"(:iteration,300,:loss,1.1610736f0)\n", | |
"(:iteration,400,:loss,1.3053416f0)\n", | |
"(:iteration,500,:loss,1.3989285f0)\n", | |
"(:iteration,600,:loss,0.6583102f0)\n", | |
"(:iteration,700,:loss,0.22773407f0)\n", | |
"(:iteration,800,:loss,0.47737747f0)\n", | |
"(:iteration,900,:loss,0.17691173f0)\n", | |
"(:iteration,1000,:loss,0.026611237f0)\n", | |
"116.649118 seconds (306.26 M allocations: 14.036 GB, 3.35% gc time)\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"DiffEqBase.ODESolution{Any,2,Array{Array{Any,1},1},Void,Void,LinSpace{Float32},Array{Any,1},DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_4,Void,UniformScaling{Int64}},NeuralNetDiffEq.nnode,DiffEqBase.LinearInterpolation{LinSpace{Float32},Array{Array{Any,1},1}}}(Array{Any,1}[Any[0.0,1.0],Any[0.32105,0.666146],Any[0.703647,0.777933],Any[1.0797,0.847113],Any[1.42686,0.862648],Any[1.72639,0.722651],Any[1.99813,0.478877],Any[2.26603,0.289139],Any[2.54188,0.421526],Any[2.829,1.45838]],nothing,nothing,linspace(0.0f0,3.0f0,10),Any[],DiffEqBase.ODEProblem{Array{Float32,1},Float32,false,#SODE_4,Void,UniformScaling{Int64}}(SODE_4,Float32[0.0,1.0],(0.0f0,3.0f0),nothing,UniformScaling{Int64}\n", | |
"1*I),NeuralNetDiffEq.nnode(10),DiffEqBase.LinearInterpolation{LinSpace{Float32},Array{Array{Any,1},1}}(linspace(0.0f0,3.0f0,10),Array{Any,1}[Any[0.0,1.0],Any[0.32105,0.666146],Any[0.703647,0.777933],Any[1.0797,0.847113],Any[1.42686,0.862648],Any[1.72639,0.722651],Any[1.99813,0.478877],Any[2.26603,0.289139],Any[2.54188,0.421526],Any[2.829,1.45838]]),false,0,:Success)" | |
] | |
}, | |
"execution_count": 12, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"sol4 = solve(prob4,nnode(10),dt=0.3,iterations=1000)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n", | |
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 600 400\">\n", | |
"<defs>\n", | |
" <clipPath id=\"clip00\">\n", | |
" <rect x=\"0\" y=\"0\" width=\"600\" height=\"400\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"0,400 600,400 600,0 0,0 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<defs>\n", | |
" <clipPath id=\"clip01\">\n", | |
" <rect x=\"120\" y=\"0\" width=\"421\" height=\"400\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"39.3701,368.504 592.126,368.504 592.126,7.87402 39.3701,7.87402 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<defs>\n", | |
" <clipPath id=\"clip02\">\n", | |
" <rect x=\"39\" y=\"7\" width=\"554\" height=\"362\"/>\n", | |
" </clipPath>\n", | |
"</defs>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 39.3701,363.094 39.3701,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 131.496,363.094 131.496,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 223.622,363.094 223.622,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 315.748,363.094 315.748,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 407.874,363.094 407.874,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 500,363.094 500,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 592.126,363.094 592.126,13.2835 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,368.504 583.835,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,241.028 583.835,241.028 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:0.5; fill:none\" stroke-dasharray=\"1, 2\" points=\"\n", | |
" 47.6614,113.552 583.835,113.552 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 592.126,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 39.3701,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 131.496,368.504 131.496,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 223.622,368.504 223.622,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 315.748,368.504 315.748,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 407.874,368.504 407.874,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 500,368.504 500,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 592.126,368.504 592.126,363.094 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 39.3701,7.87402 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 47.6614,368.504 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,241.028 47.6614,241.028 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,113.552 47.6614,113.552 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 39.3701, 382.304)\" x=\"39.3701\" y=\"382.304\">0.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 131.496, 382.304)\" x=\"131.496\" y=\"382.304\">0.5</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 223.622, 382.304)\" x=\"223.622\" y=\"382.304\">1.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 315.748, 382.304)\" x=\"315.748\" y=\"382.304\">1.5</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 407.874, 382.304)\" x=\"407.874\" y=\"382.304\">2.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 500, 382.304)\" x=\"500\" y=\"382.304\">2.5</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 592.126, 382.304)\" x=\"592.126\" y=\"382.304\">3.0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 373.004)\" x=\"33.3701\" y=\"373.004\">0</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 245.528)\" x=\"33.3701\" y=\"245.528\">1</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 33.3701, 118.052)\" x=\"33.3701\" y=\"118.052\">2</text>\n", | |
"</g>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:16; text-anchor:middle;\" transform=\"rotate(0, 315.748, 397.6)\" x=\"315.748\" y=\"397.6\">t</text>\n", | |
"</g>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#009af9; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,368.504 100.787,327.578 162.205,278.806 223.622,230.868 285.039,186.614 346.457,148.43 407.874,113.791 469.291,79.6396 530.709,44.4751 592.126,7.87402 \n", | |
" \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip02)\" style=\"stroke:#e26f46; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 39.3701,241.028 100.787,283.586 162.205,269.336 223.622,260.517 285.039,258.537 346.457,276.383 407.874,307.459 469.291,331.646 530.709,314.77 592.126,182.595 \n", | |
" \n", | |
" \"/>\n", | |
"<polygon clip-path=\"url(#clip00)\" points=\"\n", | |
"489.759,74.114 574.126,74.114 574.126,28.754 489.759,28.754 \n", | |
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n", | |
" 489.759,74.114 574.126,74.114 574.126,28.754 489.759,28.754 489.759,74.114 \n", | |
" \"/>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#009af9; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 495.759,43.874 531.759,43.874 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.759, 48.374)\" x=\"537.759\" y=\"48.374\">u1(t)</text>\n", | |
"</g>\n", | |
"<polyline clip-path=\"url(#clip00)\" style=\"stroke:#e26f46; stroke-width:3; stroke-opacity:1; fill:none\" points=\"\n", | |
" 495.759,58.994 531.759,58.994 \n", | |
" \"/>\n", | |
"<g clip-path=\"url(#clip00)\">\n", | |
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.759, 63.494)\" x=\"537.759\" y=\"63.494\">u2(t)</text>\n", | |
"</g>\n", | |
"</svg>\n" | |
] | |
}, | |
"execution_count": 23, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"plot(sol4)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"anaconda-cloud": {}, | |
"kernelspec": { | |
"display_name": "Julia 0.5.0", | |
"language": "julia", | |
"name": "julia-0.5" | |
}, | |
"language_info": { | |
"file_extension": ".jl", | |
"mimetype": "application/julia", | |
"name": "julia", | |
"version": "0.5.2" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment