Commits

Takafumi Arakaki  committed 41214fe

railgun/a95f0e25f5bf

  • Participants
  • Parent commits 752ff52

Comments (0)

Files changed (16)

File railgun-doc/_images/run3.pdf

Binary file added.

File railgun-doc/_images/run3.png

Added
New image

File railgun-doc/_images/run_debug3.pdf

Binary file added.

File railgun-doc/_images/run_debug3.png

Added
New image

File railgun-doc/_sources/samples/index.txt

    :glob:
 
    lode/*
+   lode_rk4/*
    */*

File railgun-doc/_sources/samples/lode_rk4/lode_rk4.txt

+Runge-Kutta method (usage of :attr:`_cmemsubsets_`)
+===================================================
+
+Python code (``lode_rk4.py``)
+-----------------------------
+
+.. literalinclude:: lode_rk4.py
+   :language: python
+
+C code (``lode_rk4.c``)
+-----------------------
+.. literalinclude:: lode_rk4.c
+   :language: c
+
+Running without intermediate variables
+--------------------------------------
+.. literalinclude:: run.py
+   :language: python
+
+.. plot:: source/samples/lode_rk4/run.py
+
+
+Running with intermediate variables
+-----------------------------------
+.. literalinclude:: run_debug.py
+   :language: python
+
+.. plot:: source/samples/lode_rk4/run_debug.py

File railgun-doc/_sources/simobj.txt

       Definition of subset of C members for controlling which
       C members to be loaded. Example::
 
-          { 'name1': { 'cfuncs': ['f', 'g', 'h'], 'cmems': ['x', 'y'] },
-            'name2': { 'cfuncs': ['f', 'j', 'k'], 'cmems': ['y', 'z'] } }
+          { 'name1': { 'funcs': ['f', 'g', 'h'], 'members': ['x', 'y'] },
+            'name2': { 'funcs': ['f', 'j', 'k'], 'members': ['y', 'z'] } }
 
       Here, ``name1, name2`` are the name of C member subset,
       ``f, g, h, j, k`` are the name of C functions, and

File railgun-doc/index.html

 <li class="toctree-l1"><a class="reference internal" href="utils.html">Utility functions</a></li>
 <li class="toctree-l1"><a class="reference internal" href="samples/index.html">Samples</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="samples/lode/lode.html">Linear Ordinary Differential Equation</a></li>
+<li class="toctree-l2"><a class="reference internal" href="samples/lode_rk4/lode_rk4.html">Runge-Kutta method (usage of <tt class="docutils literal"><span class="pre">_cmemsubsets_</span></tt>)</a></li>
 <li class="toctree-l2"><a class="reference internal" href="samples/kaplan_yorke_map/kaplan_yorke_map.html">Kaplan-Yorke map</a></li>
 </ul>
 </li>

File railgun-doc/objects.inv

File contents unchanged.

File railgun-doc/py-modindex.html

      <tr>
        <td></td>
        <td>
-       <a href="utils.html#module-railgun"><tt class="xref">railgun</tt></a></td><td>
+       <a href="simobj.html#module-railgun"><tt class="xref">railgun</tt></a></td><td>
        <em></em></td></tr>
    </table>
 

File railgun-doc/samples/index.html

 <li class="toctree-l2"><a class="reference internal" href="lode/lode.html#using-simobject-cfuncprefix">Using <tt class="docutils literal"><span class="pre">SimObject._cfuncprefix_</span></tt></a></li>
 </ul>
 </li>
+<li class="toctree-l1"><a class="reference internal" href="lode_rk4/lode_rk4.html">Runge-Kutta method (usage of <tt class="docutils literal"><span class="pre">_cmemsubsets_</span></tt>)</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#python-code-lode-rk4-py">Python code (<tt class="docutils literal"><span class="pre">lode_rk4.py</span></tt>)</a></li>
+<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#c-code-lode-rk4-c">C code (<tt class="docutils literal"><span class="pre">lode_rk4.c</span></tt>)</a></li>
+<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#running-without-intermediate-variables">Running without intermediate variables</a></li>
+<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#running-with-intermediate-variables">Running with intermediate variables</a></li>
+</ul>
+</li>
 <li class="toctree-l1"><a class="reference internal" href="kaplan_yorke_map/kaplan_yorke_map.html">Kaplan-Yorke map</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="kaplan_yorke_map/kaplan_yorke_map.html#output">Output</a></li>
 <li class="toctree-l2"><a class="reference internal" href="kaplan_yorke_map/kaplan_yorke_map.html#python-code">Python code</a></li>

File railgun-doc/samples/kaplan_yorke_map/kaplan_yorke_map.html

     <script type="text/javascript" src="../../_static/doctools.js"></script>
     <link rel="top" title="RailGun v0.1.1 documentation" href="../../index.html" />
     <link rel="up" title="Samples" href="../index.html" />
-    <link rel="prev" title="Linear Ordinary Differential Equation" href="../lode/lode.html" /> 
+    <link rel="prev" title="Runge-Kutta method (usage of _cmemsubsets_)" href="../lode_rk4/lode_rk4.html" /> 
   </head>
   <body>
     <div class="related">
           <a href="../../py-modindex.html" title="Python Module Index"
              >modules</a> |</li>
         <li class="right" >
-          <a href="../lode/lode.html" title="Linear Ordinary Differential Equation"
+          <a href="../lode_rk4/lode_rk4.html" title="Runge-Kutta method (usage of _cmemsubsets_)"
              accesskey="P">previous</a> |</li>
         <li><a href="../../index.html">RailGun v0.1.1 documentation</a> &raquo;</li>
           <li><a href="../index.html" accesskey="U">Samples</a> &raquo;</li> 
 </ul>
 
   <h4>Previous topic</h4>
-  <p class="topless"><a href="../lode/lode.html"
-                        title="previous chapter">Linear Ordinary Differential Equation</a></p>
+  <p class="topless"><a href="../lode_rk4/lode_rk4.html"
+                        title="previous chapter">Runge-Kutta method (usage of <tt class="docutils literal"><span class="pre">_cmemsubsets_</span></tt>)</a></p>
   <h3>This Page</h3>
   <ul class="this-page-menu">
     <li><a href="../../_sources/samples/kaplan_yorke_map/kaplan_yorke_map.txt"
           <a href="../../py-modindex.html" title="Python Module Index"
              >modules</a> |</li>
         <li class="right" >
-          <a href="../lode/lode.html" title="Linear Ordinary Differential Equation"
+          <a href="../lode_rk4/lode_rk4.html" title="Runge-Kutta method (usage of _cmemsubsets_)"
              >previous</a> |</li>
         <li><a href="../../index.html">RailGun v0.1.1 documentation</a> &raquo;</li>
           <li><a href="../index.html" >Samples</a> &raquo;</li> 

