cacatoo
Version:
Building, exploring, and sharing spatially structured models
579 lines (149 loc) • 8.07 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: ODE</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: ODE</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>ODE<span class="signature">(eq, state_vector, pars, diff_rates, ode_name)</span><span class="type-signature"></span></h2>
<div class="class-description">The ODE class is used to call the odex.js library and numerically solve ODEs</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="ODE"><span class="type-signature"></span>new ODE<span class="signature">(eq, state_vector, pars, diff_rates, ode_name)</span><span class="type-signature"></span></h4>
<div class="description">
The constructor function for a @ODE object.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>eq</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Function that describes the ODE (see examples starting with ode)</td>
</tr>
<tr>
<td class="name"><code>state_vector</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Initial state vector</td>
</tr>
<tr>
<td class="name"><code>pars</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Array of parameters for the ODEs</td>
</tr>
<tr>
<td class="name"><code>diff_rates</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Array of rates at which each state diffuses to neighbouring grid point (Has to be less than 0.25!)</td>
</tr>
<tr>
<td class="name"><code>ode_name</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of this ODE</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cacatoo.js.html">cacatoo.js</a>, <a href="cacatoo.js.html#line130">line 130</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="print_state"><span class="type-signature"></span>print_state<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Prints the current state to the console
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cacatoo.js.html">cacatoo.js</a>, <a href="cacatoo.js.html#line167">line 167</a>
</li></ul></dd>
</dl>
<h4 class="name" id="solveTimestep"><span class="type-signature"></span>solveTimestep<span class="signature">(delta_t, opt_pos)</span><span class="type-signature"></span></h4>
<div class="description">
Numerically solve the ODE
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>delta_t</code></td>
<td class="type">
<span class="param-type">float</span>
</td>
<td class="default">
0.1
</td>
<td class="description last">Step size</td>
</tr>
<tr>
<td class="name"><code>opt_pos</code></td>
<td class="type">
<span class="param-type">bool</span>
</td>
<td class="default">
</td>
<td class="description last">When enabled, negative values are set to 0 automatically</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="cacatoo.js.html">cacatoo.js</a>, <a href="cacatoo.js.html#line154">line 154</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Canvas.html">Canvas</a></li><li><a href="Flockmodel.html">Flockmodel</a></li><li><a href="Graph.html">Graph</a></li><li><a href="Gridmodel.html">Gridmodel</a></li><li><a href="Gridpoint.html">Gridpoint</a></li><li><a href="ODE.html">ODE</a></li><li><a href="QuadTree.html">QuadTree</a></li><li><a href="Simulation.html">Simulation</a></li></ul><h3>Global</h3><ul><li><a href="global.html#CopyGridODEs">CopyGridODEs</a></li><li><a href="global.html#MakeGrid">MakeGrid</a></li><li><a href="global.html#copy">copy</a></li><li><a href="global.html#default_colours">default_colours</a></li><li><a href="global.html#dict_reverse">dict_reverse</a></li><li><a href="global.html#get2DFromCanvas">get2DFromCanvas</a></li><li><a href="global.html#hexToRGB">hexToRGB</a></li><li><a href="global.html#nameToRGB">nameToRGB</a></li><li><a href="global.html#parseColours">parseColours</a></li><li><a href="global.html#pause">pause</a></li><li><a href="global.html#random_colours">random_colours</a></li><li><a href="global.html#shuffle">shuffle</a></li><li><a href="global.html#stringToRGB">stringToRGB</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Wed Dec 18 2024 17:10:07 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>