File: Scientific_11.html

package info (click to toggle)
python-scientific 2.2-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,368 kB
  • ctags: 2,396
  • sloc: python: 6,468; ansic: 3,643; xml: 3,596; makefile: 79; sh: 27
file content (39 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<a name="Module:Scientific.Functions.Romberg"><h1>Module Scientific.Functions.Romberg</h1></a>

<hr width=70%>
<h2>Functions</h2>

<ul>
<li> <p>

<a name="Function:Scientific.Functions.Romberg.trapezoid"><b><i>trapezoid</i></b>(<i>function</i>, <i>interval</i>, <i>numtraps</i>)</a><br>


</p>

<p>Returns the integral of <i>function</i> (a function of one variable)
over <i>interval</i> (a sequence of length two containing the lower and
upper limit of the integration interval), calculated using the
trapezoidal rule using <i>numtraps</i> trapezoids.</p>

Example:

<pre>
from Scientific.Functions.Romberg import romberg
from Numeric import pi
romberg(tan, (0.0, pi/3.0))
</pre>
<p>  yields <tt>0.693147180562</tt>

</p><li> <p>

<a name="Function:Scientific.Functions.Romberg.romberg"><b><i>romberg</i></b>(<i>function</i>, <i>interval</i>, <i>accuracy</i>=<tt>1e-07</tt>, <i>show</i>=<tt>0</tt>)</a><br>


</p>

<p>Returns the integral of <i>function</i> (a function of one variable)
over <i>interval</i> (a sequence of length two containing the lower and
upper limit of the integration interval), calculated using
Romberg integration up to the specified <i>accuracy</i>. If <i>show</i> is 1,
the triangular array of the intermediate results will be printed.</p></ul>