Bläddra i källkod

Tried RK methods...

rparedis 4 år sedan
förälder
incheckning
4db37aed62
97 ändrade filer med 1744 tillägg och 186 borttagningar
  1. 2 0
      .gitignore
  2. BIN
      doc/_build/doctrees/CBD.CBD.doctree
  3. BIN
      doc/_build/doctrees/CBD.lib.endpoints.doctree
  4. BIN
      doc/_build/doctrees/CBD.stepsize.doctree
  5. BIN
      doc/_build/doctrees/environment.pickle
  6. BIN
      doc/_build/doctrees/examples/ContinuousTime.doctree
  7. BIN
      doc/_build/doctrees/index.doctree
  8. BIN
      doc/_build/doctrees/install.doctree
  9. BIN
      doc/_build/doctrees/modules.doctree
  10. 1 1
      doc/_build/html/.buildinfo
  11. 12 0
      doc/_build/html/CBD.CBD.html
  12. 2 0
      doc/_build/html/CBD.CBD2LaTeX.html
  13. 2 0
      doc/_build/html/CBD.CBDDraw.html
  14. 2 0
      doc/_build/html/CBD.depGraph.html
  15. 2 0
      doc/_build/html/CBD.html
  16. 3 1
      doc/_build/html/CBD.lib.endpoints.html
  17. 2 0
      doc/_build/html/CBD.lib.html
  18. 2 0
      doc/_build/html/CBD.lib.io.html
  19. 2 0
      doc/_build/html/CBD.lib.std.html
  20. 2 0
      doc/_build/html/CBD.naivelog.html
  21. 2 0
      doc/_build/html/CBD.realtime.accurate_time.html
  22. 2 0
      doc/_build/html/CBD.realtime.html
  23. 2 0
      doc/_build/html/CBD.realtime.plotting.html
  24. 2 0
      doc/_build/html/CBD.realtime.threadingBackend.html
  25. 2 0
      doc/_build/html/CBD.realtime.threadingGameLoop.html
  26. 2 0
      doc/_build/html/CBD.realtime.threadingPython.html
  27. 2 0
      doc/_build/html/CBD.realtime.threadingTkInter.html
  28. 2 0
      doc/_build/html/CBD.scheduling.html
  29. 2 0
      doc/_build/html/CBD.simulator.html
  30. 2 0
      doc/_build/html/CBD.solver.html
  31. 188 0
      doc/_build/html/CBD.stepsize.html
  32. 4 2
      doc/_build/html/CBD.util.html
  33. BIN
      doc/_build/html/_images/sine-1.png
  34. BIN
      doc/_build/html/_images/sine-5.png
  35. BIN
      doc/_build/html/_images/sine-euler2.png
  36. BIN
      doc/_build/html/_images/sine.png
  37. 12 2
      doc/_build/html/_modules/CBD/CBD.html
  38. 2 0
      doc/_build/html/_modules/CBD/CBD2LaTeX.html
  39. 2 0
      doc/_build/html/_modules/CBD/CBDDraw.html
  40. 2 0
      doc/_build/html/_modules/CBD/depGraph.html
  41. 20 24
      doc/_build/html/_modules/CBD/lib/endpoints.html
  42. 2 0
      doc/_build/html/_modules/CBD/lib/io.html
  43. 16 0
      doc/_build/html/_modules/CBD/lib/std.html
  44. 2 0
      doc/_build/html/_modules/CBD/naivelog.html
  45. 2 0
      doc/_build/html/_modules/CBD/realtime/accurate_time.html
  46. 2 0
      doc/_build/html/_modules/CBD/realtime/plotting.html
  47. 2 0
      doc/_build/html/_modules/CBD/realtime/threadingBackend.html
  48. 2 0
      doc/_build/html/_modules/CBD/realtime/threadingGameLoop.html
  49. 2 0
      doc/_build/html/_modules/CBD/realtime/threadingPython.html
  50. 2 0
      doc/_build/html/_modules/CBD/realtime/threadingTkInter.html
  51. 2 0
      doc/_build/html/_modules/CBD/scheduling.html
  52. 2 0
      doc/_build/html/_modules/CBD/simulator.html
  53. 2 0
      doc/_build/html/_modules/CBD/solver.html
  54. 239 0
      doc/_build/html/_modules/CBD/stepsize.html
  55. 2 0
      doc/_build/html/_modules/CBD/util.html
  56. 2 0
      doc/_build/html/_modules/index.html
  57. 67 0
      doc/_build/html/_sources/examples/ContinuousTime.rst.txt
  58. 1 0
      doc/_build/html/_sources/index.rst.txt
  59. 2 0
      doc/_build/html/_sources/install.rst.txt
  60. 0 8
      doc/_build/html/_sources/modules.rst.txt
  61. 18 0
      doc/_build/html/_static/math.js
  62. 10 0
      doc/_build/html/_static/style.css
  63. 2 0
      doc/_build/html/changelog.html
  64. 116 72
      doc/_build/html/modules.html
  65. 2 0
      doc/_build/html/examples/Dashboard.html
  66. 2 0
      doc/_build/html/examples/EvenNumberGen.html
  67. 2 0
      doc/_build/html/examples/Fibonacci.html
  68. 4 2
      doc/_build/html/examples/LCG.html
  69. 2 0
      doc/_build/html/examples/LivePlot.html
  70. 4 2
      doc/_build/html/examples/RealTime.html
  71. 2 0
      doc/_build/html/examples/SinGen.html
  72. 35 9
      doc/_build/html/genindex.html
  73. 7 0
      doc/_build/html/index.html
  74. 4 0
      doc/_build/html/install.html
  75. BIN
      doc/_build/html/objects.inv
  76. 2 0
      doc/_build/html/py-modindex.html
  77. 2 0
      doc/_build/html/running.html
  78. 2 0
      doc/_build/html/search.html
  79. 1 1
      doc/_build/html/searchindex.js
  80. BIN
      doc/_figures/stepsize/sine-1.png
  81. BIN
      doc/_figures/stepsize/sine-5.png
  82. BIN
      doc/_figures/stepsize/sine-euler2.png
  83. BIN
      doc/_figures/stepsize/sine.png
  84. 18 0
      doc/_static/math.js
  85. 10 0
      doc/_static/style.css
  86. 7 1
      doc/conf.py
  87. 67 0
      doc/examples/ContinuousTime.rst
  88. 1 0
      doc/index.rst
  89. 2 0
      doc/install.rst
  90. 0 8
      doc/modules.rst
  91. 22 22
      examples/AGV/AGV.py
  92. 7 7
      examples/AGV/AGV_tuning.py
  93. 481 0
      examples/AGV/tuning9.log
  94. 8 0
      src/CBD/CBD.py
  95. 18 24
      src/CBD/lib/endpoints.py
  96. 14 0
      src/CBD/lib/std.py
  97. 237 0
      src/CBD/stepsize.py

+ 2 - 0
.gitignore

@@ -22,3 +22,5 @@ examples/AGV/tuning7/
 examples/AGV/tuning8/
 
 *.npy
+
+examples/AGV/tuning9/

BIN
doc/_build/doctrees/CBD.CBD.doctree


BIN
doc/_build/doctrees/CBD.lib.endpoints.doctree


BIN
doc/_build/doctrees/CBD.stepsize.doctree


BIN
doc/_build/doctrees/environment.pickle


BIN
doc/_build/doctrees/examples/ContinuousTime.doctree


BIN
doc/_build/doctrees/index.doctree


BIN
doc/_build/doctrees/install.doctree


BIN
doc/_build/doctrees/modules.doctree


+ 1 - 1
doc/_build/html/.buildinfo

@@ -1,4 +1,4 @@
 # Sphinx build info version 1
 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: c99a85d23b783a719dcab4bd5dce697a
+config: 5824fcf4e9cfaa0553b53368d21c26b3
 tags: 645f666f9bcd5a90fca523b33c5a78b7

+ 12 - 0
doc/_build/html/CBD.CBD.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -575,6 +576,11 @@ signal.</p>
 </table>
 </dd></dl>
 
+<dl class="attribute">
+<dt id="CBD.CBD.InputPortBlock.parent">
+<code class="descname">parent</code><a class="headerlink" href="#CBD.CBD.InputPortBlock.parent" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
 </dd></dl>
 
 <dl class="class">
@@ -597,6 +603,11 @@ signal.</p>
 </table>
 </dd></dl>
 
+<dl class="attribute">
+<dt id="CBD.CBD.OutputPortBlock.parent">
+<code class="descname">parent</code><a class="headerlink" href="#CBD.CBD.OutputPortBlock.parent" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
 </dd></dl>
 
 <dl class="class">
@@ -905,6 +916,7 @@ signal.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.CBD2LaTeX.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -353,6 +354,7 @@ defined will be ignored in the generation.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.CBDDraw.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -362,6 +363,7 @@ more important.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.depGraph.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -623,6 +624,7 @@ be constructed.</li>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -384,6 +385,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 3 - 1
doc/_build/html/CBD.lib.endpoints.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -326,7 +327,7 @@ interfere/retain information about previous simulations.</p>
 <dl class="attribute">
 <dt id="CBD.lib.endpoints.CollectorBlock.data">
 <code class="descname">data</code><a class="headerlink" href="#CBD.lib.endpoints.CollectorBlock.data" title="Permalink to this definition">¶</a></dt>
-<dd><p>Property to obtain the internal data in a thread-safe manner.</p>
+<dd><p>Property to obtain the internal data.</p>
 </dd></dl>
 
 </dd></dl>