File railgun-doc/samples/lode/lode.html

     <script type="text/javascript" src="../../_static/doctools.js"></script>
     <link rel="top" title="RailGun v0.1.1 documentation" href="../../index.html" />
     <link rel="up" title="Samples" href="../index.html" />
-    <link rel="next" title="Kaplan-Yorke map" href="../kaplan_yorke_map/kaplan_yorke_map.html" />
+    <link rel="next" title="Runge-Kutta method (usage of _cmemsubsets_)" href="../lode_rk4/lode_rk4.html" />
     <link rel="prev" title="Samples" href="../index.html" /> 
   </head>
   <body>
           <a href="../../py-modindex.html" title="Python Module Index"
              >modules</a> |</li>
         <li class="right" >
-          <a href="../kaplan_yorke_map/kaplan_yorke_map.html" title="Kaplan-Yorke map"
+          <a href="../lode_rk4/lode_rk4.html" title="Runge-Kutta method (usage of _cmemsubsets_)"
              accesskey="N">next</a> |</li>
         <li class="right" >
           <a href="../index.html" title="Samples"
   <p class="topless"><a href="../index.html"
                         title="previous chapter">Samples</a></p>
   <h4>Next topic</h4>
-  <p class="topless"><a href="../kaplan_yorke_map/kaplan_yorke_map.html"
-                        title="next chapter">Kaplan-Yorke map</a></p>
+  <p class="topless"><a href="../lode_rk4/lode_rk4.html"
+                        title="next chapter">Runge-Kutta method (usage of <tt class="docutils literal docutils literal"><span class="pre">_cmemsubsets_</span></tt>)</a></p>
   <h3>This Page</h3>
   <ul class="this-page-menu">
     <li><a href="../../_sources/samples/lode/lode.txt"
           <a href="../../py-modindex.html" title="Python Module Index"
              >modules</a> |</li>
         <li class="right" >
-          <a href="../kaplan_yorke_map/kaplan_yorke_map.html" title="Kaplan-Yorke map"
+          <a href="../lode_rk4/lode_rk4.html" title="Runge-Kutta method (usage of _cmemsubsets_)"
              >next</a> |</li>
         <li class="right" >
           <a href="../index.html" title="Samples"

File railgun-doc/samples/lode_rk4/lode_rk4.html

