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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
<HTML>
<HEAD>
<TITLE>Integration</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">
<P><A NAME="integral"></A>
<font size="+3" color="green"><B>Integration</B></font></P>
<P>
<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%"><CODE>
vout = INTEGRAL(x,y)<br />
voud = INTEGRAL(x,y,'SMOOTH')<BR />
voud = INTEGRAL(x,y,'TRAPEZOID')</CODE>
</TD></TR>
</table></p>
<p>
The <CODE>INTEGRAL</CODE> function integrates the vector
<CODE>y</CODE>, the dependent variable, with respect to
vector <CODE>x</CODE>, the independent variable.
The output of this function is a vector with the same length as <CODE>x</CODE>. The last
element of the output vector is the integral over the full
range of <CODE>x</CODE>. Currently, integration using
interpolating splines, using no keyword or the keyword <code>SMOOTH</code>,
or the trapezoid rule, using keyword <code>TRAPEZOID</code>, are the only types available.</P>
<P>
<font size="+1" color="green">Interpolating splines</font></P>
<p>
<TABLE border="0" cols="2" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%"><CODE>vout = INTEGRAL(x,y)<br />
voud = INTEGRAL(x,y,'SMOOTH')</CODE>
</TD></TR>
</table></p>
<P>
This integration method utilizes an interpolating spline under tension. The spline tension
used is the current value of <CODE>
<a href="../Characteristics/tension.htm">TENSION</a></CODE>, which may be
changed with the <CODE><font color="blue"><a href="../Commands/Set.htm">SET TENSION</A>
</font></CODE> command. The nature of the interpolating curve varies continuously from pure cubic
splines, for <CODE>TENSION = 0</CODE>, to a piecewise linear curve, that is,
points joined by straight line segments, for large <CODE>TENSION</CODE>.</P>
<p>
<CODE>x</CODE> must be strictly monotonically increasing.</p>
<P>
<font size="+1" color="green">Example</font></P>
<p>
The following code produces the picture below (except for the text which was added
interactively).</P>
<P>
<font color="blue"><pre>
clear
defaults
!
pi=acos(-1)
generate x 0,,2*pi 100
y = cos(x)^3+sin(x)^3
graph x y
!
set linecolor red
graph/overlay x integral(x,y)
set linecolor black
replot
</pre></font></P>
<P>
<center><IMG ALIGN=BOTTOM SRC="integralI01.png"></center></P>
<P>
<font size="+1" color="green">Trapezoid rule</font></P>
<p>
<b>Syntax:</b> <code>vout = INTEGRAL(x,y,'TRAPEZOID')</code></p>
<p>
This integration method uses the trapezoid rule.</p>
</BODY>
</HTML>
|