[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Numerical Differentiation and Integration of Array Data
From: |
syberraith |
Subject: |
Re: Numerical Differentiation and Integration of Array Data |
Date: |
Sun, 4 Dec 2011 14:36:16 -0800 (PST) |
Actually, I think my central difference algorithm is providing more realistic
answers than Octave's diff function in this case:
n = 400
p = (2 * pi)/200;
h = p / (n-1);
g = h / 2;
function y = f ( x )
y = sin( 200 * x );
endfunction
t = linspace(0 - g, p + g, n + 1);
a = (f(t+g) - f(t-g))/h;
a = h.*(a(1:end-1) + a(2:end))./2;
#t = linspace(0, p, n);
#a = diff(f(t))/h;
s1 = sum(a.*h)
s2 = f(p) - f(0)
ds = s1 - s2
n = 400
p = (2 * pi)/200;
h = p / (n-1);
g = h / 2;
n = 400
s1 = 1.2398e-06
s2 = 6.4326e-16
ds = 1.2398e-06
Or, am I still missing something?
--
View this message in context:
http://octave.1599824.n4.nabble.com/Numerical-Differentiation-and-Integration-of-Array-Data-tp4145498p4158445.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Re: Numerical Differentiation and Integration of Array Data, (continued)
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/03
- Re: Numerical Differentiation and Integration of Array Data, c., 2011/12/03
- Message not available
- Re: Numerical Differentiation and Integration of Array Data, Carlo de Falco, 2011/12/03
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/03
- Re: Numerical Differentiation and Integration of Array Data, c., 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data, Carlo de Falco, 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data, c., 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data,
syberraith <=
- Re: Numerical Differentiation and Integration of Array Data, Francesco Potortì, 2011/12/05
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/05
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data, c., 2011/12/04
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/05
- Re: Numerical Differentiation and Integration of Array Data, syberraith, 2011/12/05
- Re: Numerical Differentiation and Integration of Array Data, Francesco Potortì, 2011/12/05
- Re: Numerical Differentiation and Integration of Array Data, Francesco Potortì, 2011/12/05
- Re: Numerical Differentiation and Integration of Array Data, c., 2011/12/05
- Re: Numerical Differentiation and Integration of Array Data, Francesco Potortì, 2011/12/05