+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Runge-Kutta method (usage of _cmemsubsets_) &mdash; RailGun v0.1.1 documentation</title>
+    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../',
+        VERSION:     '0.1.1',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </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>
+    <link rel="top" title="RailGun v0.1.1 documentation" href="../../index.html" />
+    <link rel="up" title="Samples" href="../index.html" />
+    <link rel="next" title="Kaplan-Yorke map" href="../kaplan_yorke_map/kaplan_yorke_map.html" />
+    <link rel="prev" title="Linear Ordinary Differential Equation" href="../lode/lode.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li class="right" >
+          <a href="../kaplan_yorke_map/kaplan_yorke_map.html" title="Kaplan-Yorke map"
+             accesskey="N">next</a> |</li>
+        <li class="right" >
+          <a href="../lode/lode.html" title="Linear Ordinary Differential Equation"
+             accesskey="P">previous</a> |</li>
+        <li><a href="../../index.html">RailGun v0.1.1 documentation</a> &raquo;</li>
+          <li><a href="../index.html" accesskey="U">Samples</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <div class="section" id="runge-kutta-method-usage-of-cmemsubsets">
+<h1>Runge-Kutta method (usage of <tt class="xref py py-attr docutils literal"><span class="pre">_cmemsubsets_</span></tt>)<a class="headerlink" href="#runge-kutta-method-usage-of-cmemsubsets" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="python-code-lode-rk4-py">
+<h2>Python code (<tt class="docutils literal"><span class="pre">lode_rk4.py</span></tt>)<a class="headerlink" href="#python-code-lode-rk4-py" title="Permalink to this headline">¶</a></h2>
+<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">railgun</span> <span class="kn">import</span> <span class="n">SimObject</span><span class="p">,</span> <span class="n">relpath</span><span class="p">,</span> <span class="n">cm</span>
+
+
+<span class="k">class</span> <span class="nc">LinearODERK4</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Solve D-dimensional linear ODE using the Runge-Kutta method</span>
+
+<span class="sd">    Equation::</span>
+
+<span class="sd">        dX/dt(t) = A X(t)</span>
+<span class="sd">        X: D-dimensional vector</span>
+<span class="sd">        A: DxD matrix</span>
+
+<span class="sd">    &quot;&quot;&quot;</span>
+
+    <span class="n">_clibname_</span> <span class="o">=</span> <span class="s">&#39;liblode_rk4.so&#39;</span>  <span class="c"># name of shared library</span>
+    <span class="n">_clibdir_</span> <span class="o">=</span> <span class="n">relpath</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">,</span> <span class="n">__file__</span><span class="p">)</span>  <span class="c"># library directory</span>
+    <span class="n">_cmembers_</span> <span class="o">=</span> <span class="p">[</span>  <span class="c"># declaring members of struct</span>
+        <span class="s">&#39;num_d&#39;</span><span class="p">,</span>  <span class="c"># num_* as size of array (no need to write `int`)</span>
+        <span class="s">&#39;num_s&#39;</span><span class="p">,</span>  <span class="c"># setting default value</span>
+        <span class="s">&#39;double dt = 0.001&#39;</span><span class="p">,</span>
+        <span class="s">&#39;double a[d][d]&#39;</span><span class="p">,</span>  <span class="c"># num_d x num_d array</span>
+        <span class="s">&#39;double x[s][d]&#39;</span><span class="p">,</span>  <span class="c"># num_s x num_d array</span>
+    <span class="p">]</span> <span class="o">+</span> <span class="p">(</span>
+        <span class="n">cm</span><span class="o">.</span><span class="n">double</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="s">&#39;k</span><span class="si">%s</span><span class="s">[d]&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;1234&#39;</span><span class="p">])</span> <span class="o">+</span>
+        <span class="n">cm</span><span class="o">.</span><span class="n">double</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="s">&#39;x</span><span class="si">%s</span><span class="s">[d]&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;123&#39;</span><span class="p">])</span> <span class="o">+</span>
+        <span class="n">cm</span><span class="o">.</span><span class="n">double</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="s">&#39;k</span><span class="si">%s</span><span class="s">_debug[s][d]&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;1234&#39;</span><span class="p">])</span> <span class="o">+</span>
+        <span class="n">cm</span><span class="o">.</span><span class="n">double</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="s">&#39;x</span><span class="si">%s</span><span class="s">_debug[s][d]&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;123&#39;</span><span class="p">])</span>
+    <span class="p">)</span>
+    <span class="n">_cfuncs_</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;x run_{level | normal, debug }()&quot;</span><span class="p">]</span>
+    <span class="n">_cmemsubsets_</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span>
+        <span class="n">debug</span><span class="o">=</span><span class="nb">dict</span><span class="p">(</span>
+            <span class="n">funcs</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;run_debug&#39;</span><span class="p">],</span>
+            <span class="n">members</span><span class="o">=</span><span class="p">([</span><span class="s">&#39;k</span><span class="si">%s</span><span class="s">_debug&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;1234&#39;</span><span class="p">]</span> <span class="o">+</span>
+                     <span class="p">[</span><span class="s">&#39;x</span><span class="si">%s</span><span class="s">_debug&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;123&#39;</span><span class="p">])),</span>
+        <span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">plot_x</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="kn">import</span> <span class="nn">pylab</span>
+        <span class="n">t</span> <span class="o">=</span> <span class="n">pylab</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">num_s</span><span class="p">)</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">dt</span>
+
+        <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">num_d</span><span class="p">):</span>
+            <span class="n">pylab</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">[:,</span><span class="n">d</span><span class="p">],</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;x</span><span class="si">%s</span><span class="s">&#39;</span><span class="o">%</span> <span class="n">d</span><span class="p">)</span>
+        <span class="n">pylab</span><span class="o">.</span><span class="n">legend</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">plot_k</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="kn">import</span> <span class="nn">pylab</span>
+        <span class="n">t</span> <span class="o">=</span> <span class="n">pylab</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">num_s</span><span class="p">)</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">dt</span>
+        <span class="n">klist</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">getv</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="s">&#39;k</span><span class="si">%s</span><span class="s">_debug&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;1234&#39;</span><span class="p">])</span>
+
+        <span class="k">for</span> <span class="n">d</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">num_d</span><span class="p">):</span>
+            <span class="k">for</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">klist</span><span class="p">):</span>
+                <span class="n">pylab</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="n">k</span><span class="p">[:,</span><span class="n">d</span><span class="p">],</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;k</span><span class="si">%s</span><span class="s">_</span><span class="si">%s</span><span class="s">&#39;</span><span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">d</span><span class="p">))</span>
+        <span class="n">pylab</span><span class="o">.</span><span class="n">legend</span><span class="p">()</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="c-code-lode-rk4-c">
+<h2>C code (<tt class="docutils literal"><span class="pre">lode_rk4.c</span></tt>)<a class="headerlink" href="#c-code-lode-rk4-c" title="Permalink to this headline">¶</a></h2>
+<div class="highlight-c"><div class="highlight"><pre><span class="k">typedef</span> <span class="k">struct</span> <span class="n">linearoderk4_</span><span class="p">{</span>
+  <span class="kt">int</span> <span class="n">num_d</span><span class="p">,</span> <span class="n">num_s</span><span class="p">;</span>
+  <span class="kt">double</span> <span class="n">dt</span><span class="p">;</span>
+  <span class="kt">double</span> <span class="o">**</span><span class="n">a</span><span class="p">,</span> <span class="o">**</span><span class="n">x</span><span class="p">;</span>
+  <span class="kt">double</span> <span class="o">*</span><span class="n">k1</span><span class="p">,</span> <span class="o">*</span><span class="n">k2</span><span class="p">,</span> <span class="o">*</span><span class="n">k3</span><span class="p">,</span> <span class="o">*</span><span class="n">k4</span><span class="p">,</span> <span class="o">*</span><span class="n">x1</span><span class="p">,</span> <span class="o">*</span><span class="n">x2</span><span class="p">,</span> <span class="o">*</span><span class="n">x3</span><span class="p">;</span>
+  <span class="kt">double</span> <span class="o">**</span><span class="n">k1_debug</span><span class="p">,</span> <span class="o">**</span><span class="n">k2_debug</span><span class="p">,</span> <span class="o">**</span><span class="n">k3_debug</span><span class="p">,</span> <span class="o">**</span><span class="n">k4_debug</span><span class="p">,</span>
+    <span class="o">**</span><span class="n">x1_debug</span><span class="p">,</span> <span class="o">**</span><span class="n">x2_debug</span><span class="p">,</span> <span class="o">**</span><span class="n">x3_debug</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">LinearODERK4</span><span class="p">;</span>
+
+
+<span class="kt">void</span> <span class="nf">calc_f</span><span class="p">(</span><span class="kt">double</span> <span class="o">*</span><span class="n">y</span><span class="p">,</span> <span class="kt">double</span> <span class="o">*</span><span class="n">x</span><span class="p">,</span> <span class="kt">double</span> <span class="o">**</span><span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">num_d</span><span class="p">)</span>
+<span class="p">{</span>
+  <span class="kt">int</span> <span class="n">d1</span><span class="p">,</span> <span class="n">d2</span><span class="p">;</span>
+
+  <span class="k">for</span> <span class="p">(</span><span class="n">d1</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">d1</span> <span class="o">&lt;</span> <span class="n">num_d</span><span class="p">;</span> <span class="o">++</span><span class="n">d1</span><span class="p">){</span>
+    <span class="n">y</span><span class="p">[</span><span class="n">d1</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+    <span class="k">for</span> <span class="p">(</span><span class="n">d2</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">d2</span> <span class="o">&lt;</span> <span class="n">num_d</span><span class="p">;</span> <span class="o">++</span><span class="n">d2</span><span class="p">){</span>
+      <span class="n">y</span><span class="p">[</span><span class="n">d1</span><span class="p">]</span> <span class="o">+=</span> <span class="n">a</span><span class="p">[</span><span class="n">d1</span><span class="p">][</span><span class="n">d2</span><span class="p">]</span> <span class="o">*</span> <span class="n">x</span><span class="p">[</span><span class="n">d2</span><span class="p">];</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="kt">void</span> <span class="nf">calc_xi</span><span class="p">(</span><span class="kt">double</span> <span class="o">*</span><span class="n">xi</span><span class="p">,</span> <span class="kt">double</span> <span class="o">*</span><span class="n">x0</span><span class="p">,</span> <span class="kt">double</span> <span class="o">*</span><span class="n">ki</span><span class="p">,</span> <span class="kt">double</span> <span class="n">c</span><span class="p">,</span> <span class="kt">double</span> <span class="n">dt</span><span class="p">,</span>
+             <span class="kt">int</span> <span class="n">num_d</span><span class="p">)</span>
+<span class="p">{</span>
+  <span class="kt">int</span> <span class="n">d</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">d</span> <span class="o">&lt;</span> <span class="n">num_d</span><span class="p">;</span> <span class="o">++</span><span class="n">d</span><span class="p">){</span>
+    <span class="n">xi</span><span class="p">[</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">x0</span><span class="p">[</span><span class="n">d</span><span class="p">]</span> <span class="o">+</span> <span class="n">dt</span> <span class="o">*</span> <span class="n">c</span> <span class="o">*</span> <span class="n">ki</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+
+<span class="kt">void</span> <span class="nf">iterate_once</span><span class="p">(</span><span class="n">LinearODERK4</span> <span class="o">*</span><span class="n">self</span><span class="p">,</span> <span class="kt">int</span> <span class="n">s</span><span class="p">)</span>
+<span class="p">{</span>
+  <span class="kt">int</span> <span class="n">d</span><span class="p">;</span>
+  <span class="kt">double</span> <span class="o">*</span><span class="n">x0</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">x</span><span class="p">[</span><span class="n">s</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
+
+  <span class="n">calc_f</span><span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">k1</span><span class="p">,</span> <span class="n">x0</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">a</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">);</span>
+  <span class="n">calc_xi</span><span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">x1</span><span class="p">,</span> <span class="n">x0</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k1</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">dt</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">);</span>
+  <span class="n">calc_f</span><span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">k2</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">x1</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">a</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">);</span>
+  <span class="n">calc_xi</span><span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">x2</span><span class="p">,</span> <span class="n">x0</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k2</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">dt</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">);</span>
+  <span class="n">calc_f</span><span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">k3</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">x2</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">a</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">);</span>
+  <span class="n">calc_xi</span><span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">x3</span><span class="p">,</span> <span class="n">x0</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">dt</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">);</span>
+  <span class="n">calc_f</span><span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">k4</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">x3</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">a</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">);</span>
+
+  <span class="k">for</span> <span class="p">(</span><span class="n">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">d</span> <span class="o">&lt;</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">;</span> <span class="o">++</span><span class="n">d</span><span class="p">){</span>
+    <span class="n">self</span><span class="o">-&gt;</span><span class="n">x</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">x0</span><span class="p">[</span><span class="n">d</span><span class="p">]</span> <span class="o">+</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">dt</span> <span class="o">/</span> <span class="mi">6</span> <span class="o">*</span>
+      <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">k1</span><span class="p">[</span><span class="n">d</span><span class="p">]</span> <span class="o">+</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k2</span><span class="p">[</span><span class="n">d</span><span class="p">]</span> <span class="o">+</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k3</span><span class="p">[</span><span class="n">d</span><span class="p">]</span> <span class="o">+</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k4</span><span class="p">[</span><span class="n">d</span><span class="p">]);</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+
+<span class="kt">int</span> <span class="nf">LinearODERK4_run_normal</span><span class="p">(</span><span class="n">LinearODERK4</span> <span class="o">*</span><span class="n">self</span><span class="p">)</span>
+<span class="p">{</span>
+  <span class="kt">int</span> <span class="n">s</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">s</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">s</span> <span class="o">&lt;</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_s</span><span class="p">;</span> <span class="o">++</span><span class="n">s</span><span class="p">){</span>
+    <span class="n">iterate_once</span><span class="p">(</span><span class="n">self</span><span class="p">,</span> <span class="n">s</span><span class="p">);</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+
+<span class="kt">int</span> <span class="nf">LinearODERK4_run_debug</span><span class="p">(</span><span class="n">LinearODERK4</span> <span class="o">*</span><span class="n">self</span><span class="p">)</span>
+<span class="p">{</span>
+  <span class="kt">int</span> <span class="n">s</span><span class="p">,</span> <span class="n">d</span><span class="p">;</span>
+  <span class="k">for</span> <span class="p">(</span><span class="n">s</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">s</span> <span class="o">&lt;</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_s</span><span class="p">;</span> <span class="o">++</span><span class="n">s</span><span class="p">){</span>
+    <span class="n">iterate_once</span><span class="p">(</span><span class="n">self</span><span class="p">,</span> <span class="n">s</span><span class="p">);</span>
+    <span class="k">for</span> <span class="p">(</span><span class="n">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">d</span> <span class="o">&lt;</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">num_d</span><span class="p">;</span> <span class="o">++</span><span class="n">d</span><span class="p">){</span>
+      <span class="n">self</span><span class="o">-&gt;</span><span class="n">k1_debug</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k1</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+      <span class="n">self</span><span class="o">-&gt;</span><span class="n">k2_debug</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k2</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+      <span class="n">self</span><span class="o">-&gt;</span><span class="n">k3_debug</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k3</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+      <span class="n">self</span><span class="o">-&gt;</span><span class="n">k4_debug</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">k4</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+      <span class="n">self</span><span class="o">-&gt;</span><span class="n">x1_debug</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">x1</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+      <span class="n">self</span><span class="o">-&gt;</span><span class="n">x2_debug</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">x2</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+      <span class="n">self</span><span class="o">-&gt;</span><span class="n">x3_debug</span><span class="p">[</span><span class="n">s</span><span class="p">][</span><span class="n">d</span><span class="p">]</span> <span class="o">=</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">x3</span><span class="p">[</span><span class="n">d</span><span class="p">];</span>
+    <span class="p">}</span>
+  <span class="p">}</span>
+  <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="running-without-intermediate-variables">
+<h2>Running without intermediate variables<a class="headerlink" href="#running-without-intermediate-variables" title="Permalink to this headline">¶</a></h2>
+<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">lode_rk4</span> <span class="kn">import</span> <span class="n">LinearODERK4</span>
+
+<span class="n">lode</span> <span class="o">=</span> <span class="n">LinearODERK4</span><span class="p">(</span><span class="n">num_s</span><span class="o">=</span><span class="mi">10000</span><span class="p">,</span> <span class="n">num_d</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>  <span class="c"># access c-member &quot;VAR&quot; via lode.VAR</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">a</span> <span class="o">=</span> <span class="p">[[</span><span class="o">-</span><span class="mf">0.5</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]]</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>  <span class="c"># level=&#39;normal&#39;</span>
+
+<span class="kn">import</span> <span class="nn">pylab</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">plot_x</span><span class="p">()</span>
+<span class="n">pylab</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
+</pre></div>
+</div>
+<p>[<a class="reference external" href="../../plot_directive/samples/lode_rk4/run.py">source code</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run.hires.png">hires.png</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run.pdf">pdf</a>]</p>
+<div class="figure">
+<img alt="../../_images/run3.png" src="../../_images/run3.png" />
+</div>
+</div>
+<div class="section" id="running-with-intermediate-variables">
+<h2>Running with intermediate variables<a class="headerlink" href="#running-with-intermediate-variables" title="Permalink to this headline">¶</a></h2>
+<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">lode_rk4</span> <span class="kn">import</span> <span class="n">LinearODERK4</span>
+
+<span class="n">lode</span> <span class="o">=</span> <span class="n">LinearODERK4</span><span class="p">(</span><span class="n">num_s</span><span class="o">=</span><span class="mi">10000</span><span class="p">,</span> <span class="n">num_d</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">_cmemsubsets_debug</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>  <span class="c"># access c-member &quot;VAR&quot; via lode.VAR</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">a</span> <span class="o">=</span> <span class="p">[[</span><span class="o">-</span><span class="mf">0.5</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]]</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="s">&#39;debug&#39;</span><span class="p">)</span>
+
+<span class="kn">import</span> <span class="nn">pylab</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">plot_k</span><span class="p">()</span>
+<span class="n">pylab</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
+</pre></div>
+</div>
+<p>[<a class="reference external" href="../../plot_directive/samples/lode_rk4/run_debug.py">source code</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run_debug.hires.png">hires.png</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run_debug.pdf">pdf</a>]</p>
+<div class="figure">
+<img alt="../../_images/run_debug3.png" src="../../_images/run_debug3.png" />
+</div>
+</div>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+  <h3><a href="../../index.html">Table Of Contents</a></h3>
+  <ul>
+<li><a class="reference internal" href="#">Runge-Kutta method (usage of <tt class="docutils literal"><span class="pre">_cmemsubsets_</span></tt>)</a><ul>
+<li><a class="reference internal" href="#python-code-lode-rk4-py">Python code (<tt class="docutils literal"><span class="pre">lode_rk4.py</span></tt>)</a></li>
+<li><a class="reference internal" href="#c-code-lode-rk4-c">C code (<tt class="docutils literal"><span class="pre">lode_rk4.c</span></tt>)</a></li>
+<li><a class="reference internal" href="#running-without-intermediate-variables">Running without intermediate variables</a></li>
+<li><a class="reference internal" href="#running-with-intermediate-variables">Running with intermediate variables</a></li>
+</ul>
+</li>
+</ul>
+
+  <h4>Previous topic</h4>
+  <p class="topless"><a href="../lode/lode.html"
+                        title="previous chapter">Linear Ordinary Differential Equation</a></p>
+  <h4>Next topic</h4>
+  <p class="topless"><a href="../kaplan_yorke_map/kaplan_yorke_map.html"
+                        title="next chapter">Kaplan-Yorke map</a></p>
+  <h3>This Page</h3>
+  <ul class="this-page-menu">
+    <li><a href="../../_sources/samples/lode_rk4/lode_rk4.txt"
+           rel="nofollow">Show Source</a></li>
+  </ul>
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../search.html" method="get">
+      <input type="text" name="q" size="18" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li class="right" >
+          <a href="../kaplan_yorke_map/kaplan_yorke_map.html" title="Kaplan-Yorke map"
+             >next</a> |</li>
+        <li class="right" >
+          <a href="../lode/lode.html" title="Linear Ordinary Differential Equation"
+             >previous</a> |</li>
+        <li><a href="../../index.html">RailGun v0.1.1 documentation</a> &raquo;</li>
+          <li><a href="../index.html" >Samples</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2010, Takafumi Arakaki.
+      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
+    </div>
+  </body>
+</html>

File railgun-doc/searchindex.js

-Search.setIndex({objects:{"":{railgun:[2,0,1]},railgun:{cmems:[2,1,1],SimObject:[4,3,1],relpath:[2,1,1]},"railgun.SimObject":{"_cfuncs_":[4,2,1],"_cmemsubsets_":[4,2,1],setv:[4,4,1],"_cmembers_":[4,2,1],getv:[4,4,1],num:[4,4,1],"_clibdir_":[4,2,1],"_clibname_":[4,2,1],"_cfuncprefix_":[4,2,1],"_cstructname_":[4,2,1]}},terms:{all:[0,5],code:[1,0,3,6,5],name1:4,four:4,scalar:4,follow:[0,4],cython:0,myprefixfuncnam:4,func_:[4,5],program:[0,5],vec:4,liter:4,string:[4,5],c_doubl:4,util:[0,2],veri:0,c_int:4,level:0,list:[4,5],prefix:[4,6],vector:[4,6],refer:[1,3],pleas:6,upper:[5,6],your_modul:2,zero:5,pass:0,num_i2:4,run:[0,5,6],num_i1:4,index:[0,4,5,6],what:6,libkaplan_yorke_map:1,access:[0,4,5,6],version:6,order:[4,5],method:[4,5],func_spam:4,othernameforpyclass:4,christian:1,gener:[0,2,5],here:[0,4,5],satisfi:4,beck:1,let:[0,2],xt_0:1,path:[2,4,5],along:[4,5],"_clibdir_":[0,1,2,4,5,6],wait:5,search:0,figsiz:1,chang:5,linearordinarydifferentialequ:6,overrid:4,via:[0,6],although:0,dtype:[0,4],modul:[0,2,4,5],double_vector:4,kaplanyorkemap:1,instal:0,should:[4,5],plot:[1,0,6],from:[0,1,2,4,5,6],memori:0,doubl:[0,1,2,4,5,6],two:[4,5],next:0,liblode_cfuncprefix:6,call:[0,4,5],c_ushort:4,type:[5,0,2,4,6],notic:6,relative_path:2,warn:4,name2:4,c_float:4,hold:5,must:[4,5],uint64:4,"_cwrap_":4,alia:4,can:[0,2,4,5],def:4,control:4,simobject:[0,1,2,3,4,5,6],kym:1,share:[1,0,4,5,6],indic:[0,4,5],kaplanyorkemap_gene_seq:1,sourc:[1,0,2,6],want:[0,4,5],dxd:6,unsign:4,alwai:[0,5],differenti:[0,3,6],end:[0,4,5],ordinari:[0,3,6],double_matrix:4,write:[1,0,4,5,6],how:[0,5,6],sever:[4,5],longlong:4,map:[1,0,3],after:4,befor:0,uint:4,mai:0,multipl:4,data:[0,2,4],stress:0,"short":[0,4],essenti:5,num_:[1,0,4,5,6],correspond:4,element:[1,4],int64:4,func_with_arg:4,nameofstruct_func_method3:5,nameofstruct_func_method2:5,nameofstruct_func_method1:5,double_scalar:4,c_bool:4,pointer:5,typedef:[1,0,5,6],c_longlong:4,chosen:4,platform:4,yt_0:1,lode_cstructnam:6,easier:0,myprefix:4,good:0,"return":[1,0,4,5,6],python:[0,1,2,3,4,5,6],auto:5,var_nam:4,bound:[5,6],now:6,introduct:1,choic:[4,5],"schl\u00f6gl":1,name:[1,4,5,6],int_matrix:4,easili:[0,2],side:0,mean:[5,6],subset:4,our:5,meth:5,special:[2,5],variabl:[0,4,5],ulonglong:4,matrix:[4,6],ret:5,content:0,rel:[2,4,5],uint32:4,pul:5,linear:[0,3,6],free:1,base:4,york:[1,0,3],org:0,lmd:1,care:4,omit:[4,5,6],thing:0,nameofstruct_name_of_funct:5,rais:5,gene_seq:1,first:5,s_end:[5,6],rang:[5,6],pyrex:0,onc:[4,5],arrai:[1,0,4,5,6],number:[4,5],sometim:0,fast:0,size:[1,4,5,6],differ:6,system:1,wrapper:4,subplot:6,option:[4,5],relationship:[0,4],especi:0,copi:[4,6],setuptool:0,alloc:0,specifi:[4,5,6],liblod:[0,5,6],png:[1,6],overwrit:4,keyword:5,provid:0,tree:2,second:5,charact:4,arg_nam:4,pre:4,argument:[0,4,5,6],packag:0,have:[0,2,4,5],tabl:0,need:[1,0,4,5,6],self:[1,0,4,5,6],note:[2,4,5],also:4,exampl:[0,4,5],take:5,which:[0,2,4,5],kaplan:[1,0,3],encyclopedia:1,ulong:4,normal:6,letter:4,pair:0,"class":[0,1,2,4,5,6],linearod:[0,5,6],don:[4,5],doe:4,ext:2,declar:[1,5,6],axi:5,tkf:0,show:[1,0,6],enumer:6,syntax:4,cdt:[0,2,4],cfunc:4,line:[4,6],your_clib:2,onli:0,explicitli:4,enough:0,rasi:4,dict:4,local:4,variou:5,get:[2,4,5],"__file__":[1,0,2,5,6],c_ulong:4,requir:[0,5],bar:4,stuff:0,where:[4,5],set:[4,5,6],a_0_0:[5,6],"_cmembers_":[0,1,2,4,5,6],see:[0,4,5],num:4,arg:[2,4,5],num_in:4,railgun:[0,1,2,4,5,6],wikipedia:1,figur:1,"import":[1,0,5,6],attribut:[2,4],cstructnam:4,kei:[4,5],kaplanyorkemap_:1,numer:0,style:[0,5],lode:[0,5,6],solv:6,come:4,addit:4,last:5,ushort:4,tutori:[0,5],equat:[0,3,6],pdf:[1,6],load:[5,0,2,4,6],among:[0,4],simpli:6,kwd:4,cmem:[2,4],friedrich:1,s_start:5,numpi:[0,4],three:6,empti:5,much:0,valu:[4,5,6],great:0,func_foo:4,linearode_run:[0,5,6],c_char:4,func:[4,5],defin:[4,5],"_cstructname_":[4,3,6],abov:[0,5],error:[4,5],func_nam:[4,5],c_ulonglong:4,chaotic:1,non:5,scipi:0,"__init__":4,welcom:0,make:5,same:[2,4,5],member:[1,4,5,6],your_c_funct:4,instanc:5,document:0,getv:[1,4],complet:0,http:0,c_uint:4,effect:4,hand:0,name_of_shared_librari:4,temporari:5,cdt_or_index:4,inherit:5,setv:[1,4,5,6],without:[5,6],thi:[5,0,2,4,6],choos:4,nameofstruct:5,everyth:[0,4],dimension:6,name_of_c_funct:4,just:6,less:0,pylab:[1,0,6],shape:4,psyco:0,speed:0,languag:[0,4],struct:[1,0,4,5,6],easi:[0,5],c_short:4,makefil:2,fortran:0,add:5,c_func_nam:4,float32:4,build:2,int32:4,longdoubl:4,read:0,know:5,like:[0,2,4,5],specif:5,docutil:4,"_cfuncs_":[1,0,4,5,6],int_scalar:4,some_funct:4,output:[1,3,6],page:0,thermodynam:1,some:5,sampl:[0,3],int_vector2:4,int_vector1:4,librari:[1,0,4,5,6],var_0_1:4,definit:[1,2,3,4,5],markers:1,leav:5,relpath:[0,1,2,4,5,6],c_long:4,method2:5,method3:5,method1:5,usag:2,funcnam:4,repositori:0,src:2,obj:4,simul:[1,0],book:1,"float":4,easy_instal:0,automat:[0,4,5],wrap:4,"_cwrap_your_c_funct":4,your:[0,2,4,5],span:4,wai:[0,5],yoursimobj:4,"long":4,avail:4,start:4,low:0,"_clibname_":[0,1,2,4,5,6],"var":[4,6],"function":[5,0,2,4,6],form:5,old_c_funct:4,bitbucket:0,"_cfuncprefix_":[4,3,6],notat:[4,5],hire:[1,6],consist:[0,5],"default":[4,5,6],"_cmemsubsets_":4,c_longdoubl:4,featur:5,creat:[4,5],nameofcstruct:4,"int":[0,1,2,4,5,6],certain:[0,5],"char":4,file:[2,4,5],pip:0,check:[0,5],fill:4,linearode_:[0,5,6],googl:1,when:[0,4],other:0,bool:4,you:[0,2,4,5],architectur:4,ctype:[0,4],num_i:[1,4],num_j:4,num_k:4,directori:[1,4,5,6],num_d:[0,5,6],pathnam:2,return_var:4},objtypes:{"0":"py:module","1":"py:function","2":"py:attribute","3":"py:class","4":"py:method"},titles:["Welcome to RailGun&#8217;s documentation!","Kaplan-Yorke map","Utility functions","Samples","<tt class=\"docutils literal\"><span class=\"pre\">SimObject</span></tt> &#8212; A class loads everything you need from C shared library","RailGun Tutorial","Linear Ordinary Differential Equation"],objnames:{"0":"Python module","1":"Python function","2":"Python attribute","3":"Python class","4":"Python method"},filenames:["index","samples/kaplan_yorke_map/kaplan_yorke_map","utils","samples/index","simobj","tutorial","samples/lode/lode"]})
+Search.setIndex({objects:{"":{railgun:[4,0,1]},railgun:{cmems:[2,1,1],SimObject:[4,4,1],relpath:[2,1,1]},"railgun.SimObject":{"_cfuncs_":[4,2,1],"_cmemsubsets_":[4,2,1],"_cmembers_":[4,2,1],setv:[4,3,1],num:[4,3,1],getv:[4,3,1],"_clibname_":[4,2,1],"_cfuncprefix_":[4,2,1],"_cstructname_":[4,2,1],"_clibdir_":[4,2,1]}},terms:{all:[0,7],code:[0,1,3,6,7,5],name1:4,four:4,scalar:4,follow:[0,4],run_debug:6,cython:0,myprefixfuncnam:4,intermedi:[6,3],program:[0,7],vec:4,liter:[4,6],string:[4,7],c_doubl:4,"void":6,util:[0,2],veri:0,c_int:4,level:[0,6],list:[4,7],prefix:[4,5],vector:[4,6,5],refer:[1,3],pleas:5,upper:[5,7],your_modul:2,s_debug:6,zero:7,pass:0,num_i2:4,run:[0,6,5,3,7],num_i1:4,index:[0,4,5,7],what:5,plot_x:6,libkaplan_yorke_map:1,access:[0,4,5,6,7],version:5,method:[0,4,6,3,7],othernameforpyclass:4,christian:1,gener:[0,2,7],here:[0,4,7],satisfi:4,beck:1,let:[0,2],xt_0:1,path:[2,4,7],along:[4,7],legend:6,"_clibdir_":[0,1,2,4,6,5,7],wait:7,search:0,figsiz:1,chang:7,linearordinarydifferentialequ:5,control:4,via:[0,6,5],although:0,func_:[4,7],modul:[0,2,4,7],double_vector:4,kaplanyorkemap:1,instal:0,should:[4,7],x1_debug:6,from:[0,1,2,4,6,5,7],memori:0,doubl:[0,1,2,4,6,5,7],two:[4,7],next:0,liblode_cfuncprefix:5,call:[0,4,7],c_ushort:4,type:[0,2,5,4,7],notic:5,relative_path:2,warn:4,name2:4,c_float:4,hold:7,must:[4,7],uint64:4,"_cwrap_":4,alia:4,arang:6,can:[0,2,4,7],def:[4,6],overrid:4,simobject:[0,1,2,3,4,5,6,7],kym:1,share:[0,1,6,4,7,5],indic:[0,4,7],kaplanyorkemap_gene_seq:1,sourc:[1,0,2,6,5],lode_rk4:[6,3],want:[0,4,7],dxd:[6,5],unsign:4,alwai:[0,7],differenti:[0,3,5],end:[0,4,7],ordinari:[0,3,5],double_matrix:4,write:[0,1,6,4,7,5],how:[0,5,7],sever:[4,7],longlong:4,map:[1,0,3],after:4,befor:0,uint:4,mai:0,multipl:4,data:[0,2,4],stress:0,"short":[0,4],essenti:7,num_:[0,1,6,4,7,5],correspond:4,element:[1,4],int64:4,linearoderk4_:6,order:[4,7],nameofstruct_func_method3:7,nameofstruct_func_method2:7,nameofstruct_func_method1:7,double_scalar:4,c_bool:4,pointer:7,typedef:[1,0,6,5,7],c_longlong:4,chosen:4,platform:4,yt_0:1,calc_xi:6,lode_cstructnam:5,easier:0,myprefix:4,good:0,"return":[0,1,6,4,7,5],python:[0,1,2,3,4,5,6,7],auto:7,var_nam:4,bound:[5,7],now:5,introduct:1,choic:[4,7],"schl\u00f6gl":1,name:[1,4,5,6,7],int_matrix:4,easili:[0,2],k4_debug:6,debug:6,side:0,mean:[5,7],subset:4,k1_debug:6,our:7,meth:7,special:[2,7],variabl:[0,4,6,3,7],ulonglong:4,matrix:[4,6,5],ret:7,content:0,rel:[2,4,7],uint32:4,pul:7,linear:[0,6,3,5],free:1,base:4,york:[1,0,3],org:0,lmd:1,care:4,omit:[4,5,7],plot:[1,0,6,5],thing:0,nameofstruct_name_of_funct:7,rais:7,gene_seq:1,first:7,s_end:[5,7],rang:[6,5,7],pyrex:0,onc:[4,7],arrai:[0,1,6,4,7,5],number:[4,7],sometim:0,fast:0,klist:6,size:[1,4,5,6,7],linearoderk4_run_norm:6,differ:5,x3_debug:6,system:1,wrapper:4,subplot:5,option:[4,7],relationship:[0,4],especi:0,copi:[4,5],setuptool:0,alloc:0,specifi:[4,5,7],liblod:[0,5,7],png:[1,6,5],overwrit:4,keyword:7,provid:0,tree:2,second:7,charact:4,arg_nam:4,pre:[4,6],argument:[0,4,5,7],packag:0,have:[0,2,4,7],tabl:0,need:[0,1,6,4,7,5],self:[0,1,6,4,7,5],simul:[1,0],note:[2,4,7],also:4,without:[6,5,3,7],take:7,which:[0,2,4,7],kaplan:[1,0,3],encyclopedia:1,ulong:4,normal:[6,5],k3_debug:6,letter:4,pair:0,"class":[0,1,2,4,6,5,7],linearod:[0,5,7],don:[4,7],doe:4,ext:2,declar:[1,6,5,7],axi:7,tkf:0,iterate_onc:6,show:[1,0,6,5],enumer:[6,5],syntax:4,cdt:[0,2,4],line:[4,5],your_clib:2,onli:0,explicitli:4,enough:0,rasi:4,dict:[4,6],local:4,variou:7,get:[2,4,7],"__file__":[0,1,2,6,7,5],run_:6,c_ulong:4,requir:[0,7],bar:4,plot_k:6,stuff:0,rung:[0,6,3],where:[4,7],set:[4,5,6,7],a_0_0:[5,7],"_cmembers_":[0,1,2,4,6,5,7],see:[0,4,7],num:4,arg:[2,4,7],num_in:4,railgun:[0,1,2,4,6,5,7],wikipedia:1,label:6,figur:1,"import":[1,0,6,5,7],attribut:[2,4],cstructnam:4,kei:[4,7],kaplanyorkemap_:1,numer:0,style:[0,7],lode:[0,6,5,7],solv:[6,5],come:4,addit:4,last:7,ushort:4,instanc:7,equat:[0,6,3,5],pdf:[1,6,5],load:[0,2,5,4,7],among:[0,4],simpli:5,kwd:4,cmem:[2,4],non:7,creat:[4,7],fortran:0,s_start:7,numpi:[0,4],three:5,empti:7,much:0,valu:[4,5,6,7],great:0,func_foo:4,linearode_run:[0,5,7],c_char:4,func:[4,6,7],k2_debug:6,defin:[4,7],"_cstructname_":[4,3,5],abov:[0,7],error:[4,7],func_nam:[4,7],c_ulonglong:4,chaotic:1,nameofstruct:7,scipi:0,"__init__":4,welcom:0,make:7,same:[2,4,7],member:[1,4,5,6,7],your_c_funct:4,tutori:[0,7],document:0,getv:[1,4,6],complet:0,kutta:[0,6,3],http:0,c_uint:4,effect:4,hand:0,name_of_shared_librari:4,temporari:7,cdt_or_index:4,inherit:7,setv:[1,4,5,7],exampl:[0,4,7],thi:[0,2,5,4,7],choos:4,everyth:[0,4],dimension:[6,5],name_of_c_funct:4,linearoderk4:6,just:5,less:0,pylab:[1,0,6,5],shape:4,psyco:0,speed:0,languag:[0,4],struct:[0,1,6,4,7,5],easi:[0,7],c_short:4,makefil:2,friedrich:1,add:7,c_func_nam:4,dtype:[0,4],float32:4,build:2,int32:4,longdoubl:4,read:0,know:7,like:[0,2,4,7],specif:7,docutil:[4,6],"_cfuncs_":[0,1,6,4,7,5],int_scalar:4,some_funct:4,output:[1,3,5],func_with_arg:4,page:0,thermodynam:1,some:7,sampl:[0,3],int_vector2:4,int_vector1:4,librari:[0,1,6,4,7,5],var_0_1:4,definit:[1,2,3,4,7],markers:1,leav:7,linearoderk4_run_debug:6,relpath:[0,1,2,4,6,5,7],c_long:4,method2:7,method3:7,method1:7,usag:[0,2,6,3],funcnam:4,repositori:0,"_cmemsubsets_debug":6,src:2,obj:4,func_spam:4,book:1,"float":4,easy_instal:0,automat:[0,4,7],liblode_rk4:6,wrap:4,"_cwrap_your_c_funct":4,your:[0,2,4,7],span:[4,6],wai:[0,7],yoursimobj:4,"long":4,avail:4,start:4,low:0,"_clibname_":[0,1,2,4,6,5,7],"var":[4,6,5],"function":[0,2,5,4,7],form:7,num_i:[1,4],bitbucket:0,"_cfuncprefix_":[4,3,5],"true":6,notat:[4,7],hire:[1,6,5],consist:[0,7],"default":[4,5,6,7],"_cmemsubsets_":[0,4,6,3],c_longdoubl:4,featur:7,calc_f:6,nameofcstruct:4,"int":[0,1,2,4,6,5,7],certain:[0,7],"char":4,file:[2,4,7],pip:0,check:[0,7],fill:4,linearode_:[0,5,7],googl:1,when:[0,4],other:0,bool:4,you:[0,2,4,7],architectur:4,ctype:[0,4],old_c_funct:4,num_j:4,num_k:4,directori:[1,4,5,6,7],num_d:[0,6,5,7],pathnam:2,x2_debug:6,return_var:4},objtypes:{"0":"py:module","1":"py:function","2":"py:attribute","3":"py:method","4":"py:class"},titles:["Welcome to RailGun&#8217;s documentation!","Kaplan-Yorke map","Utility functions","Samples","<tt class=\"docutils literal\"><span class=\"pre\">SimObject</span></tt> &#8212; A class loads everything you need from C shared library","Linear Ordinary Differential Equation","Runge-Kutta method (usage of <tt class=\"docutils literal docutils literal docutils literal\"><span class=\"pre\">_cmemsubsets_</span></tt>)","RailGun Tutorial"],objnames:{"0":"Python module","1":"Python function","2":"Python attribute","3":"Python method","4":"Python class"},filenames:["index","samples/kaplan_yorke_map/kaplan_yorke_map","utils","samples/index","simobj","samples/lode/lode","samples/lode_rk4/lode_rk4","tutorial"]})

File railgun-doc/simobj.html

 <dd><p>dict of dict of list, optional
 Definition of subset of C members for controlling which
 C members to be loaded. Example:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span> <span class="s">&#39;name1&#39;</span><span class="p">:</span> <span class="p">{</span> <span class="s">&#39;cfuncs&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;f&#39;</span><span class="p">,</span> <span class="s">&#39;g&#39;</span><span class="p">,</span> <span class="s">&#39;h&#39;</span><span class="p">],</span> <span class="s">&#39;cmems&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;x&#39;</span><span class="p">,</span> <span class="s">&#39;y&#39;</span><span class="p">]</span> <span class="p">},</span>
-  <span class="s">&#39;name2&#39;</span><span class="p">:</span> <span class="p">{</span> <span class="s">&#39;cfuncs&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;f&#39;</span><span class="p">,</span> <span class="s">&#39;j&#39;</span><span class="p">,</span> <span class="s">&#39;k&#39;</span><span class="p">],</span> <span class="s">&#39;cmems&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;y&#39;</span><span class="p">,</span> <span class="s">&#39;z&#39;</span><span class="p">]</span> <span class="p">}</span> <span class="p">}</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span> <span class="s">&#39;name1&#39;</span><span class="p">:</span> <span class="p">{</span> <span class="s">&#39;funcs&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;f&#39;</span><span class="p">,</span> <span class="s">&#39;g&#39;</span><span class="p">,</span> <span class="s">&#39;h&#39;</span><span class="p">],</span> <span class="s">&#39;members&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;x&#39;</span><span class="p">,</span> <span class="s">&#39;y&#39;</span><span class="p">]</span> <span class="p">},</span>
+  <span class="s">&#39;name2&#39;</span><span class="p">:</span> <span class="p">{</span> <span class="s">&#39;funcs&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;f&#39;</span><span class="p">,</span> <span class="s">&#39;j&#39;</span><span class="p">,</span> <span class="s">&#39;k&#39;</span><span class="p">],</span> <span class="s">&#39;members&#39;</span><span class="p">:</span> <span class="p">[</span><span class="s">&#39;y&#39;</span><span class="p">,</span> <span class="s">&#39;z&#39;</span><span class="p">]</span> <span class="p">}</span> <span class="p">}</span>
 </pre></div>
 </div>
 <p>Here, <tt class="docutils literal"><span class="pre">name1,</span> <span class="pre">name2</span></tt> are the name of C member subset,