<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Scientific.Functions.Romberg</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th> <a href="Scientific-module.html">Home</a> </th> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="http://dirac.cnrs-orleans.fr/ScientificPython/">Scientific Python</a></th> </tr></table></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> <a href="Scientific-module.html">Package Scientific</a> :: <a href="Scientific.Functions-module.html">Package Functions</a> :: Module Romberg </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options" >[<a href="frames.html" target="_top">frames</a >] | <a href="Scientific.Functions.Romberg-module.html" target="_top">no frames</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== MODULE DESCRIPTION ==================== --> <h1 class="epydoc">Module Romberg</h1><p class="nomargin-top"></p> <p>Numerical integration using the Romberg algorithm</p> <!-- ==================== FUNCTIONS ==================== --> <a name="section-Functions"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td align="left" colspan="2" class="table-header"> <span class="table-header">Functions</span></td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">number</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Scientific.Functions.Romberg-module.html#romberg" class="summary-sig-name">romberg</a>(<span class="summary-sig-arg">function</span>, <span class="summary-sig-arg">interval</span>, <span class="summary-sig-arg">accuracy</span>=<span class="summary-sig-default">1e-07</span>)</span><br /> Numerical <a name="index-integration"></a><i class="indexterm">integration</i> using the <a name="index-Romberg"></a><i class="indexterm">Romberg</i> method</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">number</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="Scientific.Functions.Romberg-module.html#trapezoid" class="summary-sig-name">trapezoid</a>(<span class="summary-sig-arg">function</span>, <span class="summary-sig-arg">interval</span>, <span class="summary-sig-arg">numtraps</span>)</span><br /> Numerical <a name="index-integration"></a><i class="indexterm">integration</i> using the <a name="index-trapezoidal"></a><i class="indexterm">trapezoidal</i> rule</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> </table> <!-- ==================== FUNCTION DETAILS ==================== --> <a name="section-FunctionDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td align="left" colspan="2" class="table-header"> <span class="table-header">Function Details</span></td> </tr> </table> <a name="romberg"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">romberg</span>(<span class="sig-arg">function</span>, <span class="sig-arg">interval</span>, <span class="sig-arg">accuracy</span>=<span class="sig-default">1e-07</span>)</span> </h3> </td><td align="right" valign="top" > </td> </tr></table> <p>Numerical <a name="index-integration"></a><i class="indexterm">integration</i> using the <a name="index-Romberg"></a><i class="indexterm">Romberg</i> method</p> <p>Example:</p> <pre class="literalblock"> >>>from Scientific.Functions.Romberg import romberg >>>from Scientific.N import pi, tan >>>romberg(tan, (0.0, pi/3.0)) yields '0.693147180562' </pre> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>function</code></strong> (callable) - a function of one variable</li> <li><strong class="pname"><code>interval</code></strong> (sequence of two <code>float</code>s) - the lower and upper limit of the integration interval</li> <li><strong class="pname"><code>accuracy</code></strong> (<code>float</code>) - convergence criterion (absolute error)</li> </ul></dd> <dt>Returns: number</dt> <dd>the numerical integral of the function over the interval</dd> </dl> </td></tr></table> </div> <a name="trapezoid"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">trapezoid</span>(<span class="sig-arg">function</span>, <span class="sig-arg">interval</span>, <span class="sig-arg">numtraps</span>)</span> </h3> </td><td align="right" valign="top" > </td> </tr></table> <p>Numerical <a name="index-integration"></a><i class="indexterm">integration</i> using the <a name="index-trapezoidal"></a><i class="indexterm">trapezoidal</i> rule</p> <p>Example:</p> <pre class="literalblock"> >>>from Scientific.Functions.Romberg import trapezoid >>>from Scientific.N import pi, tan >>>trapezoid(tan, (0.0, pi/3.0), 100) yields 0.69317459482518262 </pre> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>function</code></strong> (callable) - a function of one variable</li> <li><strong class="pname"><code>interval</code></strong> (sequence of two <code>float</code>s) - the lower and upper limit of the integration interval</li> <li><strong class="pname"><code>numtraps</code></strong> (<code>int</code>) - the number of trapezoids</li> </ul></dd> <dt>Returns: number</dt> <dd>the numerical integral of the function over the interval</dd> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th> <a href="Scientific-module.html">Home</a> </th> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="http://dirac.cnrs-orleans.fr/ScientificPython/">Scientific Python</a></th> </tr></table></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Thu Dec 4 08:05:35 2008 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>