Derivation with Octave
Ben Abbott
bpabbott at mac.com
Tue Mar 4 07:03:13 CST 2008
On Mar 4, 2008, at 7:36 AM, Julien Martin wrote:
> 2008/3/2, Ben Abbott <bpabbott at mac.com>:
> On Mar 2, 2008, at 8:32 AM, Julien Martin wrote:
>
> > Hello,
> > I am a beginner to Octave and would like to perform derivation on
> > some functions. Can anyone please help? What is the syntax of the
> > arguments of the differenciate function?
> > Thanks in advance,
> > Julien.
>
>
> Octave a numerical (not a symbolic) computational tool. If you are
> looking for symbolic derivatives, please consider Maxima.
>
> For numerical derivatives, there are many methods to accomplish that
> numerically.
>
> Given you have a pair of vectors, x & y, where y is dependent upon x.
>
> dydx = diff (y) ./ diff (x);
> xc = x(1:end-1) + diff(x)/2;
> dydx = interp1 (x(n), dydx, xc, "linear", "extrap");
>
> If the function, y, may be accurately represented by a polynomial of
> order N
>
> dydx = polyval ( polyder ( polyfit (x, y, N)), x);
>
> Ben
>
> Hi there,
> I tried Maxima and I find it awesome (just like Octave).
> However, can any of you please explain to me the difference between
> numerical and symbolic calculus?
> When do I use Octave and when do I use Maxima?
> Thanks in advance,
> Julien.
>
"Numerical" refers to calculations, and "symbolic" refers to
symbols ... I'm not try to be cheeky, but the difference are quite
apparent even on a superficial level.
Octave, Xcel, and even a calculator each are able to do numerical
calculations.
The symbolic derivative of "2*x^2 - 4*x + 1" is "4*x - 4".
Ben
More information about the Help-octave
mailing list