Repository URL to install this package:
|
Version:
4.4.5.dfsg-3ubuntu2 ▾
|
<HTML>
<HEAD>
<TITLE>Derivative</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">
<P><A NAME="derivative"></A>
<font size="+3" color="green"><B>Derivative</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 = DERIV(x,y)</CODE>
</TD></TR>
</table></p>
<p>
The <CODE>DERIV</CODE> function evaluates the first derivatives
of the vector <CODE>y</CODE>, the dependent variable,
with respect to the vector <CODE>x</CODE>, the independent variable,
at the <CODE>x</CODE> locations. The vector
<CODE>x</CODE> must be strictly monotonically increasing. The result
of this function is a vector with the same length as the vectors
<CODE>x</CODE> and <CODE>y</CODE>. Currently,
the derivatives are calculated using interpolating cubic splines, but more algorithms,
such as Lagrange interpolating polynomials, will be added in the future.
<P>
<font size="+1" color="green">Interpolating splines</font></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>
<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 deriv(x,y)
set linecolor black
replot
</pre></font></P>
<P>
<center><IMG SRC="derivI01.png"></center></P>
</BODY>
</HTML>