@@ -605,6 +606,7 @@ remain valid.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.lib.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -350,6 +351,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.lib.io.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -528,6 +529,7 @@ signal.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.lib.std.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -894,6 +895,7 @@ The block is implemented according to the trapezoid rule.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.naivelog.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -679,6 +680,7 @@ exist.</li>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.realtime.accurate_time.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -361,6 +362,7 @@ platform.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.realtime.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -353,6 +354,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.realtime.plotting.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -1224,6 +1225,7 @@ constructor.</li>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.realtime.threadingBackend.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -519,6 +520,7 @@ gameloop backend is used.</td>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.realtime.threadingGameLoop.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -377,6 +378,7 @@ Time will only progress when a <a class="reference internal" href="#CBD.realtime
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.realtime.threadingPython.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -390,6 +391,7 @@ used and no return values are needed.</li>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.realtime.threadingTkInter.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -394,6 +395,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.scheduling.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -579,6 +580,7 @@ topological order.</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.simulator.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -954,6 +955,7 @@ but before the actual simulation begins.</li>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/CBD.solver.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -487,6 +488,7 @@ required dependencies for external hardware systems (that may not provide these
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 188 - 0
doc/_build/html/CBD.stepsize.html


+ 4 - 2
doc/_build/html/CBD.util.html

@@ -183,8 +183,8 @@
             
             
               <p class="caption"><span class="caption-text">Setup</span></p>
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="install.html">How to install the CBD framework?</a></li>
+<ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="install.html">How to install the CBD framework?</a></li>
 <li class="toctree-l1"><a class="reference internal" href="running.html">How to run a CBD simulation?</a></li>
 <li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
 </ul>
@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -349,6 +350,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

BIN
doc/_build/html/_images/sine-1.png


BIN
doc/_build/html/_images/sine-5.png


BIN
doc/_build/html/_images/sine-euler2.png


BIN
doc/_build/html/_images/sine.png


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 12 - 2
doc/_build/html/_modules/CBD/CBD.html


+ 2 - 0
doc/_build/html/_modules/CBD/CBD2LaTeX.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -423,6 +424,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/CBDDraw.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -389,6 +390,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/depGraph.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -653,6 +654,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 20 - 24
doc/_build/html/_modules/CBD/lib/endpoints.html


+ 2 - 0
doc/_build/html/_modules/CBD/lib/io.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -564,6 +565,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 16 - 0
doc/_build/html/_modules/CBD/lib/std.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -591,6 +592,20 @@
 		<span class="bp">self</span><span class="o">.</span><span class="n">appendToSignal</span><span class="p">(</span><span class="n">time</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">getClock</span><span class="p">()</span><span class="o">.</span><span class="n">getStartTime</span><span class="p">(),</span> <span class="s2">&quot;relative&quot;</span><span class="p">)</span></div></div>
 
 
+<span class="k">class</span> <span class="nc">DeltaTBlock</span><span class="p">(</span><span class="n">BaseBlock</span><span class="p">):</span>
+	<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">	Outputs the current time delta of the simulation.</span>
+
+<span class="sd">	This will be a constant for Fixed step sizes, but for variable step sizes,</span>
+<span class="sd">	the output will vary.</span>
+<span class="sd">	&quot;&quot;&quot;</span>
+	<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">block_name</span><span class="p">):</span>
+		<span class="n">BaseBlock</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">block_name</span><span class="p">,</span> <span class="p">[],</span> <span class="p">[</span><span class="s2">&quot;OUT1&quot;</span><span class="p">])</span>
+
+	<span class="k">def</span> <span class="nf">compute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">curIteration</span><span class="p">):</span>
+		<span class="bp">self</span><span class="o">.</span><span class="n">appendToSignal</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">getClock</span><span class="p">()</span><span class="o">.</span><span class="n">getDeltaT</span><span class="p">(),</span> <span class="s2">&quot;OUT1&quot;</span><span class="p">)</span>
+
+
 <div class="viewcode-block" id="LoggingBlock"><a class="viewcode-back" href="../../../CBD.lib.std.html#CBD.lib.std.LoggingBlock">[docs]</a><span class="k">class</span> <span class="nc">LoggingBlock</span><span class="p">(</span><span class="n">BaseBlock</span><span class="p">):</span>
 	<span class="sd">&quot;&quot;&quot;</span>
 <span class="sd">	A simple Logging block</span>
@@ -777,6 +792,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/naivelog.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -603,6 +604,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/realtime/accurate_time.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -344,6 +345,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/realtime/plotting.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -1199,6 +1200,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/realtime/threadingBackend.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -489,6 +490,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/realtime/threadingGameLoop.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -374,6 +375,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/realtime/threadingPython.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -381,6 +382,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/realtime/threadingTkInter.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -405,6 +406,7 @@
          <script type="text/javascript" src="../../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/scheduling.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -528,6 +529,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/simulator.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -1100,6 +1101,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/CBD/solver.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -580,6 +581,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 239 - 0
doc/_build/html/_modules/CBD/stepsize.html


+ 2 - 0
doc/_build/html/_modules/CBD/util.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -329,6 +330,7 @@
          <script type="text/javascript" src="../../_static/underscore.js"></script>
          <script type="text/javascript" src="../../_static/doctools.js"></script>
          <script type="text/javascript" src="../../_static/language_data.js"></script>
+         <script type="text/javascript" src="../../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/_modules/index.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -336,6 +337,7 @@
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 67 - 0
doc/_build/html/_sources/examples/ContinuousTime.rst.txt

@@ -0,0 +1,67 @@
+Continuous Time Simulation
+==========================
+Given that continuous time simulation will always have to be discretized when
+executed, it is important to ask *how* this discretization happens. In the
+:doc:`SinGen` example, this was done by reducing the delta inbetween multiple
+steps. However, this may compute too often for what is required in a given
+simulation. Assume we have the following data (from a sine wave):
+
+.. figure:: ../_figures/stepsize/sine.png
+   :width: 600
+
+Fixed Step Size
+---------------
+With the previously discussed technique, the data could be plot using a fixed
+step size, where the new data is being computed every :code:`dt` time. The
+smaller this :code:`dt` value is, the more precise the plot. Below, the same
+function has been plot twice, for :code:`dt = 0.5` and :code:`dt = 0.1`, where
+the marked points on the plot highlight *when* the data has been recomputed. It
+is clear from these plots that a smaller step size identifies more accurate
+results.
+
+.. figure:: ../_figures/stepsize/sine-5.png
+   :width: 600
+
+.. figure:: ../_figures/stepsize/sine-1.png
+   :width: 600
+
+This behaviour is the default in the simulator. To explicitly set it, make use of
+the :class:`CBD.stepsize.Fixed` class as follows (assuming :code:`sim` is the
+simulator object):
+
+.. code-block:: python
+
+   sim.setStepSize(Fixed(0.5))
+   #  OR, EQUIVALENTLY
+   sim.setStepSize(0.5)
+
+Yet, when the step size logic has been untouched since the creation of the
+simulator instance, the normal :func:`CBD.simulator.Simulator.setDeltaT` can be
+used as well.
+This was done for academic reasons, as it is much easier to explain CBDs with a
+fixed step size, as compared to varying step sizes.
+
+Euler 2-Step
+------------
+Variable step size algorithms continuously increases or decreases the :code:`dt`
+to allow for less steps to be taken. Whenever the simulation fluctuates a lot,
+:code:`dt` will be small. However, if there are only small changes, it will be
+large.
+
+The `Euler 2-Step` does this by (approximately) halving/doubling the current
+:code:`dt`, trying to get the best match for the given data. More information on
+the actual algorithm can be found in the documentation for
+:class:`CBD.stepsize.Euler2` and `professor Joel Feldman's notes on variable step
+size algorithms <http://www.math.ubc.ca/~feldman/math/vble.pdf>`_.
+It can be set on the simulator object as follows:
+
+.. code-block:: python
+
+   sim.setStepSize(Euler2(0.1, 0.005))
+
+For the sine wave example, with any starting delta and an acceptance error epsilon
+of :code:`0.005`, the following plot is obtained. Note that a decrease of the
+epsilon will make the plot more precise.
+
+.. figure:: ../_figures/stepsize/sine-euler2.png
+   :width: 600

+ 1 - 0
doc/_build/html/_sources/index.rst.txt

@@ -50,6 +50,7 @@ to model complex systems of equations.
     :maxdepth: 2
     :caption: Advanced Examples
 
+    examples/ContinuousTime
     examples/RealTime
     examples/LivePlot
     examples/Dashboard

+ 2 - 0
doc/_build/html/_sources/install.rst.txt

@@ -20,6 +20,8 @@ Next, there are some additional optional requirements:
 * `Seaborn <https://seaborn.pydata.org/>`_ for plotting data using Seaborn.
 * `Bokeh <https://docs.bokeh.org/en/latest/index.html>`_ for plotting data in Bokeh.
 * `Catalyst Sphynx Theme <https://pypi.org/project/catalyst-sphinx-theme/>`_ for creating the docs.
+* `Latex Preview Package <https://www.gnu.org/software/auctex/preview-latex.html>`_ for creating the docs
+  (Ubuntu xenial: :code:`preview-latex-style`).
 
 Installation
 ------------

+ 0 - 8
doc/_build/html/_sources/modules.rst.txt

@@ -1,8 +0,0 @@
-CBD
-===
-
-.. toctree::
-   :maxdepth: 4
-
-   CBD
-   CBD.util

+ 18 - 0
doc/_build/html/_static/math.js

@@ -0,0 +1,18 @@
+$(document).ready(function() {
+    setMathJax();
+});
+
+function setMathJax() {
+    if(window.MathJax === undefined) {
+        setTimeout(setMathJax, 500);
+        return;
+    }
+    window.MathJax.Hub.Queue(function () {
+        $(".MathJax").css('padding', '1%');
+        $(".MathJax .math").css('width', '');
+        $(".MathJax .math > span").css('width', '');
+        $(":not(.MathJax_Display) > .MathJax .math > span").css('font-size', '');
+        $(".MathJax .math > span > span").css('position', '');
+        $(".MathJax .math > span > span > span").css('height', '');
+    });
+}

+ 10 - 0
doc/_build/html/_static/style.css

@@ -71,6 +71,12 @@ article.catalyst-article .class table tbody tr td.field-body p {
 	margin-right: auto;
 }
 
+div.math > p > img {
+	display: inline-block;
+	margin-left: unset;
+	margin-right: unset;
+}
+
 .figure {
 	display: unset !important;
 }
@@ -78,3 +84,7 @@ article.catalyst-article .class table tbody tr td.field-body p {
 article.catalyst-article .class dl dt em.property {
 	padding-right: 12px !important;
 }
+
+:not(.MathJax_Display) > .MathJax {
+	font-size: 110% !important;
+}

+ 2 - 0
doc/_build/html/changelog.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -354,6 +355,7 @@ Version 1.0
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 116 - 72
doc/_build/html/modules.html

@@ -9,7 +9,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>CBD &mdash; CBD Simulator  documentation</title>
+  <title>Continuous Time Simulation &mdash; CBD Simulator  documentation</title>
   
 
   
@@ -25,26 +25,28 @@
 
   
 
-  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
-  <!-- <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> -->
-  <link rel="stylesheet" href="_static/style.css" type="text/css" />
-    <link rel="index" title="Index" href="genindex.html" />
-    <link rel="search" title="Search" href="search.html" /> 
+  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
+  <!-- <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> -->
+  <link rel="stylesheet" href="../_static/style.css" type="text/css" />
+    <link rel="index" title="Index" href="../genindex.html" />
+    <link rel="search" title="Search" href="../search.html" />
+    <link rel="next" title="Realtime Simulation" href="RealTime.html" />
+    <link rel="prev" title="Linear Congruential Generator" href="LCG.html" /> 
 
   
   <script async src="https://www.googletagmanager.com/gtag/js?id=UA-167094275-1"></script>
-  <script src="_static/js/googleanalytics.min.js"></script>
+  <script src="../_static/js/googleanalytics.min.js"></script>
   
-  <script src="_static/js/modernizr.min.js"></script>
+  <script src="../_static/js/modernizr.min.js"></script>
 
   <!-- Preload the theme fonts -->
 
-<link rel="preload" href="_static/fonts/FreightSans/freight-sans-book.woff2" as="font" type="font/woff2" crossorigin="anonymous">
-<link rel="preload" href="_static/fonts/FreightSans/freight-sans-medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
-<link rel="preload" href="_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
-<link rel="preload" href="_static/fonts/FreightSans/freight-sans-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
-<link rel="preload" href="_static/fonts/FreightSans/freight-sans-medium-italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
-<link rel="preload" href="_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
+<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-book.woff2" as="font" type="font/woff2" crossorigin="anonymous">
+<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
+<link rel="preload" href="../_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
+<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
+<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-medium-italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
+<link rel="preload" href="../_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
 
 <!-- Preload the katex fonts -->
 
@@ -164,7 +166,7 @@
 
 
 <div role="search">
-  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
+  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
     <input type="text" name="q" placeholder="Search Docs" />
     <input type="hidden" name="check_keywords" value="yes" />
     <input type="hidden" name="area" value="default" />
@@ -182,26 +184,27 @@
             
               <p class="caption"><span class="caption-text">Setup</span></p>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="install.html">How to install the CBD framework?</a></li>
-<li class="toctree-l1"><a class="reference internal" href="running.html">How to run a CBD simulation?</a></li>
-<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install.html">How to install the CBD framework?</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../running.html">How to run a CBD simulation?</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
 </ul>
 <p class="caption"><span class="caption-text">Simple Examples</span></p>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="examples/SinGen.html">Sine Generator</a></li>
-<li class="toctree-l1"><a class="reference internal" href="examples/EvenNumberGen.html">Hierarchical Even Number Generator</a></li>
-<li class="toctree-l1"><a class="reference internal" href="examples/Fibonacci.html">Fibonacci Sequence Generator</a></li>
-<li class="toctree-l1"><a class="reference internal" href="examples/LCG.html">Linear Congruential Generator</a></li>
+<li class="toctree-l1"><a class="reference internal" href="SinGen.html">Sine Generator</a></li>
+<li class="toctree-l1"><a class="reference internal" href="EvenNumberGen.html">Hierarchical Even Number Generator</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Fibonacci.html">Fibonacci Sequence Generator</a></li>
+<li class="toctree-l1"><a class="reference internal" href="LCG.html">Linear Congruential Generator</a></li>
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
-<li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
-<li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
+<ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Continuous Time Simulation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="RealTime.html">Realtime Simulation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="LivePlot.html">Live Plotting of Data During the Simulation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Dashboard.html">TkInter Dashboard with Editable Values</a></li>
 </ul>
 <p class="caption"><span class="caption-text">Internal Documentation</span></p>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CBD.html">CBD package</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../CBD.html">CBD package</a></li>
 </ul>
 
             
@@ -234,7 +237,7 @@
   <ul class="catalyst-breadcrumbs">
     
       <li>
-        <a href="index.html">
+        <a href="../index.html">
           
             Docs
           
@@ -242,7 +245,7 @@
       </li>
 
         
-      <li>CBD</li>
+      <li>Continuous Time Simulation</li>
     
     
       <li class="catalyst-breadcrumbs-aside">
@@ -270,39 +273,66 @@
             <div role="main" class="main-content" itemscope="itemscope" itemtype="http://schema.org/Article">
              <article itemprop="articleBody" id="catalyst-article" class="catalyst-article">
               
-  <div class="section" id="cbd">
-<h1>CBD<a class="headerlink" href="#cbd" title="Permalink to this headline">¶</a></h1>
-<div class="toctree-wrapper compound">
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="CBD.html">CBD package</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="CBD.html#subpackages">Subpackages</a><ul>
-<li class="toctree-l3"><a class="reference internal" href="CBD.lib.html">Standard CBD Library (BBL)</a><ul>
-<li class="toctree-l4"><a class="reference internal" href="CBD.lib.html#submodules">Submodules</a></li>
-</ul>
-</li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.realtime.html">CBD.realtime package</a><ul>
-<li class="toctree-l4"><a class="reference internal" href="CBD.realtime.html#submodules">Submodules</a></li>
-</ul>
-</li>
-</ul>
-</li>
-<li class="toctree-l2"><a class="reference internal" href="CBD.html#submodules">Submodules</a><ul>
-<li class="toctree-l3"><a class="reference internal" href="CBD.CBD.html">CBD.CBD module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.CBD2LaTeX.html">CBD.CBD2LaTeX module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.CBDDraw.html">CBD.CBDDraw module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.depGraph.html">CBD.depGraph module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.naivelog.html">CBD.naivelog module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.scheduling.html">CBD.scheduling module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.simulator.html">CBD.simulator module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.solver.html">CBD.solver module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.stepsize.html">CBD.stepsize module</a></li>
-<li class="toctree-l3"><a class="reference internal" href="CBD.util.html">CBD.util module</a></li>
-</ul>
-</li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="CBD.util.html">CBD.util module</a></li>
-</ul>
+  <div class="section" id="continuous-time-simulation">
+<h1>Continuous Time Simulation<a class="headerlink" href="#continuous-time-simulation" title="Permalink to this headline">¶</a></h1>
+<p>Given that continuous time simulation will always have to be discretized when
+executed, it is important to ask <em>how</em> this discretization happens. In the
+<a class="reference internal" href="SinGen.html"><span class="doc">Sine Generator</span></a> example, this was done by reducing the delta inbetween multiple
+steps. However, this may compute too often for what is required in a given
+simulation. Assume we have the following data (from a sine wave):</p>
+<div class="figure">
+<a class="reference internal image-reference" href="../_images/sine.png"><img alt="../_images/sine.png" src="../_images/sine.png" style="width: 600px;" /></a>
+</div>
+<div class="section" id="fixed-step-size">
+<h2>Fixed Step Size<a class="headerlink" href="#fixed-step-size" title="Permalink to this headline">¶</a></h2>
+<p>With the previously discussed technique, the data could be plot using a fixed
+step size, where the new data is being computed every <code class="code docutils literal notranslate"><span class="pre">dt</span></code> time. The
+smaller this <code class="code docutils literal notranslate"><span class="pre">dt</span></code> value is, the more precise the plot. Below, the same
+function has been plot twice, for <code class="code docutils literal notranslate"><span class="pre">dt</span> <span class="pre">=</span> <span class="pre">0.5</span></code> and <code class="code docutils literal notranslate"><span class="pre">dt</span> <span class="pre">=</span> <span class="pre">0.1</span></code>, where
+the marked points on the plot highlight <em>when</em> the data has been recomputed. It
+is clear from these plots that a smaller step size identifies more accurate
+results.</p>
+<div class="figure">
+<a class="reference internal image-reference" href="../_images/sine-5.png"><img alt="../_images/sine-5.png" src="../_images/sine-5.png" style="width: 600px;" /></a>
+</div>
+<div class="figure">
+<a class="reference internal image-reference" href="../_images/sine-1.png"><img alt="../_images/sine-1.png" src="../_images/sine-1.png" style="width: 600px;" /></a>
+</div>
+<p>This behaviour is the default in the simulator. To explicitly set it, make use of
+the <a class="reference internal" href="../CBD.stepsize.html#CBD.stepsize.Fixed" title="CBD.stepsize.Fixed"><code class="xref py py-class docutils literal notranslate"><span class="pre">CBD.stepsize.Fixed</span></code></a> class as follows (assuming <code class="code docutils literal notranslate"><span class="pre">sim</span></code> is the
+simulator object):</p>
+<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">sim</span><span class="o">.</span><span class="n">setStepSize</span><span class="p">(</span><span class="n">Fixed</span><span class="p">(</span><span class="mf">0.5</span><span class="p">))</span>
+<span class="c1">#  OR, EQUIVALENTLY</span>
+<span class="n">sim</span><span class="o">.</span><span class="n">setStepSize</span><span class="p">(</span><span class="mf">0.5</span><span class="p">)</span>
+</pre></div>
+</div>
+<p>Yet, when the step size logic has been untouched since the creation of the
+simulator instance, the normal <a class="reference internal" href="../CBD.simulator.html#CBD.simulator.Simulator.setDeltaT" title="CBD.simulator.Simulator.setDeltaT"><code class="xref py py-func docutils literal notranslate"><span class="pre">CBD.simulator.Simulator.setDeltaT()</span></code></a> can be
+used as well.
+This was done for academic reasons, as it is much easier to explain CBDs with a
+fixed step size, as compared to varying step sizes.</p>
+</div>
+<div class="section" id="euler-2-step">
+<h2>Euler 2-Step<a class="headerlink" href="#euler-2-step" title="Permalink to this headline">¶</a></h2>
+<p>Variable step size algorithms continuously increases or decreases the <code class="code docutils literal notranslate"><span class="pre">dt</span></code>
+to allow for less steps to be taken. Whenever the simulation fluctuates a lot,
+<code class="code docutils literal notranslate"><span class="pre">dt</span></code> will be small. However, if there are only small changes, it will be
+large.</p>
+<p>The <cite>Euler 2-Step</cite> does this by (approximately) halving/doubling the current
+<code class="code docutils literal notranslate"><span class="pre">dt</span></code>, trying to get the best match for the given data. More information on
+the actual algorithm can be found in the documentation for
+<a class="reference internal" href="../CBD.stepsize.html#CBD.stepsize.Euler2" title="CBD.stepsize.Euler2"><code class="xref py py-class docutils literal notranslate"><span class="pre">CBD.stepsize.Euler2</span></code></a> and <a class="reference external" href="http://www.math.ubc.ca/~feldman/math/vble.pdf">professor Joel Feldman’s notes on variable step
+size algorithms</a>.
+It can be set on the simulator object as follows:</p>
+<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">sim</span><span class="o">.</span><span class="n">setStepSize</span><span class="p">(</span><span class="n">Euler2</span><span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.005</span><span class="p">))</span>
+</pre></div>
+</div>
+<p>For the sine wave example, with any starting delta and an acceptance error epsilon
+of <code class="code docutils literal notranslate"><span class="pre">0.005</span></code>, the following plot is obtained. Note that a decrease of the
+epsilon will make the plot more precise.</p>
+<div class="figure">
+<a class="reference internal image-reference" href="../_images/sine-euler2.png"><img alt="../_images/sine-euler2.png" src="../_images/sine-euler2.png" style="width: 600px;" /></a>
+</div>
 </div>
 </div>
 
@@ -312,6 +342,15 @@
             </div>
             <footer>
   
+    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
+      
+        <a href="RealTime.html" class="btn btn-neutral float-right" title="Realtime Simulation" accesskey="n" rel="next">Next <img src="../_static/images/chevron-right-orange.svg" class="next-page"></a>
+      
+      
+        <a href="LCG.html" class="btn btn-neutral" title="Linear Congruential Generator" accesskey="p" rel="prev"><img src="../_static/images/chevron-right-orange.svg" class="previous-page"> Previous</a>
+      
+    </div>
+  
 
   <hr>
 
@@ -336,7 +375,11 @@
           <div class="catalyst-right-menu" id="catalyst-right-menu">
             <div class="catalyst-side-scroll" id="catalyst-side-scroll-right">
               <ul>
-<li><a class="reference internal" href="#">CBD</a></li>
+<li><a class="reference internal" href="#">Continuous Time Simulation</a><ul>
+<li><a class="reference internal" href="#fixed-step-size">Fixed Step Size</a></li>
+<li><a class="reference internal" href="#euler-2-step">Euler 2-Step</a></li>
+</ul>
+</li>
 </ul>
 
             </div>
@@ -351,19 +394,20 @@
   
 
      
-       <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
-         <script type="text/javascript" src="_static/jquery.js"></script>
-         <script type="text/javascript" src="_static/underscore.js"></script>
-         <script type="text/javascript" src="_static/doctools.js"></script>
-         <script type="text/javascript" src="_static/language_data.js"></script>
+       <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+         <script type="text/javascript" src="../_static/jquery.js"></script>
+         <script type="text/javascript" src="../_static/underscore.js"></script>
+         <script type="text/javascript" src="../_static/doctools.js"></script>
+         <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 
   
 
-  <script type="text/javascript" src="_static/js/vendor/popper.min.js"></script>
-  <script type="text/javascript" src="_static/js/vendor/bootstrap.min.js"></script>
-  <script type="text/javascript" src="_static/js/theme.js"></script>
+  <script type="text/javascript" src="../_static/js/vendor/popper.min.js"></script>
+  <script type="text/javascript" src="../_static/js/vendor/bootstrap.min.js"></script>
+  <script type="text/javascript" src="../_static/js/theme.js"></script>
 
   <script type="text/javascript">
       jQuery(function () {
@@ -453,7 +497,7 @@
 
   <!-- End Mobile Menu -->
 
-  <script type="text/javascript" src="_static/js/vendor/anchor.min.js"></script>
+  <script type="text/javascript" src="../_static/js/vendor/anchor.min.js"></script>
 
   <script type="text/javascript">
     $(document).ready(function() {

+ 2 - 0
doc/_build/html/examples/Dashboard.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1 current"><a class="current reference internal" href="#">TkInter Dashboard with Editable Values</a></li>
@@ -460,6 +461,7 @@ when not changing the values, the plot will show the requested results.</p>
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/examples/EvenNumberGen.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -382,6 +383,7 @@ multiplies its input with 2:</p>
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/examples/Fibonacci.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -424,6 +425,7 @@ delay2.IC &amp;= 1\end{split}\]</div>
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 4 - 2
doc/_build/html/examples/LCG.html

@@ -30,7 +30,7 @@
   <link rel="stylesheet" href="../_static/style.css" type="text/css" />
     <link rel="index" title="Index" href="../genindex.html" />
     <link rel="search" title="Search" href="../search.html" />
-    <link rel="next" title="Realtime Simulation" href="RealTime.html" />
+    <link rel="next" title="Continuous Time Simulation" href="ContinuousTime.html" />
     <link rel="prev" title="Fibonacci Sequence Generator" href="Fibonacci.html" /> 
 
   
@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -347,7 +348,7 @@ duplicate value.</p>
   
     <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
       
-        <a href="RealTime.html" class="btn btn-neutral float-right" title="Realtime Simulation" accesskey="n" rel="next">Next <img src="../_static/images/chevron-right-orange.svg" class="next-page"></a>
+        <a href="ContinuousTime.html" class="btn btn-neutral float-right" title="Continuous Time Simulation" accesskey="n" rel="next">Next <img src="../_static/images/chevron-right-orange.svg" class="next-page"></a>
       
       
         <a href="Fibonacci.html" class="btn btn-neutral" title="Fibonacci Sequence Generator" accesskey="p" rel="prev"><img src="../_static/images/chevron-right-orange.svg" class="previous-page"> Previous</a>
@@ -401,6 +402,7 @@ duplicate value.</p>
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/examples/LivePlot.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1 current"><a class="current reference internal" href="#">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -564,6 +565,7 @@ for this problem.</p>
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 4 - 2
doc/_build/html/examples/RealTime.html

@@ -31,7 +31,7 @@
     <link rel="index" title="Index" href="../genindex.html" />
     <link rel="search" title="Search" href="../search.html" />
     <link rel="next" title="Live Plotting of Data During the Simulation" href="LivePlot.html" />
-    <link rel="prev" title="Linear Congruential Generator" href="LCG.html" /> 
+    <link rel="prev" title="Continuous Time Simulation" href="ContinuousTime.html" /> 
 
   
   <script async src="https://www.googletagmanager.com/gtag/js?id=UA-167094275-1"></script>
@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1 current"><a class="current reference internal" href="#">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -432,7 +433,7 @@ simulation can advance to the next timestep.</p>
         <a href="LivePlot.html" class="btn btn-neutral float-right" title="Live Plotting of Data During the Simulation" accesskey="n" rel="next">Next <img src="../_static/images/chevron-right-orange.svg" class="next-page"></a>
       
       
-        <a href="LCG.html" class="btn btn-neutral" title="Linear Congruential Generator" accesskey="p" rel="prev"><img src="../_static/images/chevron-right-orange.svg" class="previous-page"> Previous</a>
+        <a href="ContinuousTime.html" class="btn btn-neutral" title="Continuous Time Simulation" accesskey="p" rel="prev"><img src="../_static/images/chevron-right-orange.svg" class="previous-page"> Previous</a>
       
     </div>
   
@@ -486,6 +487,7 @@ simulation can advance to the next timestep.</p>
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/examples/SinGen.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -414,6 +415,7 @@ only computes at 0, 1, 2, 3… seconds, but not in-between. Let’s change that.
          <script type="text/javascript" src="../_static/underscore.js"></script>
          <script type="text/javascript" src="../_static/doctools.js"></script>
          <script type="text/javascript" src="../_static/language_data.js"></script>
+         <script type="text/javascript" src="../_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 35 - 9
doc/_build/html/genindex.html

@@ -196,6 +196,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -309,10 +310,14 @@
       <li><a href="CBD.lib.std.html#CBD.lib.std.AdderBlock">AdderBlock (class in CBD.lib.std)</a>
 </li>
       <li><a href="CBD.depGraph.html#CBD.depGraph.DepGraph.addMember">addMember() (CBD.depGraph.DepGraph method)</a>
+</li>
+      <li><a href="CBD.lib.std.html#CBD.lib.std.AddOneBlock">AddOneBlock (class in CBD.lib.std)</a>
 </li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
-      <li><a href="CBD.lib.std.html#CBD.lib.std.AddOneBlock">AddOneBlock (class in CBD.lib.std)</a>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.ButcherTableau.addRow">addRow() (CBD.stepsize.ButcherTableau method)</a>
+</li>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.ButcherTableau.addWeights">addWeights() (CBD.stepsize.ButcherTableau method)</a>
 </li>
       <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.PlotManager.all_opened">all_opened() (CBD.realtime.plotting.PlotManager method)</a>
 </li>
@@ -332,13 +337,15 @@
 </li>
       <li><a href="CBD.CBD.html#CBD.CBD.BaseBlock">BaseBlock (class in CBD.CBD)</a>
 </li>
-  </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.bkh">bkh() (in module CBD.realtime.plotting)</a>
 </li>
+  </ul></td>
+  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="CBD.CBD.html#CBD.CBD.InputLink.block">block (CBD.CBD.InputLink attribute)</a>
 </li>
       <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.Backend.BOKEH">BOKEH (CBD.realtime.plotting.Backend attribute)</a>
+</li>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.ButcherTableau">ButcherTableau (class in CBD.stepsize)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -553,6 +560,8 @@
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="CBD.depGraph.html#CBD.depGraph.DepNode">DepNode (class in CBD.depGraph)</a>
+</li>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.RungeKutta.derivative">derivative() (CBD.stepsize.RungeKutta method)</a>
 </li>
       <li><a href="CBD.lib.std.html#CBD.lib.std.DerivatorBlock">DerivatorBlock (class in CBD.lib.std)</a>
 </li>
@@ -582,13 +591,15 @@
 </li>
       <li><a href="CBD.naivelog.html#CBD.naivelog.ERROR">ERROR (in module CBD.naivelog)</a>
 </li>
-  </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="CBD.naivelog.html#CBD.naivelog.Logger.error">error() (CBD.naivelog.Logger method)</a>
 </li>
+  </ul></td>
+  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="CBD.stepsize.html#CBD.stepsize.Euler2">Euler2 (class in CBD.stepsize)</a>
 </li>
       <li><a href="CBD.stepsize.html#CBD.stepsize.Euler2Alt">Euler2Alt (class in CBD.stepsize)</a>
+</li>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.ButcherTableau.EulerHeun">EulerHeun() (CBD.stepsize.ButcherTableau static method)</a>
 </li>
       <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.Backend.exists">exists() (CBD.realtime.plotting.Backend static method)</a>
 </li>
@@ -686,12 +697,12 @@
 </li>
       <li><a href="CBD.CBD.html#CBD.CBD.BaseBlock.getInputName">getInputName() (CBD.CBD.BaseBlock method)</a>
 </li>
-  </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="CBD.CBD.html#CBD.CBD.BaseBlock.getInputSignal">getInputSignal() (CBD.CBD.BaseBlock method)</a>
 </li>
       <li><a href="CBD.realtime.threadingBackend.html#CBD.realtime.threadingBackend.ThreadingBackend.getInterrupt">getInterrupt() (CBD.realtime.threadingBackend.ThreadingBackend method)</a>
 </li>
+  </ul></td>
+  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="CBD.CBD.html#CBD.CBD.BaseBlock.getLinksIn">getLinksIn() (CBD.CBD.BaseBlock method)</a>
 </li>
       <li><a href="CBD.naivelog.html#CBD.naivelog.getLogger">getLogger() (in module CBD.naivelog)</a>
@@ -708,10 +719,14 @@
         <li><a href="CBD.stepsize.html#CBD.stepsize.Euler2Alt.getNextStepSize">(CBD.stepsize.Euler2Alt method)</a>
 </li>
         <li><a href="CBD.stepsize.html#CBD.stepsize.Fixed.getNextStepSize">(CBD.stepsize.Fixed method)</a>
+</li>
+        <li><a href="CBD.stepsize.html#CBD.stepsize.RungeKutta.getNextStepSize">(CBD.stepsize.RungeKutta method)</a>
 </li>
         <li><a href="CBD.stepsize.html#CBD.stepsize.StepSize.getNextStepSize">(CBD.stepsize.StepSize method)</a>
 </li>
       </ul></li>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.ButcherTableau.getNodes">getNodes() (CBD.stepsize.ButcherTableau method)</a>
+</li>
       <li><a href="CBD.lib.std.html#CBD.lib.std.AndBlock.getNumberOfInputs">getNumberOfInputs() (CBD.lib.std.AndBlock method)</a>
 
       <ul>
@@ -749,6 +764,8 @@
       <li><a href="CBD.CBD.html#CBD.CBD.CBD.getTopCBD">getTopCBD() (CBD.CBD.CBD method)</a>
 </li>
       <li><a href="CBD.lib.std.html#CBD.lib.std.ConstantBlock.getValue">getValue() (CBD.lib.std.ConstantBlock method)</a>
+</li>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.ButcherTableau.getWeights">getWeights() (CBD.stepsize.ButcherTableau method)</a>
 </li>
       <li><a href="CBD.realtime.threadingBackend.html#CBD.realtime.threadingBackend.Platform.GLA">GLA (CBD.realtime.threadingBackend.Platform attribute)</a>
 </li>
@@ -924,16 +941,22 @@
 <h2 id="P">P</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%; vertical-align: top;"><ul>
+      <li><a href="CBD.CBD.html#CBD.CBD.InputPortBlock.parent">parent (CBD.CBD.InputPortBlock attribute)</a>
+
+      <ul>
+        <li><a href="CBD.CBD.html#CBD.CBD.OutputPortBlock.parent">(CBD.CBD.OutputPortBlock attribute)</a>
+</li>
+      </ul></li>
       <li><a href="CBD.realtime.threadingBackend.html#CBD.realtime.threadingBackend.Platform">Platform (class in CBD.realtime.threadingBackend)</a>
 </li>
       <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.PlotHandler">PlotHandler (class in CBD.realtime.plotting)</a>
 </li>
       <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.PlotKind">PlotKind (class in CBD.realtime.plotting)</a>
-</li>
-      <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.PlotManager">PlotManager (class in CBD.realtime.plotting)</a>
 </li>
   </ul></td>
   <td style="width: 33%; vertical-align: top;"><ul>
+      <li><a href="CBD.realtime.plotting.html#CBD.realtime.plotting.PlotManager">PlotManager (class in CBD.realtime.plotting)</a>
+</li>
       <li><a href="CBD.lib.endpoints.html#CBD.lib.endpoints.PositionCollectorBlock">PositionCollectorBlock (class in CBD.lib.endpoints)</a>
 </li>
       <li><a href="CBD.lib.std.html#CBD.lib.std.ProductBlock">ProductBlock (class in CBD.lib.std)</a>
@@ -965,6 +988,8 @@
       <li><a href="CBD.lib.std.html#CBD.lib.std.RootBlock">RootBlock (class in CBD.lib.std)</a>
 </li>
       <li><a href="CBD.simulator.html#CBD.simulator.Simulator.run">run() (CBD.simulator.Simulator method)</a>
+</li>
+      <li><a href="CBD.stepsize.html#CBD.stepsize.RungeKutta">RungeKutta (class in CBD.stepsize)</a>
 </li>
   </ul></td>
 </tr></table>
@@ -1265,6 +1290,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 7 - 0
doc/_build/html/index.html

@@ -196,6 +196,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -331,6 +332,11 @@ models in this framework, take a look at
 <div class="toctree-wrapper compound">
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="examples/ContinuousTime.html#fixed-step-size">Fixed Step Size</a></li>
+<li class="toctree-l2"><a class="reference internal" href="examples/ContinuousTime.html#euler-2-step">Euler 2-Step</a></li>
+</ul>
+</li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="examples/RealTime.html#example-model">Example Model</a></li>
 <li class="toctree-l2"><a class="reference internal" href="examples/RealTime.html#python-threading-backend">Python Threading Backend</a></li>
@@ -438,6 +444,7 @@ models in this framework, take a look at
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 4 - 0
doc/_build/html/install.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -293,6 +294,8 @@ using the <code class="code docutils literal notranslate"><span class="pre">Tk</
 <li><a class="reference external" href="https://seaborn.pydata.org/">Seaborn</a> for plotting data using Seaborn.</li>
 <li><a class="reference external" href="https://docs.bokeh.org/en/latest/index.html">Bokeh</a> for plotting data in Bokeh.</li>
 <li><a class="reference external" href="https://pypi.org/project/catalyst-sphinx-theme/">Catalyst Sphynx Theme</a> for creating the docs.</li>
+<li><a class="reference external" href="https://www.gnu.org/software/auctex/preview-latex.html">Latex Preview Package</a> for creating the docs
+(Ubuntu xenial: <code class="code docutils literal notranslate"><span class="pre">preview-latex-style</span></code>).</li>
 </ul>
 </div>
 <div class="section" id="installation">
@@ -409,6 +412,7 @@ the framework, but can technically be used without the connection to CBDs. These
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

BIN
doc/_build/html/objects.inv


+ 2 - 0
doc/_build/html/py-modindex.html

@@ -198,6 +198,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -442,6 +443,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/running.html

@@ -197,6 +197,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -372,6 +373,7 @@ be executed from the root folder with:</p>
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
      
 

+ 2 - 0
doc/_build/html/search.html

@@ -195,6 +195,7 @@
 </ul>
 <p class="caption"><span class="caption-text">Advanced Examples</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="examples/ContinuousTime.html">Continuous Time Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/RealTime.html">Realtime Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/LivePlot.html">Live Plotting of Data During the Simulation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="examples/Dashboard.html">TkInter Dashboard with Editable Values</a></li>
@@ -330,6 +331,7 @@
          <script type="text/javascript" src="_static/underscore.js"></script>
          <script type="text/javascript" src="_static/doctools.js"></script>
          <script type="text/javascript" src="_static/language_data.js"></script>
+         <script type="text/javascript" src="_static/math.js"></script>
          <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
          <script type="text/javascript" src="_static/searchtools.js"></script>
      

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
doc/_build/html/searchindex.js


BIN
doc/_figures/stepsize/sine-1.png


BIN
doc/_figures/stepsize/sine-5.png


BIN
doc/_figures/stepsize/sine-euler2.png


BIN
doc/_figures/stepsize/sine.png


+ 18 - 0
doc/_static/math.js

@@ -0,0 +1,18 @@
+$(document).ready(function() {
+    setMathJax();
+});
+
+function setMathJax() {
+    if(window.MathJax === undefined) {
+        setTimeout(setMathJax, 500);
+        return;
+    }
+    window.MathJax.Hub.Queue(function () {
+        $(".MathJax").css('padding', '1%');
+        $(".MathJax .math").css('width', '');
+        $(".MathJax .math > span").css('width', '');
+        $(":not(.MathJax_Display) > .MathJax .math > span").css('font-size', '');
+        $(".MathJax .math > span > span").css('position', '');
+        $(".MathJax .math > span > span > span").css('height', '');
+    });
+}

+ 10 - 0
doc/_static/style.css

@@ -71,6 +71,12 @@ article.catalyst-article .class table tbody tr td.field-body p {
 	margin-right: auto;
 }
 
+div.math > p > img {
+	display: inline-block;
+	margin-left: unset;
+	margin-right: unset;
+}
+
 .figure {
 	display: unset !important;
 }
@@ -78,3 +84,7 @@ article.catalyst-article .class table tbody tr td.field-body p {
 article.catalyst-article .class dl dt em.property {
 	padding-right: 12px !important;
 }
+
+:not(.MathJax_Display) > .MathJax {
+	font-size: 110% !important;
+}

+ 7 - 1
doc/conf.py

@@ -44,11 +44,16 @@ extensions = [
     'sphinx.ext.autodoc',
     'sphinx.ext.viewcode',
     'sphinx.ext.todo',
-    'sphinx.ext.napoleon'
+    'sphinx.ext.napoleon',
+    # 'sphinx.ext.imgmath'
 ]
 
 # napoleon_use_ivar = False
 # napoleon_attr_annotations = True
+# imgmath_image_format = 'svg'
+# imgmath_latex = 'pdflatex'
+# imgmath_font_size = 14
+# imgmath_use_preview = True
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
@@ -96,6 +101,7 @@ html_theme = 'catalyst_sphinx_theme'
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 html_css_files = ['style.css']
+html_js_files = ['math.js']
 
 # Custom sidebar templates, must be a dictionary that maps document names
 # to template names.

+ 67 - 0
doc/examples/ContinuousTime.rst

@@ -0,0 +1,67 @@
+Continuous Time Simulation
+==========================
+Given that continuous time simulation will always have to be discretized when
+executed, it is important to ask *how* this discretization happens. In the
+:doc:`SinGen` example, this was done by reducing the delta inbetween multiple
+steps. However, this may compute too often for what is required in a given
+simulation. Assume we have the following data (from a sine wave):
+
+.. figure:: ../_figures/stepsize/sine.png
+   :width: 600
+
+Fixed Step Size
+---------------
+With the previously discussed technique, the data could be plot using a fixed
+step size, where the new data is being computed every :code:`dt` time. The
+smaller this :code:`dt` value is, the more precise the plot. Below, the same
+function has been plot twice, for :code:`dt = 0.5` and :code:`dt = 0.1`, where
+the marked points on the plot highlight *when* the data has been recomputed. It
+is clear from these plots that a smaller step size identifies more accurate
+results.
+
+.. figure:: ../_figures/stepsize/sine-5.png
+   :width: 600
+
+.. figure:: ../_figures/stepsize/sine-1.png
+   :width: 600
+
+This behaviour is the default in the simulator. To explicitly set it, make use of
+the :class:`CBD.stepsize.Fixed` class as follows (assuming :code:`sim` is the
+simulator object):
+
+.. code-block:: python
+
+   sim.setStepSize(Fixed(0.5))
+   #  OR, EQUIVALENTLY
+   sim.setStepSize(0.5)
+
+Yet, when the step size logic has been untouched since the creation of the
+simulator instance, the normal :func:`CBD.simulator.Simulator.setDeltaT` can be
+used as well.
+This was done for academic reasons, as it is much easier to explain CBDs with a
+fixed step size, as compared to varying step sizes.
+
+Euler 2-Step
+------------
+Variable step size algorithms continuously increases or decreases the :code:`dt`
+to allow for less steps to be taken. Whenever the simulation fluctuates a lot,
+:code:`dt` will be small. However, if there are only small changes, it will be
+large.
+
+The `Euler 2-Step` does this by (approximately) halving/doubling the current
+:code:`dt`, trying to get the best match for the given data. More information on
+the actual algorithm can be found in the documentation for
+:class:`CBD.stepsize.Euler2` and `professor Joel Feldman's notes on variable step
+size algorithms <http://www.math.ubc.ca/~feldman/math/vble.pdf>`_.
+It can be set on the simulator object as follows:
+
+.. code-block:: python
+
+   sim.setStepSize(Euler2(0.1, 0.005))
+
+For the sine wave example, with any starting delta and an acceptance error epsilon
+of :code:`0.005`, the following plot is obtained. Note that a decrease of the
+epsilon will make the plot more precise.
+
+.. figure:: ../_figures/stepsize/sine-euler2.png
+   :width: 600

+ 1 - 0
doc/index.rst

@@ -50,6 +50,7 @@ to model complex systems of equations.
     :maxdepth: 2
     :caption: Advanced Examples
 
+    examples/ContinuousTime
     examples/RealTime
     examples/LivePlot
     examples/Dashboard

+ 2 - 0
doc/install.rst

@@ -20,6 +20,8 @@ Next, there are some additional optional requirements:
 * `Seaborn <https://seaborn.pydata.org/>`_ for plotting data using Seaborn.
 * `Bokeh <https://docs.bokeh.org/en/latest/index.html>`_ for plotting data in Bokeh.
 * `Catalyst Sphynx Theme <https://pypi.org/project/catalyst-sphinx-theme/>`_ for creating the docs.
+* `Latex Preview Package <https://www.gnu.org/software/auctex/preview-latex.html>`_ for creating the docs
+  (Ubuntu xenial: :code:`preview-latex-style`).
 
 Installation
 ------------

+ 0 - 8
doc/modules.rst

@@ -1,8 +0,0 @@
-CBD
-===
-
-.. toctree::
-   :maxdepth: 4
-
-   CBD
-   CBD.util

+ 22 - 22
examples/AGV/AGV.py

@@ -317,20 +317,20 @@ class AGVVirtual(CBD):
         # Create the Blocks
         self.addBlock(ControllerPID("Controller", T=(T), v=(v), Kp=(Kp), Kd=(Kd), Ki=(Ki)))
         self.addBlock(DifferentialDrive("StaticPlant", wheel_axis=(wheel_axis), wheel_radius=(wheel_radius)))
-        # self.addBlock(PathBlock("environment", path_file=(path_file)))
+        self.addBlock(PathBlock("environment", path_file=(path_file)))
         self.addBlock(PositionCollectorBlock("plot"))
         self.addBlock(Odometry("odo", initial=(initial)))
-        # self.addBlock(SignalCollectorBlock("errorPlot"))
+        self.addBlock(SignalCollectorBlock("errorPlot"))
         self.addBlock(SignalCollectorBlock("headingPlot"))
-        # self.addBlock(IntegratorBlock("int"))
-        # self.addBlock(ConstantBlock("zero", value=(0)))
-        # self.addBlock(ConstantBlock("delta", value=(DELTA_T)))
-        # self.addBlock(IntegratorBlock("intH"))
-        # self.addBlock(ProductBlock("mult"))
+        self.addBlock(IntegratorBlock("int"))
+        self.addBlock(ConstantBlock("zero", value=(0)))
+        self.addBlock(ConstantBlock("delta", value=(DELTA_T)))
+        self.addBlock(IntegratorBlock("intH"))
+        self.addBlock(ProductBlock("mult"))
 
-        # self.addBlock(WriteCSV("writer", "obtained.csv", ["time", "color", "dur", "tcp_dur", "real"], time_col="arrived_at"))
+        # self.addBlock(WriteCSV("writer", trace_file, ["time", "color", "dur", "tcp_dur", "real"], time_col="arrived_at"))
         # self.addBlock(ServerReceiver("TCP", TCPServerSocket('192.168.1.10', 8080), 1024, initial=[T]))
-        self.addBlock(ReadCSV("TCP", path_file, Interpolation.LINEAR, columns=["color"]))
+        # 1 self.addBlock(ReadCSV("TCP", path_file, Interpolation.LINEAR, columns=["color"]))
         # self.addBlock(TCPServerReceiver("TCP", '192.168.1.10', 8080, 1024, initial=[T], convert=int))
         # self.addBlock(Splitter("splitter", 5, lambda x: float(x)))
         # self.addBlock(SignalCollectorBlock("dur"))
@@ -339,29 +339,29 @@ class AGVVirtual(CBD):
         # Create the Connections
         self.addConnection("Controller", "StaticPlant", output_port_name='heading', input_port_name='steering')
         self.addConnection("Controller", "StaticPlant", output_port_name='velocity', input_port_name='velocity')
-        # self.addConnection("environment", "Controller", output_port_name='color', input_port_name='color')
+        self.addConnection("environment", "Controller", output_port_name='color', input_port_name='color')
         self.addConnection("StaticPlant", "odo", output_port_name='phiLdot', input_port_name='phiLdot')
         self.addConnection("StaticPlant", "odo", output_port_name='phiRdot', input_port_name='phiRdot')
         self.addConnection("odo", "plot", output_port_name='x', input_port_name='X')
-        # self.addConnection("odo", "environment", output_port_name='x', input_port_name='x')
+        self.addConnection("odo", "environment", output_port_name='x', input_port_name='x')
         self.addConnection("odo", "plot", output_port_name='y', input_port_name='Y')
-        # self.addConnection("odo", "environment", output_port_name='y', input_port_name='y')
-        # self.addConnection("environment", "int", output_port_name='offset', input_port_name='IN1')
-        # self.addConnection("zero", "int", output_port_name='OUT1', input_port_name='IC')
-        # self.addConnection("zero", "intH", output_port_name='OUT1', input_port_name='IC')
-        # self.addConnection("delta", "int", output_port_name='OUT1', input_port_name='delta_t')
-        # self.addConnection("delta", "intH", output_port_name='OUT1', input_port_name='delta_t')
-        # self.addConnection("odo", "intH", output_port_name='heading', input_port_name='IN1')
+        self.addConnection("odo", "environment", output_port_name='y', input_port_name='y')
+        self.addConnection("environment", "int", output_port_name='offset', input_port_name='IN1')
+        self.addConnection("zero", "int", output_port_name='OUT1', input_port_name='IC')
+        self.addConnection("zero", "intH", output_port_name='OUT1', input_port_name='IC')
+        self.addConnection("delta", "int", output_port_name='OUT1', input_port_name='delta_t')
+        self.addConnection("delta", "intH", output_port_name='OUT1', input_port_name='delta_t')
+        self.addConnection("odo", "intH", output_port_name='heading', input_port_name='IN1')
         self.addConnection("odo", "headingPlot", output_port_name='heading', input_port_name='IN1')
-        # self.addConnection("intH", "mult", output_port_name='OUT1', input_port_name='IN1')
-        # self.addConnection("int", "mult", output_port_name='OUT1', input_port_name='IN2')
-        # self.addConnection("mult", "errorPlot", output_port_name='OUT1', input_port_name='IN1')
+        self.addConnection("intH", "mult", output_port_name='OUT1', input_port_name='IN1')
+        self.addConnection("int", "mult", output_port_name='OUT1', input_port_name='IN2')
+        self.addConnection("mult", "errorPlot", output_port_name='OUT1', input_port_name='IN1')
 
         # self.addConnection("odo", "writer", output_port_name="heading", input_port_name="heading")
         # self.addConnection("odo", "writer", output_port_name="x", input_port_name="x")
         # self.addConnection("odo", "writer", output_port_name="y", input_port_name="y")
 
-        self.addConnection("TCP", "Controller", output_port_name='color', input_port_name='color')
+        # 1 self.addConnection("TCP", "Controller", output_port_name='color', input_port_name='color')
 
         # self.addConnection("TCP", "splitter", output_port_name='OUT1', input_port_name='IN1')
         # self.addConnection("splitter", "Controller", output_port_name="OUT2", input_port_name="color")

+ 7 - 7
examples/AGV/AGV_tuning.py

@@ -26,14 +26,14 @@ END = 600.0
 # ax1.set_title("Trajectory")
 # ax2.set_title("Accumulated Offset")
 
-file = open('tuning8.log', 'a')
-i = 1000
-for Ki in np.arange(0.0, 0.01, 0.01):
-	for Kd in np.arange(0.0, 0.06, 0.01):
-		for Kp in np.arange(0.0, 0.06, 0.01):
+file = open('tuning9.log', 'a')
+i = 300
+for Ki in np.arange(0.0, -0.06, -0.01):
+	for Kd in np.arange(0.0, -0.06, -0.01):
+		for Kp in np.arange(0.0, -0.06, -0.01):
 			# cbd = AGVVirtual("AGVVirtual", initial=[0, -0.3, PI], Kp=0.04, Ki=0.0, Kd=-0.04)
 			cbd = AGVVirtual("AGVVirtual", initial=[0, -0.3, 0], Kp=Kp, Ki=Ki, Kd=Kd, v=0.01, T=35,
-			                 wheel_radius=0.018, wheel_axis=0.211, trace_file="tuning7/path-{:05d}.csv".format(i))
+			                 wheel_radius=0.028, wheel_axis=0.12)
 			# cbd = Test("Test")
 
 			# env = cbd.findBlock("environment")[0]
@@ -96,7 +96,7 @@ for Ki in np.arange(0.0, 0.01, 0.01):
 			ax1.plot(*traj.data_xy, color='blue')
 			ax1.set_title(txt)
 
-			plt.savefig("tuning8/image-{:05d}".format(i))
+			plt.savefig("tuning9/image-{:05d}".format(i))
 			plt.close()
 
 			print("{}:\t {}".format(i, txt))

+ 481 - 0
examples/AGV/tuning9.log

@@ -0,0 +1,481 @@
+Kp = 0.00, Ki = 0.00, Kd = 0.00; error = 0.000000
+Kp = 0.01, Ki = 0.00, Kd = 0.00; error = -18012746.216611
+Kp = 0.00, Ki = 0.00, Kd = 0.00; error = 0.000000
+Kp = 0.01, Ki = 0.00, Kd = 0.00; error = -18012746.216611
+Kp = 0.02, Ki = 0.00, Kd = 0.00; error = -67643603.666186
+Kp = 0.03, Ki = 0.00, Kd = 0.00; error = -101150365.811109
+Kp = 0.04, Ki = 0.00, Kd = 0.00; error = 675890553.638824
+Kp = 0.05, Ki = 0.00, Kd = 0.00; error = -286041692.576484
+Kp = 0.00, Ki = 0.00, Kd = 0.01; error = -134485.847891
+Kp = 0.01, Ki = 0.00, Kd = 0.01; error = -35691.030649
+Kp = 0.02, Ki = 0.00, Kd = 0.01; error = -49005.764313
+Kp = 0.03, Ki = 0.00, Kd = 0.01; error = 53329.512911
+Kp = 0.04, Ki = 0.00, Kd = 0.01; error = 126288.867444
+Kp = 0.05, Ki = 0.00, Kd = 0.01; error = 113562282.246074
+Kp = 0.00, Ki = 0.00, Kd = 0.02; error = -134485.847891
+Kp = 0.01, Ki = 0.00, Kd = 0.02; error = -30414.617592
+Kp = 0.02, Ki = 0.00, Kd = 0.02; error = 176338.197042
+Kp = 0.03, Ki = 0.00, Kd = 0.02; error = 120348.489122
+Kp = 0.04, Ki = 0.00, Kd = 0.02; error = 2671246.442243
+Kp = 0.05, Ki = 0.00, Kd = 0.02; error = -136758553.703004
+Kp = 0.00, Ki = 0.00, Kd = 0.03; error = -134485.847891
+Kp = 0.01, Ki = 0.00, Kd = 0.03; error = 39249.699992
+Kp = 0.02, Ki = 0.00, Kd = 0.03; error = 266109.658202
+Kp = 0.03, Ki = 0.00, Kd = 0.03; error = 154619.361097
+Kp = 0.04, Ki = 0.00, Kd = 0.03; error = 198668.947985
+Kp = 0.05, Ki = 0.00, Kd = 0.03; error = 24334.477978
+Kp = 0.00, Ki = 0.00, Kd = 0.04; error = -134485.847891
+Kp = 0.01, Ki = 0.00, Kd = 0.04; error = -31858.571796
+Kp = 0.02, Ki = 0.00, Kd = 0.04; error = 134352.228364
+Kp = 0.03, Ki = 0.00, Kd = 0.04; error = 1346888.963027
+Kp = 0.04, Ki = 0.00, Kd = 0.04; error = 78934.697600
+Kp = 0.05, Ki = 0.00, Kd = 0.04; error = 37843.302315
+Kp = 0.00, Ki = 0.00, Kd = 0.05; error = -134485.847891
+Kp = 0.01, Ki = 0.00, Kd = 0.05; error = -13943.613852
+Kp = 0.02, Ki = 0.00, Kd = 0.05; error = 148310.434516
+Kp = 0.03, Ki = 0.00, Kd = 0.05; error = 581356.089839
+Kp = 0.04, Ki = 0.00, Kd = 0.05; error = 1360542.496977
+Kp = 0.05, Ki = 0.00, Kd = 0.05; error = 49116.946400
+Kp = 0.00, Ki = 0.01, Kd = 0.00; error = -401056915.863245
+Kp = 0.01, Ki = 0.01, Kd = 0.00; error = -297589195.473220
+Kp = 0.02, Ki = 0.01, Kd = 0.00; error = -276519957.397209
+Kp = 0.03, Ki = 0.01, Kd = 0.00; error = -315598036.957068
+Kp = 0.04, Ki = 0.01, Kd = 0.00; error = -355290303.786541
+Kp = 0.05, Ki = 0.01, Kd = 0.00; error = -422561299.317196
+Kp = 0.00, Ki = 0.01, Kd = 0.01; error = -289916252.114659
+Kp = 0.01, Ki = 0.01, Kd = 0.01; error = -36666059.940964
+Kp = 0.02, Ki = 0.01, Kd = 0.01; error = 5896796.454995
+Kp = 0.03, Ki = 0.01, Kd = 0.01; error = 10216231.811752
+Kp = 0.04, Ki = 0.01, Kd = 0.01; error = 111709909.132467
+Kp = 0.00, Ki = 0.00, Kd = 0.00; error = 0.000000
+Kp = 0.01, Ki = 0.00, Kd = 0.00; error = -1131093.673607
+Kp = 0.02, Ki = 0.00, Kd = 0.00; error = -3708154.231007
+Kp = 0.03, Ki = 0.00, Kd = 0.00; error = -13018564.950480
+Kp = 0.04, Ki = 0.00, Kd = 0.00; error = -5258180.376453
+Kp = 0.05, Ki = 0.00, Kd = 0.00; error = -41304623.328948
+Kp = 0.00, Ki = 0.00, Kd = 0.01; error = -58155.293575
+Kp = 0.01, Ki = 0.00, Kd = 0.01; error = -273511.285203
+Kp = 0.02, Ki = 0.00, Kd = 0.01; error = -34845.352745
+Kp = 0.03, Ki = 0.00, Kd = 0.01; error = -96503.854314
+Kp = 0.04, Ki = 0.00, Kd = 0.01; error = 1670.230025
+Kp = 0.05, Ki = 0.00, Kd = 0.01; error = -19947.256784
+Kp = 0.00, Ki = 0.00, Kd = 0.02; error = -117412.828403
+Kp = 0.01, Ki = 0.00, Kd = 0.02; error = -111737.430809
+Kp = 0.02, Ki = 0.00, Kd = 0.02; error = 47865.564974
+Kp = 0.03, Ki = 0.00, Kd = 0.02; error = 81992.371359
+Kp = 0.04, Ki = 0.00, Kd = 0.02; error = 62403.205896
+Kp = 0.05, Ki = 0.00, Kd = 0.02; error = 40763.104141
+Kp = 0.00, Ki = 0.00, Kd = 0.03; error = -130214.987207
+Kp = 0.01, Ki = 0.00, Kd = 0.03; error = -382397.241378
+Kp = 0.02, Ki = 0.00, Kd = 0.03; error = -2179.056873
+Kp = 0.03, Ki = 0.00, Kd = 0.03; error = 37402.246769
+Kp = 0.04, Ki = 0.00, Kd = 0.03; error = 51250.907344
+Kp = 0.05, Ki = 0.00, Kd = 0.03; error = 62755.733590
+Kp = 0.00, Ki = 0.00, Kd = 0.04; error = -130214.987207
+Kp = 0.01, Ki = 0.00, Kd = 0.04; error = -134919.514222
+Kp = 0.02, Ki = 0.00, Kd = 0.04; error = -41490.463518
+Kp = 0.03, Ki = 0.00, Kd = 0.04; error = 57908.885054
+Kp = 0.04, Ki = 0.00, Kd = 0.04; error = 40147.577434
+Kp = 0.05, Ki = 0.00, Kd = 0.04; error = 36033.575039
+Kp = 0.00, Ki = 0.00, Kd = 0.05; error = -130214.987207
+Kp = 0.01, Ki = 0.00, Kd = 0.05; error = -179913.704909
+Kp = 0.02, Ki = 0.00, Kd = 0.05; error = -247031.357170
+Kp = 0.03, Ki = 0.00, Kd = 0.05; error = 36758.470347
+Kp = 0.04, Ki = 0.00, Kd = 0.05; error = 28623.414168
+Kp = 0.05, Ki = 0.00, Kd = 0.05; error = 28161.655183
+Kp = 0.00, Ki = 0.01, Kd = 0.00; error = -347382545.662857
+Kp = 0.01, Ki = 0.01, Kd = 0.00; error = -261736005.256554
+Kp = 0.02, Ki = 0.01, Kd = 0.00; error = -228662188.917408
+Kp = 0.03, Ki = 0.01, Kd = 0.00; error = -225802908.327095
+Kp = 0.04, Ki = 0.01, Kd = 0.00; error = -249034286.881803
+Kp = 0.05, Ki = 0.01, Kd = 0.00; error = -272133280.916169
+Kp = 0.00, Ki = 0.01, Kd = 0.01; error = -300012571.713297
+Kp = 0.01, Ki = 0.01, Kd = 0.01; error = -199951135.917977
+Kp = 0.02, Ki = 0.01, Kd = 0.01; error = -168270454.095179
+Kp = 0.03, Ki = 0.01, Kd = 0.01; error = -172418320.534548
+Kp = 0.04, Ki = 0.01, Kd = 0.01; error = -135326771.422051
+Kp = 0.05, Ki = 0.01, Kd = 0.01; error = -282826977.292875
+Kp = 0.00, Ki = 0.01, Kd = 0.02; error = -241231106.352774
+Kp = 0.01, Ki = 0.01, Kd = 0.02; error = -131150638.491582
+Kp = 0.02, Ki = 0.01, Kd = 0.02; error = -233996669.725159
+Kp = 0.03, Ki = 0.01, Kd = 0.02; error = -146663041.173966
+Kp = 0.04, Ki = 0.01, Kd = 0.02; error = -58275336.857981
+Kp = 0.05, Ki = 0.01, Kd = 0.02; error = -4449.866249
+Kp = 0.00, Ki = 0.01, Kd = 0.03; error = -200030793.623390
+Kp = 0.01, Ki = 0.01, Kd = 0.03; error = -365327356.563442
+Kp = 0.02, Ki = 0.01, Kd = 0.03; error = -9376924.215271
+Kp = 0.03, Ki = 0.01, Kd = 0.03; error = -6313330.384018
+Kp = 0.04, Ki = 0.01, Kd = 0.03; error = -4458987.938472
+Kp = 0.05, Ki = 0.01, Kd = 0.03; error = 1641002.652959
+Kp = 0.00, Ki = 0.01, Kd = 0.04; error = -200030793.623390
+Kp = 0.01, Ki = 0.01, Kd = 0.04; error = -340898095.639864
+Kp = 0.02, Ki = 0.01, Kd = 0.04; error = -104150441.474561
+Kp = 0.03, Ki = 0.01, Kd = 0.04; error = -7574666.693875
+Kp = 0.04, Ki = 0.01, Kd = 0.04; error = -41938.646587
+Kp = 0.05, Ki = 0.01, Kd = 0.04; error = 40743.593246
+Kp = 0.00, Ki = 0.01, Kd = 0.05; error = -200030793.623390
+Kp = 0.01, Ki = 0.01, Kd = 0.05; error = -322228078.979649
+Kp = 0.02, Ki = 0.01, Kd = 0.05; error = -434846.434631
+Kp = 0.03, Ki = 0.01, Kd = 0.05; error = 1828613.427644
+Kp = 0.04, Ki = 0.01, Kd = 0.05; error = 1034571.222075
+Kp = 0.05, Ki = 0.01, Kd = 0.05; error = 22141.225144
+Kp = 0.00, Ki = 0.02, Kd = 0.00; error = -407083251.585652
+Kp = 0.01, Ki = 0.02, Kd = 0.00; error = -376395056.820486
+Kp = 0.02, Ki = 0.02, Kd = 0.00; error = -352277442.831188
+Kp = 0.03, Ki = 0.02, Kd = 0.00; error = -333550184.166352
+Kp = 0.04, Ki = 0.02, Kd = 0.00; error = -342447545.107856
+Kp = 0.05, Ki = 0.02, Kd = 0.00; error = -343585866.055029
+Kp = 0.00, Ki = 0.02, Kd = 0.01; error = -391151597.328085
+Kp = 0.01, Ki = 0.02, Kd = 0.01; error = -339213888.925949
+Kp = 0.02, Ki = 0.02, Kd = 0.01; error = -310045503.488650
+Kp = 0.03, Ki = 0.02, Kd = 0.01; error = -290435343.322768
+Kp = 0.04, Ki = 0.02, Kd = 0.01; error = -304343265.184069
+Kp = 0.05, Ki = 0.02, Kd = 0.01; error = -308045186.097531
+Kp = 0.00, Ki = 0.02, Kd = 0.02; error = -359811693.419079
+Kp = 0.01, Ki = 0.02, Kd = 0.02; error = -290486603.786510
+Kp = 0.02, Ki = 0.02, Kd = 0.02; error = -258719341.418029
+Kp = 0.03, Ki = 0.02, Kd = 0.02; error = -240342068.087027
+Kp = 0.04, Ki = 0.02, Kd = 0.02; error = -260368294.936681
+Kp = 0.05, Ki = 0.02, Kd = 0.02; error = -252645021.641320
+Kp = 0.00, Ki = 0.02, Kd = 0.03; error = -315103820.692419
+Kp = 0.01, Ki = 0.02, Kd = 0.03; error = -248553847.490490
+Kp = 0.02, Ki = 0.02, Kd = 0.03; error = -200042451.959065
+Kp = 0.03, Ki = 0.02, Kd = 0.03; error = -6878147.852042
+Kp = 0.04, Ki = 0.02, Kd = 0.03; error = -92034.628727
+Kp = 0.05, Ki = 0.02, Kd = 0.03; error = -245852746.551281
+Kp = 0.00, Ki = 0.02, Kd = 0.04; error = -288329516.265217
+Kp = 0.01, Ki = 0.02, Kd = 0.04; error = -248553847.490490
+Kp = 0.02, Ki = 0.02, Kd = 0.04; error = -115941162.894291
+Kp = 0.03, Ki = 0.02, Kd = 0.04; error = 4048486.402870
+Kp = 0.04, Ki = 0.02, Kd = 0.04; error = 115988488.285291
+Kp = 0.05, Ki = 0.02, Kd = 0.04; error = -245852746.551281
+Kp = 0.00, Ki = 0.02, Kd = 0.05; error = -277116751.652328
+Kp = 0.01, Ki = 0.02, Kd = 0.05; error = -248553847.490490
+Kp = 0.02, Ki = 0.02, Kd = 0.05; error = -95179095.138616
+Kp = 0.03, Ki = 0.02, Kd = 0.05; error = -21271678.023798
+Kp = 0.04, Ki = 0.02, Kd = 0.05; error = -170340549.261470
+Kp = 0.05, Ki = 0.02, Kd = 0.05; error = -245852746.551281
+Kp = 0.00, Ki = 0.03, Kd = 0.00; error = -370960623.766239
+Kp = 0.01, Ki = 0.03, Kd = 0.00; error = -413483466.883281
+Kp = 0.02, Ki = 0.03, Kd = 0.00; error = -409345502.029749
+Kp = 0.03, Ki = 0.03, Kd = 0.00; error = -399157362.208081
+Kp = 0.04, Ki = 0.03, Kd = 0.00; error = -395494935.959928
+Kp = 0.05, Ki = 0.03, Kd = 0.00; error = -401655524.392408
+Kp = 0.00, Ki = 0.03, Kd = 0.01; error = -404590804.352657
+Kp = 0.01, Ki = 0.03, Kd = 0.01; error = -404640195.830613
+Kp = 0.02, Ki = 0.03, Kd = 0.01; error = -390899429.501103
+Kp = 0.03, Ki = 0.03, Kd = 0.01; error = -374230477.030008
+Kp = 0.04, Ki = 0.03, Kd = 0.01; error = -370638130.772462
+Kp = 0.05, Ki = 0.03, Kd = 0.01; error = -380805226.640786
+Kp = 0.00, Ki = 0.03, Kd = 0.02; error = -411584163.515227
+Kp = 0.01, Ki = 0.03, Kd = 0.02; error = -381101576.297785
+Kp = 0.02, Ki = 0.03, Kd = 0.02; error = -359962416.885403
+Kp = 0.03, Ki = 0.03, Kd = 0.02; error = -338657008.798110
+Kp = 0.04, Ki = 0.03, Kd = 0.02; error = -337045376.655206
+Kp = 0.05, Ki = 0.03, Kd = 0.02; error = -351636614.097665
+Kp = 0.00, Ki = 0.03, Kd = 0.03; error = -400585261.812885
+Kp = 0.01, Ki = 0.03, Kd = 0.03; error = -346486177.009421
+Kp = 0.02, Ki = 0.03, Kd = 0.03; error = -325343944.857566
+Kp = 0.03, Ki = 0.03, Kd = 0.03; error = -306412387.265945
+Kp = 0.04, Ki = 0.03, Kd = 0.03; error = -295945974.229155
+Kp = 0.05, Ki = 0.03, Kd = 0.03; error = -329834375.980508
+Kp = 0.00, Ki = 0.03, Kd = 0.04; error = -383135576.450306
+Kp = 0.01, Ki = 0.03, Kd = 0.04; error = -346486177.009421
+Kp = 0.02, Ki = 0.03, Kd = 0.04; error = -325343944.857566
+Kp = 0.03, Ki = 0.03, Kd = 0.04; error = -306412387.265945
+Kp = 0.04, Ki = 0.03, Kd = 0.04; error = -239280799.127628
+Kp = 0.05, Ki = 0.03, Kd = 0.04; error = -329834375.980508
+Kp = 0.00, Ki = 0.03, Kd = 0.05; error = -378256842.474048
+Kp = 0.01, Ki = 0.03, Kd = 0.05; error = -346486177.009421
+Kp = 0.02, Ki = 0.03, Kd = 0.05; error = -325343944.857566
+Kp = 0.03, Ki = 0.03, Kd = 0.05; error = -306412387.265945
+Kp = 0.04, Ki = 0.03, Kd = 0.05; error = -238947404.645708
+Kp = 0.05, Ki = 0.03, Kd = 0.05; error = -329834375.980508
+Kp = 0.00, Ki = 0.04, Kd = 0.00; error = 63884007.714353
+Kp = 0.01, Ki = 0.04, Kd = 0.00; error = -361089000.077784
+Kp = 0.02, Ki = 0.04, Kd = 0.00; error = -399842572.037465
+Kp = 0.03, Ki = 0.04, Kd = 0.00; error = -408213427.225845
+Kp = 0.04, Ki = 0.04, Kd = 0.00; error = -416187774.013922
+Kp = 0.05, Ki = 0.04, Kd = 0.00; error = -414414313.948828
+Kp = 0.00, Ki = 0.04, Kd = 0.01; error = 227123244.358666
+Kp = 0.01, Ki = 0.04, Kd = 0.01; error = -401059886.049857
+Kp = 0.02, Ki = 0.04, Kd = 0.01; error = -414867897.204907
+Kp = 0.03, Ki = 0.04, Kd = 0.01; error = -416254420.981568
+Kp = 0.04, Ki = 0.04, Kd = 0.01; error = -413766887.607166
+Kp = 0.05, Ki = 0.04, Kd = 0.01; error = -416870682.059221
+Kp = 0.00, Ki = 0.04, Kd = 0.02; error = -364603070.886671
+Kp = 0.01, Ki = 0.04, Kd = 0.02; error = -414352848.005092
+Kp = 0.02, Ki = 0.04, Kd = 0.02; error = -410370843.513000
+Kp = 0.03, Ki = 0.04, Kd = 0.02; error = -406750675.174943
+Kp = 0.04, Ki = 0.04, Kd = 0.02; error = -396104424.785715
+Kp = 0.05, Ki = 0.04, Kd = 0.02; error = -404222778.655444
+Kp = 0.00, Ki = 0.04, Kd = 0.03; error = -402766723.921757
+Kp = 0.01, Ki = 0.04, Kd = 0.03; error = -406769529.836625
+Kp = 0.02, Ki = 0.04, Kd = 0.03; error = -388707884.459826
+Kp = 0.03, Ki = 0.04, Kd = 0.03; error = -385343444.579578
+Kp = 0.04, Ki = 0.04, Kd = 0.03; error = -364332325.439923
+Kp = 0.05, Ki = 0.04, Kd = 0.03; error = -388445715.442159
+Kp = 0.00, Ki = 0.04, Kd = 0.04; error = -412948141.789573
+Kp = 0.01, Ki = 0.04, Kd = 0.04; error = -381292676.219454
+Kp = 0.02, Ki = 0.04, Kd = 0.04; error = -351715248.601529
+Kp = 0.03, Ki = 0.04, Kd = 0.04; error = -385343444.579578
+Kp = 0.04, Ki = 0.04, Kd = 0.04; error = -339766736.619160
+Kp = 0.05, Ki = 0.04, Kd = 0.04; error = -388445715.442159
+Kp = 0.00, Ki = 0.04, Kd = 0.05; error = -413063794.528236
+Kp = 0.01, Ki = 0.04, Kd = 0.05; error = -340094810.881576
+Kp = 0.02, Ki = 0.04, Kd = 0.05; error = -299175791.353792
+Kp = 0.03, Ki = 0.04, Kd = 0.05; error = -385343444.579578
+Kp = 0.04, Ki = 0.04, Kd = 0.05; error = -328361044.403883
+Kp = 0.05, Ki = 0.04, Kd = 0.05; error = -388445715.442159
+Kp = 0.00, Ki = 0.05, Kd = 0.00; error = 121398068.331226
+Kp = 0.01, Ki = 0.05, Kd = 0.00; error = 118428319.700475
+Kp = 0.02, Ki = 0.05, Kd = 0.00; error = 281771869.542968
+Kp = 0.03, Ki = 0.05, Kd = 0.00; error = 384338539.219647
+Kp = 0.04, Ki = 0.05, Kd = 0.00; error = 424308322.111191
+Kp = 0.05, Ki = 0.05, Kd = 0.00; error = 415996212.891665
+Kp = 0.00, Ki = 0.05, Kd = 0.01; error = 156642470.338686
+Kp = 0.01, Ki = 0.05, Kd = 0.01; error = 436105475.330931
+Kp = 0.02, Ki = 0.05, Kd = 0.01; error = -365167227.437632
+Kp = 0.03, Ki = 0.05, Kd = 0.01; error = -366868310.134537
+Kp = 0.04, Ki = 0.05, Kd = 0.01; error = -381254388.169234
+Kp = 0.05, Ki = 0.05, Kd = 0.01; error = 419734195.679396
+Kp = 0.00, Ki = 0.05, Kd = 0.02; error = 45239713.756483
+Kp = 0.01, Ki = 0.05, Kd = 0.02; error = -368303079.307436
+Kp = 0.02, Ki = 0.05, Kd = 0.02; error = -401443386.104491
+Kp = 0.03, Ki = 0.05, Kd = 0.02; error = -401535419.365779
+Kp = 0.04, Ki = 0.05, Kd = 0.02; error = -408120949.513967
+Kp = 0.05, Ki = 0.05, Kd = 0.02; error = 423160805.410881
+Kp = 0.00, Ki = 0.05, Kd = 0.03; error = -341108661.594410
+Kp = 0.01, Ki = 0.05, Kd = 0.03; error = -403814920.205065
+Kp = 0.02, Ki = 0.05, Kd = 0.03; error = -415918277.921849
+Kp = 0.03, Ki = 0.05, Kd = 0.03; error = -417036635.343037
+Kp = 0.04, Ki = 0.05, Kd = 0.03; error = -417738383.736703
+Kp = 0.05, Ki = 0.05, Kd = 0.03; error = 417212153.831334
+Kp = 0.00, Ki = 0.05, Kd = 0.04; error = -370523383.009863
+Kp = 0.01, Ki = 0.05, Kd = 0.04; error = -410263438.188656
+Kp = 0.02, Ki = 0.05, Kd = 0.04; error = -411707311.010572
+Kp = 0.03, Ki = 0.05, Kd = 0.04; error = -417091647.929650
+Kp = 0.04, Ki = 0.05, Kd = 0.04; error = -411292368.048783
+Kp = 0.05, Ki = 0.05, Kd = 0.04; error = -407262083.610519
+Kp = 0.00, Ki = 0.05, Kd = 0.05; error = -370523383.009863
+Kp = 0.01, Ki = 0.05, Kd = 0.05; error = -410263438.188656
+Kp = 0.02, Ki = 0.05, Kd = 0.05; error = -409952915.460547
+Kp = 0.03, Ki = 0.05, Kd = 0.05; error = -417113077.877824
+Kp = 0.04, Ki = 0.05, Kd = 0.05; error = -389830416.149436
+Kp = 0.05, Ki = 0.05, Kd = 0.05; error = -417634563.975820
+Kp = 0.00, Ki = 0.00, Kd = 0.00; error = 0.000000
+Kp = -0.01, Ki = 0.00, Kd = 0.00; error = 1045388.290052
+Kp = -0.02, Ki = 0.00, Kd = 0.00; error = 6458271.596031
+Kp = -0.03, Ki = 0.00, Kd = 0.00; error = 2944768.806146
+Kp = -0.04, Ki = 0.00, Kd = 0.00; error = 5258180.376453
+Kp = -0.05, Ki = 0.00, Kd = 0.00; error = 41304623.328948
+Kp = 0.00, Ki = 0.00, Kd = -0.01; error = 54750.113637
+Kp = -0.01, Ki = 0.00, Kd = -0.01; error = 103886.593642
+Kp = -0.02, Ki = 0.00, Kd = -0.01; error = 71055.950631
+Kp = -0.03, Ki = 0.00, Kd = -0.01; error = 87462.472342
+Kp = -0.04, Ki = 0.00, Kd = -0.01; error = 32034.058948
+Kp = -0.05, Ki = 0.00, Kd = -0.01; error = 50185.438660
+Kp = 0.00, Ki = 0.00, Kd = -0.02; error = 102229.472335
+Kp = -0.01, Ki = 0.00, Kd = -0.02; error = 236998.093331
+Kp = -0.02, Ki = 0.00, Kd = -0.02; error = 63088.786109
+Kp = -0.03, Ki = 0.00, Kd = -0.02; error = 56870.927366
+Kp = -0.04, Ki = 0.00, Kd = -0.02; error = 40334.455598
+Kp = -0.05, Ki = 0.00, Kd = -0.02; error = 30828.729448
+Kp = 0.00, Ki = 0.00, Kd = -0.03; error = 111392.110826
+Kp = -0.01, Ki = 0.00, Kd = -0.03; error = 162188.424202
+Kp = -0.02, Ki = 0.00, Kd = -0.03; error = 41281.529461
+Kp = -0.03, Ki = 0.00, Kd = -0.03; error = 52226.196531
+Kp = -0.04, Ki = 0.00, Kd = -0.03; error = 50161.367092
+Kp = -0.05, Ki = 0.00, Kd = -0.03; error = 32873.402942
+Kp = 0.00, Ki = 0.00, Kd = -0.04; error = 111392.110826
+Kp = -0.01, Ki = 0.00, Kd = -0.04; error = 743657.523502
+Kp = -0.02, Ki = 0.00, Kd = -0.04; error = 45647.069684
+Kp = -0.03, Ki = 0.00, Kd = -0.04; error = 33774.886880
+Kp = -0.04, Ki = 0.00, Kd = -0.04; error = 24714.507095
+Kp = -0.05, Ki = 0.00, Kd = -0.04; error = 26563.606943
+Kp = 0.00, Ki = 0.00, Kd = -0.05; error = 111392.110826
+Kp = -0.01, Ki = 0.00, Kd = -0.05; error = 386965.923008
+Kp = -0.02, Ki = 0.00, Kd = -0.05; error = 33395.587641
+Kp = -0.03, Ki = 0.00, Kd = -0.05; error = 25091.190025
+Kp = -0.04, Ki = 0.00, Kd = -0.05; error = 24654.780850
+Kp = -0.05, Ki = 0.00, Kd = -0.05; error = 27795.396687
+Kp = 0.00, Ki = -0.01, Kd = 0.00; error = 347382545.662851
+Kp = -0.01, Ki = -0.01, Kd = 0.00; error = 261736005.256554
+Kp = -0.02, Ki = -0.01, Kd = 0.00; error = 228662188.917408
+Kp = -0.03, Ki = -0.01, Kd = 0.00; error = 225802908.327095
+Kp = -0.04, Ki = -0.01, Kd = 0.00; error = 249034286.881803
+Kp = -0.05, Ki = -0.01, Kd = 0.00; error = 272133280.916169
+Kp = 0.00, Ki = -0.01, Kd = -0.01; error = 300012571.713297
+Kp = -0.01, Ki = -0.01, Kd = -0.01; error = 199951135.917977
+Kp = -0.02, Ki = -0.01, Kd = -0.01; error = 168270454.095179
+Kp = -0.03, Ki = -0.01, Kd = -0.01; error = 172418320.534548
+Kp = -0.04, Ki = -0.01, Kd = -0.01; error = 135326771.422051
+Kp = -0.05, Ki = -0.01, Kd = -0.01; error = 282826977.292875
+Kp = 0.00, Ki = -0.01, Kd = -0.02; error = 241231106.352774
+Kp = -0.01, Ki = -0.01, Kd = -0.02; error = 131150638.491582
+Kp = -0.02, Ki = -0.01, Kd = -0.02; error = 233996669.725159
+Kp = -0.03, Ki = -0.01, Kd = -0.02; error = 146663041.173966
+Kp = -0.04, Ki = -0.01, Kd = -0.02; error = 58275336.857981
+Kp = -0.05, Ki = -0.01, Kd = -0.02; error = 59140148.748313
+Kp = 0.00, Ki = -0.01, Kd = -0.03; error = 200030793.623390
+Kp = -0.01, Ki = -0.01, Kd = -0.03; error = 365327356.563444
+Kp = -0.02, Ki = -0.01, Kd = -0.03; error = 9046258.145850
+Kp = -0.03, Ki = -0.01, Kd = -0.03; error = 6753463.953894
+Kp = -0.04, Ki = -0.01, Kd = -0.03; error = 59005.318494
+Kp = -0.05, Ki = -0.01, Kd = -0.03; error = 47043.789394
+Kp = 0.00, Ki = -0.01, Kd = -0.04; error = 200030793.623390
+Kp = -0.01, Ki = -0.01, Kd = -0.04; error = 340898095.639864
+Kp = -0.02, Ki = -0.01, Kd = -0.04; error = 11263478.308846
+Kp = -0.03, Ki = -0.01, Kd = -0.04; error = 53485.828000
+Kp = -0.04, Ki = -0.01, Kd = -0.04; error = 29259.661127
+Kp = -0.05, Ki = -0.01, Kd = -0.04; error = 25389.371434
+Kp = 0.00, Ki = -0.01, Kd = -0.05; error = 200030793.623390
+Kp = -0.01, Ki = -0.01, Kd = -0.05; error = 322228078.979648
+Kp = -0.02, Ki = -0.01, Kd = -0.05; error = 17244308.757675
+Kp = -0.03, Ki = -0.01, Kd = -0.05; error = 955778.796843
+Kp = -0.04, Ki = -0.01, Kd = -0.05; error = -2864657.354971
+Kp = -0.05, Ki = -0.01, Kd = -0.05; error = 26250.117907
+Kp = 0.00, Ki = -0.02, Kd = 0.00; error = 407083251.585652
+Kp = -0.01, Ki = -0.02, Kd = 0.00; error = 376395056.820486
+Kp = -0.02, Ki = -0.02, Kd = 0.00; error = 352277442.831187
+Kp = -0.03, Ki = -0.02, Kd = 0.00; error = 333550184.166352
+Kp = -0.04, Ki = -0.02, Kd = 0.00; error = 342447545.107856
+Kp = -0.05, Ki = -0.02, Kd = 0.00; error = 343585866.055029
+Kp = 0.00, Ki = -0.02, Kd = -0.01; error = 391151597.328084
+Kp = -0.01, Ki = -0.02, Kd = -0.01; error = 339213888.925950
+Kp = -0.02, Ki = -0.02, Kd = -0.01; error = 310045503.488650
+Kp = -0.03, Ki = -0.02, Kd = -0.01; error = 290435343.322768
+Kp = -0.04, Ki = -0.02, Kd = -0.01; error = 304343265.184069
+Kp = -0.05, Ki = -0.02, Kd = -0.01; error = 308045186.097531
+Kp = 0.00, Ki = -0.02, Kd = -0.02; error = 359811693.419080
+Kp = -0.01, Ki = -0.02, Kd = -0.02; error = 290486603.786510
+Kp = -0.02, Ki = -0.02, Kd = -0.02; error = 258719341.418029
+Kp = -0.03, Ki = -0.02, Kd = -0.02; error = 240342068.087027
+Kp = -0.04, Ki = -0.02, Kd = -0.02; error = 260368294.936681
+Kp = -0.05, Ki = -0.02, Kd = -0.02; error = 252645021.641320
+Kp = 0.00, Ki = -0.02, Kd = -0.03; error = 315103820.692419
+Kp = -0.01, Ki = -0.02, Kd = -0.03; error = 248553847.490490
+Kp = -0.02, Ki = -0.02, Kd = -0.03; error = 200042451.959065
+Kp = -0.03, Ki = -0.02, Kd = -0.03; error = 41814297.620542
+Kp = -0.04, Ki = -0.02, Kd = -0.03; error = 5892188.161290
+Kp = -0.05, Ki = -0.02, Kd = -0.03; error = 245852746.551281
+Kp = 0.00, Ki = -0.02, Kd = -0.04; error = 288329516.265218
+Kp = -0.01, Ki = -0.02, Kd = -0.04; error = 248553847.490490
+Kp = -0.02, Ki = -0.02, Kd = -0.04; error = 115941162.894291
+Kp = -0.03, Ki = -0.02, Kd = -0.04; error = 9176652.494298
+Kp = -0.04, Ki = -0.02, Kd = -0.04; error = -115988488.285291
+Kp = -0.05, Ki = -0.02, Kd = -0.04; error = 245852746.551281
+Kp = 0.00, Ki = -0.02, Kd = -0.05; error = 277116751.652328
+Kp = -0.01, Ki = -0.02, Kd = -0.05; error = 248553847.490490
+Kp = -0.02, Ki = -0.02, Kd = -0.05; error = 95179095.138616
+Kp = -0.03, Ki = -0.02, Kd = -0.05; error = 8989150.776983
+Kp = -0.04, Ki = -0.02, Kd = -0.05; error = 170340549.261470
+Kp = -0.05, Ki = -0.02, Kd = -0.05; error = 245852746.551281
+Kp = 0.00, Ki = -0.03, Kd = 0.00; error = 370960623.766239
+Kp = -0.01, Ki = -0.03, Kd = 0.00; error = 413483466.883281
+Kp = -0.02, Ki = -0.03, Kd = 0.00; error = 409345502.029749
+Kp = -0.03, Ki = -0.03, Kd = 0.00; error = 399157362.208081
+Kp = -0.04, Ki = -0.03, Kd = 0.00; error = 395494935.959928
+Kp = -0.05, Ki = -0.03, Kd = 0.00; error = 401655524.392408
+Kp = 0.00, Ki = -0.03, Kd = -0.01; error = 404590804.352657
+Kp = -0.01, Ki = -0.03, Kd = -0.01; error = 404640195.830613
+Kp = -0.02, Ki = -0.03, Kd = -0.01; error = 390899429.501103
+Kp = -0.03, Ki = -0.03, Kd = -0.01; error = 374230477.030008
+Kp = -0.04, Ki = -0.03, Kd = -0.01; error = 370638130.772462
+Kp = -0.05, Ki = -0.03, Kd = -0.01; error = 380805226.640786
+Kp = 0.00, Ki = -0.03, Kd = -0.02; error = 411584163.515226
+Kp = -0.01, Ki = -0.03, Kd = -0.02; error = 381101576.297785
+Kp = -0.02, Ki = -0.03, Kd = -0.02; error = 359962416.885403
+Kp = -0.03, Ki = -0.03, Kd = -0.02; error = 338657008.798110
+Kp = -0.04, Ki = -0.03, Kd = -0.02; error = 337045376.655206
+Kp = -0.05, Ki = -0.03, Kd = -0.02; error = 351636614.097665
+Kp = 0.00, Ki = -0.03, Kd = -0.03; error = 400585261.812885
+Kp = -0.01, Ki = -0.03, Kd = -0.03; error = 346486177.009421
+Kp = -0.02, Ki = -0.03, Kd = -0.03; error = 325343944.857566
+Kp = -0.03, Ki = -0.03, Kd = -0.03; error = 306412387.265945
+Kp = -0.04, Ki = -0.03, Kd = -0.03; error = 295945974.229155
+Kp = -0.05, Ki = -0.03, Kd = -0.03; error = 329834375.980508
+Kp = 0.00, Ki = -0.03, Kd = -0.04; error = 383135576.450306
+Kp = -0.01, Ki = -0.03, Kd = -0.04; error = 346486177.009421
+Kp = -0.02, Ki = -0.03, Kd = -0.04; error = 325343944.857566
+Kp = -0.03, Ki = -0.03, Kd = -0.04; error = 306412387.265945
+Kp = -0.04, Ki = -0.03, Kd = -0.04; error = 239280799.127628
+Kp = -0.05, Ki = -0.03, Kd = -0.04; error = 329834375.980508
+Kp = 0.00, Ki = -0.03, Kd = -0.05; error = 378256842.474048
+Kp = -0.01, Ki = -0.03, Kd = -0.05; error = 346486177.009421
+Kp = -0.02, Ki = -0.03, Kd = -0.05; error = 325343944.857566
+Kp = -0.03, Ki = -0.03, Kd = -0.05; error = 306412387.265945
+Kp = -0.04, Ki = -0.03, Kd = -0.05; error = 238947404.645708
+Kp = -0.05, Ki = -0.03, Kd = -0.05; error = 329834375.980508
+Kp = 0.00, Ki = -0.04, Kd = 0.00; error = -63884007.714353
+Kp = -0.01, Ki = -0.04, Kd = 0.00; error = 361089000.077784
+Kp = -0.02, Ki = -0.04, Kd = 0.00; error = 399842572.037465
+Kp = -0.03, Ki = -0.04, Kd = 0.00; error = 408213427.225845
+Kp = -0.04, Ki = -0.04, Kd = 0.00; error = 416187774.013922
+Kp = -0.05, Ki = -0.04, Kd = 0.00; error = 414414313.948828
+Kp = 0.00, Ki = -0.04, Kd = -0.01; error = -227123244.358666
+Kp = -0.01, Ki = -0.04, Kd = -0.01; error = 401059886.049857
+Kp = -0.02, Ki = -0.04, Kd = -0.01; error = 414867897.204907
+Kp = -0.03, Ki = -0.04, Kd = -0.01; error = 416254420.981568
+Kp = -0.04, Ki = -0.04, Kd = -0.01; error = 413766887.607166
+Kp = -0.05, Ki = -0.04, Kd = -0.01; error = 416870682.059221
+Kp = 0.00, Ki = -0.04, Kd = -0.02; error = 364603070.886671
+Kp = -0.01, Ki = -0.04, Kd = -0.02; error = 414352848.005092
+Kp = -0.02, Ki = -0.04, Kd = -0.02; error = 410370843.513000
+Kp = -0.03, Ki = -0.04, Kd = -0.02; error = 406750675.174943
+Kp = -0.04, Ki = -0.04, Kd = -0.02; error = 396104424.785715
+Kp = -0.05, Ki = -0.04, Kd = -0.02; error = 404222778.655444
+Kp = 0.00, Ki = -0.04, Kd = -0.03; error = 402766723.921757
+Kp = -0.01, Ki = -0.04, Kd = -0.03; error = 406769529.836625
+Kp = -0.02, Ki = -0.04, Kd = -0.03; error = 388707884.459826
+Kp = -0.03, Ki = -0.04, Kd = -0.03; error = 385343444.579578
+Kp = -0.04, Ki = -0.04, Kd = -0.03; error = 364332325.439923
+Kp = -0.05, Ki = -0.04, Kd = -0.03; error = 388445715.442159
+Kp = 0.00, Ki = -0.04, Kd = -0.04; error = 412948141.789573
+Kp = -0.01, Ki = -0.04, Kd = -0.04; error = 381292676.219455
+Kp = -0.02, Ki = -0.04, Kd = -0.04; error = 351715248.601529
+Kp = -0.03, Ki = -0.04, Kd = -0.04; error = 385343444.579578
+Kp = -0.04, Ki = -0.04, Kd = -0.04; error = 339766736.619160
+Kp = -0.05, Ki = -0.04, Kd = -0.04; error = 388445715.442159
+Kp = 0.00, Ki = -0.04, Kd = -0.05; error = 413063794.528236
+Kp = -0.01, Ki = -0.04, Kd = -0.05; error = 340094810.881576
+Kp = -0.02, Ki = -0.04, Kd = -0.05; error = 299175791.353792
+Kp = -0.03, Ki = -0.04, Kd = -0.05; error = 385343444.579578
+Kp = -0.04, Ki = -0.04, Kd = -0.05; error = 328361044.403883
+Kp = -0.05, Ki = -0.04, Kd = -0.05; error = 388445715.442159
+Kp = 0.00, Ki = -0.05, Kd = 0.00; error = -121398068.331226
+Kp = -0.01, Ki = -0.05, Kd = 0.00; error = -118428319.700475
+Kp = -0.02, Ki = -0.05, Kd = 0.00; error = -281771869.542968
+Kp = -0.03, Ki = -0.05, Kd = 0.00; error = -384338539.219647
+Kp = -0.04, Ki = -0.05, Kd = 0.00; error = -424308322.111191
+Kp = -0.05, Ki = -0.05, Kd = 0.00; error = -415996212.891665
+Kp = 0.00, Ki = -0.05, Kd = -0.01; error = -156642470.338686
+Kp = -0.01, Ki = -0.05, Kd = -0.01; error = -436105475.330931
+Kp = -0.02, Ki = -0.05, Kd = -0.01; error = 365167227.437632
+Kp = -0.03, Ki = -0.05, Kd = -0.01; error = 366868310.134537
+Kp = -0.04, Ki = -0.05, Kd = -0.01; error = 381254388.169234
+Kp = -0.05, Ki = -0.05, Kd = -0.01; error = -419734195.679396
+Kp = 0.00, Ki = -0.05, Kd = -0.02; error = -45239713.756483
+Kp = -0.01, Ki = -0.05, Kd = -0.02; error = 368303079.307436
+Kp = -0.02, Ki = -0.05, Kd = -0.02; error = 401443386.104491
+Kp = -0.03, Ki = -0.05, Kd = -0.02; error = 401535419.365779
+Kp = -0.04, Ki = -0.05, Kd = -0.02; error = 408120949.513967
+Kp = -0.05, Ki = -0.05, Kd = -0.02; error = -423160805.410881
+Kp = 0.00, Ki = -0.05, Kd = -0.03; error = 341108661.594410
+Kp = -0.01, Ki = -0.05, Kd = -0.03; error = 403814920.205065
+Kp = -0.02, Ki = -0.05, Kd = -0.03; error = 415918277.921849
+Kp = -0.03, Ki = -0.05, Kd = -0.03; error = 417036635.343037
+Kp = -0.04, Ki = -0.05, Kd = -0.03; error = 417738383.736703
+Kp = -0.05, Ki = -0.05, Kd = -0.03; error = -417212153.831334
+Kp = 0.00, Ki = -0.05, Kd = -0.04; error = 370523383.009863
+Kp = -0.01, Ki = -0.05, Kd = -0.04; error = 410263438.188656
+Kp = -0.02, Ki = -0.05, Kd = -0.04; error = 411707311.010572
+Kp = -0.03, Ki = -0.05, Kd = -0.04; error = 417091647.929650
+Kp = -0.04, Ki = -0.05, Kd = -0.04; error = 411292368.048783
+Kp = -0.05, Ki = -0.05, Kd = -0.04; error = 407262083.610519
+Kp = 0.00, Ki = -0.05, Kd = -0.05; error = 370523383.009863
+Kp = -0.01, Ki = -0.05, Kd = -0.05; error = 410263438.188656
+Kp = -0.02, Ki = -0.05, Kd = -0.05; error = 409952915.460547
+Kp = -0.03, Ki = -0.05, Kd = -0.05; error = 417113077.877824
+Kp = -0.04, Ki = -0.05, Kd = -0.05; error = 389830416.149436
+Kp = -0.05, Ki = -0.05, Kd = -0.05; error = 417634563.975820

+ 8 - 0
src/CBD/CBD.py

@@ -255,6 +255,10 @@ class InputPortBlock(BaseBlock):
     def compute(self, curIteration):
         self.appendToSignal(self._parent.getInputSignal(curIteration, self.getBlockName()).value)
 
+    @property
+    def parent(self):
+        return self._parent
+
 
 class OutputPortBlock(BaseBlock):
     """
@@ -267,6 +271,10 @@ class OutputPortBlock(BaseBlock):
     def compute(self, curIteration):
         self.appendToSignal(self.getInputSignal(curIteration, "IN1").value)
 
+    @property
+    def parent(self):
+        return self._parent
+
 
 class WireBlock(BaseBlock):
     """

+ 18 - 24
src/CBD/lib/endpoints.py

@@ -18,7 +18,6 @@ class CollectorBlock(BaseBlock):
 	def __init__(self, block_name, input_ports, data=None):
 		BaseBlock.__init__(self, block_name, input_ports, [])
 		self._data = data
-		self.lock = Lock()
 
 	def compute(self, curIteration):
 		raise NotImplementedError()
@@ -34,11 +33,9 @@ class CollectorBlock(BaseBlock):
 	@property
 	def data(self):
 		"""
-		Property to obtain the internal data in a thread-safe manner.
+		Property to obtain the internal data.
 		"""
-		with self.lock:
-			res = self._data
-		return res
+		return self._data
 
 
 class SignalCollectorBlock(CollectorBlock):
@@ -56,12 +53,11 @@ class SignalCollectorBlock(CollectorBlock):
 		self.buffer_size = buffer_size
 
 	def compute(self, curIteration):
-		with self.lock:
-			time = self.getClock().getTime()
-			value = self.getInputSignal(curIteration, "IN1").value
-			self._data.append((time, value))
-			if self.buffer_size > 0:
-				self._data = self._data[-self.buffer_size:]
+		time = self.getClock().getTime()
+		value = self.getInputSignal(curIteration, "IN1").value
+		self._data.append((time, value))
+		if self.buffer_size > 0:
+			self._data = self._data[-self.buffer_size:]
 
 	def clear(self):
 		self.data.clear()
@@ -92,12 +88,11 @@ class PositionCollectorBlock(CollectorBlock):
 		self.buffer_size = buffer_size
 
 	def compute(self, curIteration):
-		with self.lock:
-			x, y = self.getInputSignal(curIteration, "X").value, self.getInputSignal(curIteration, "Y").value
-			self.distance_travelled += self.distance_from_last(x, y)
-			self._data.append((x, y))
-			if self.buffer_size > 0:
-				self._data = self._data[-self.buffer_size:]
+		x, y = self.getInputSignal(curIteration, "X").value, self.getInputSignal(curIteration, "Y").value
+		self.distance_travelled += self.distance_from_last(x, y)
+		self._data.append((x, y))
+		if self.buffer_size > 0:
+			self._data = self._data[-self.buffer_size:]
 
 	def clear(self):
 		self.data.clear()
@@ -152,13 +147,12 @@ class StatisticsCollectorBlock(CollectorBlock):
 		self.clear()
 
 	def compute(self, curIteration):
-		with self.lock:
-			data = self.getInputSignal(curIteration, "IN1").value
-			self.data["count"] += 1
-			self.data["sum"] += data
-			self.data["sumOfSquares"] += data ** 2.0
-			self.data["min"] = min(self.data["min"], data)
-			self.data["max"] = max(self.data["max"], data)
+		data = self.getInputSignal(curIteration, "IN1").value
+		self.data["count"] += 1
+		self.data["sum"] += data
+		self.data["sumOfSquares"] += data ** 2.0
+		self.data["min"] = min(self.data["min"], data)
+		self.data["max"] = max(self.data["max"], data)
 
 	def clear(self):
 		"""

+ 14 - 0
src/CBD/lib/std.py

@@ -318,6 +318,20 @@ class TimeBlock(BaseBlock):
 		self.appendToSignal(time - self.getClock().getStartTime(), "relative")
 
 
+class DeltaTBlock(BaseBlock):
+	"""
+	Outputs the current time delta of the simulation.
+
+	This will be a constant for Fixed step sizes, but for variable step sizes,
+	the output will vary.
+	"""
+	def __init__(self, block_name):
+		BaseBlock.__init__(self, block_name, [], ["OUT1"])
+
+	def compute(self, curIteration):
+		self.appendToSignal(self.getClock().getDeltaT(), "OUT1")
+
+
 class LoggingBlock(BaseBlock):
 	"""
 	A simple Logging block

+ 237 - 0
src/CBD/stepsize.py

@@ -187,4 +187,241 @@ class Euler2Alt(StepSize):
 class RKF45(StepSize): pass
 
 
+class ButcherTableau:
+	r"""
+	Mnemonic device to store the Runge-Kutta matrix, weights and nodes in
+	the computation of generic RK methods. The extended tableau also allows
+	for the error computation for adaptive step sizes. The general form of
+	a Butcher Tableau is shown below, where:
+
+	* :math:`s` identifies the number of stages;
+	* :math:`a_{ij}, 1 \leq j < i \leq s` represents a coefficient in the
+	  Runge-Kutta matrix;
+	* :math:`b_i` and :math:`b^*_i` correspond to the weights of a higher
+	  and a lower order method, respectively; and
+	* :math:`c_i` specifies the nodes.
+
+	.. math::
+
+		\begin{array}
+			{c|ccccc}
+			0\\
+			c_2 & a_{2,1}\\
+			c_3 & a_{3,1} & a_{3,2} \\
+			\vdots & \vdots & & \ddots\\
+			c_s & a_{s,1} & a_{s,2} & \cdots & a_{s,s-1}\\
+			\hline
+			& b_1 & b_2 & \cdots & b_{s-1} & b_s\\
+			& b^*_1 & b^*_2 & \cdots & b^*_{s-1} & b^*_s\\
+		\end{array}
+
+	Args:
+		rows (iter):    Sequence of tuples :math:`(c_i, [a_{i, j}\vert 1 \leq j < i])`.
+						When :code:`None`, nothing will be added.
+		weights (iter): Sequence of sequences of weights :math:`[b_{i}\vert i \leq s]`.
+						When :code:`None`, no weights will be added.
+	"""
+	def __init__(self, rows=None, weights=None):
+		self._matrix = []
+		self._weights = []
+		self._nodes = [0]
+
+		if rows is not None:
+			for node, mtx in rows:
+				self.addRow(node, mtx)
+			if weights is not None:
+				for w in weights:
+					self.addWeights(w)
+
+	def addRow(self, node, elems):
+		r"""
+		Adds a :math:`c_i` and :math:`a_{i, j}` to the tableau.
+
+		Args:
+			node (numeric): The :math:`c_i`-value.
+			elems (iter):   :math:`a_{i, j}`, :math:`\forall j < i`; i.e. the
+							sequence of matrix elements that correspond to the node.
+		"""
+		if len(self._nodes) != len(elems):
+			raise ValueError("Inconsistent matrix! Expected row with %d elements!" % len(self._nodes))
+		self._nodes.append(node)
+		self._matrix.append(elems)
+
+	def addWeights(self, *weights):
+		"""
+		Adds a row of weights to the bottom of the matrix.
+
+		Args:
+			*weights:   A sequence of the weights. I.e. :math:`b_{i}`, where :math:`1 \leq i \leq s`.
+		"""
+		if len(self._matrix) == 0 or (len(self._matrix[-1]) + 1) != len(weights):
+			raise ValueError("Trying to set weights on incomplete matrix")
+		if len(self._weights) == 2:
+			raise ValueError("Maximal amount of weight rows (2) reached.")
+		self._weights.append(weights)
+
+	def getNodes(self):
+		"""
+		Obtains the nodes, i.e. the :math:`c_i`-values.
+		"""
+		return self._nodes
+
+	def getWeights(self):
+		"""
+		Obtains the weight lists, i.e. the :math:`b_i` and :math:`b^*_i`-values.
+		"""
+		return self._weights
+
+	@staticmethod
+	def EulerHeun():
+		r"""
+		Creates and returns the extended Butcher Tableau for Heun's method,
+		with the Euler method. The Tableau is as follows:
+
+		.. math::
+
+			\begin{array}
+				{c|cc}
+				0\\
+				1 & 1\\
+				\hline
+				& 1/2 & 1/2\\
+				&   1 &   0\\
+			\end{array}
+		"""
+		tab = ButcherTableau()
+		tab.addRow(1, [1])
+		tab.addWeights(1/2, 1/2)
+		tab.addWeights(  1,   0)
+		return tab
+
+	# TODO:
+	#  - Ralston-Euler (https://en.wikipedia.org/wiki/Heun%27s_method)
+	#  - Midpoint-Euler
+	#  - RK4 (Default method)
+	#  - RKF45 (https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta%E2%80%93Fehlberg_method)
+	#  - DOPRI (https://en.wikipedia.org/wiki/Dormand%E2%80%93Prince_method)
+	#  - RKCK (https://en.wikipedia.org/wiki/Cash%E2%80%93Karp_method)
+	#  - Bogacki-Shampine https://en.wikipedia.org/wiki/Bogacki%E2%80%93Shampine_method
+
+
+class RungeKutta(StepSize):
+	r"""
+	Applies the Runge-Kutta algorithm on a specific :class:`ButcherTableau`.
+
+	Internally, a set of :math:`k_i` values will be computed, based on the
+	tableau. From there, an error :math:`e` can be obtained. If this error
+	exceeds :attr:`epsilon`, :math:`\delta t` is increased. The formulas
+	are as follows:
+
+	.. math::
+		\begin{align}
+			k_i &= f\left(t_n + h\cdot c_i, y_n + h\sum_{j=1}^{s-1}\left(a_{i,j}\cdot k_j\right)\right)\\
+			e &= h\sum_{i=1}^s \left(b_i - b^*_i\right) k_i\\
+			\delta t_{new} &= \delta t_{old}\cdot\dfrac{0.9\cdot\epsilon}{e}
+		\end{align}
+
+	Args:
+		delta_t (numeric):          Initial delta.
+		tableau (ButcherTableau):   The tableau to use.
+		tol1 (numeric):             Smallest allowed error value when decreasing delta.
+		tol2 (numeric):             Largest allowed error value when increasing delta.
+		min_change (numeric):       Minimal change for the delta to experience.
+		max_change (numeric):       Maximal change for the delta to experience.
+
+	Note:
+		If there are multiple outputs in a model, the most pessimistic view
+		will be used, i.e. the largest error.
+
+	See Also:
+		https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods
+	"""
+	def __init__(self, delta_t, tableau, tol1, tol2, min_change=0.3, max_change=2):
+		StepSize.__init__(self, delta_t)
+		self._tableau = tableau
+		self._tol1 = tol1
+		self._tol2 = tol2
+		self._change = min_change, max_change
+		self._prev = None
+
+	def getNextStepSize(self, sim):
+		A1 = sim.model.getSignals()
+
+		K = []
+		for n in self._tableau.getNodes():
+			K.append(self.derivative(sim, n * self.delta_t))
+
+		E = {}
+		b, b_ = self._tableau.getWeights()
+		s = len(b)
+		for k in A1.keys():
+			e = 0
+			for i in range(s):
+				e += K[i][k] * (b[i] - b_[i])
+			E[k] = abs(e)
+		TE = max(E.values())
+
+		# TODO: going larger => HOW?
+		# TODO: update formulas in docs
+		if TE > self._tol1:
+			self.delta_t *= 0.9 * min(max((self._tol1 / TE) ** (1 / (s - 1)), self._change[0]), self._change[1])
+			# self.delta_t *= 0.9 * ((self._epsilon / TE) ** (1/(s-1)))
+			if self._prev is None or abs(self._prev - self.delta_t) > 1e-6:
+				self._prev = self.delta_t
+				return self.getNextStepSize(sim)
+		if TE < self._tol2:
+			self.delta_t /= 0.9 * min(max((TE / self._tol2) ** (1 / (s - 1)), self._change[0]), self._change[1])
+			# self.delta_t = self.delta_t * 2 + self._tol2
+			return self.getNextStepSize(sim)
+
+		self._prev = None
+		return self.delta_t
+
+	def derivative(self, sim, delta):
+		"""
+		Computes the derivative; i.e. the :math:`f(t, y)`-function, which is the derivative definition
+		for an initial-value problem. The derivative is computed as a backwards euler difference
+		between :math:`t+\delta` and :math:`t`.
+
+		Args:
+			sim (CBD.simulator.Simulator):  The simulation to compute the step size of.
+			delta (numeric):                The :math:`\delta` value of the next point.
+
+		Note:
+			Given that a CBD model represents the integrated version of the :math:`f(t, y)`-function,
+			the :math:`y` parameter will be assumed to be set implicitly. It is henceforth ignored.
+		"""
+		A1 = _copy_state(sim.model.getSignals())
+
+		sim.setStepSize(Fixed(delta))
+		sim._update_clock()
+		sim._do_single_step()
+		A2 = _copy_state(sim.model.getSignals())
+
+		sim._step_back()
+
+		sim.setStepSize(self)
+
+		res = {}
+		for key in A2.keys():
+			if delta <= 1e-6:
+				res[key] = 0
+			else:
+				res[key] = (A2[key][-1].value - A1[key][-1].value)
+
+		return res
+
+
+def _copy_state(D):
+	"""
+	Helper function that is an efficient version of deepcopy,
+	by only getting the required data. The data is a dictionary
+	of :code:`id -> list`, where the two last items of the list
+	are of importance.
+
+	Args:
+		D (dict):   A dictionary of lists.
+	"""
+	return {k: v[-2:] for k, v in D.items()}
+
 from .simulator import Simulator