[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Finite difference operator
From: |
Laurent Hoeltgen |
Subject: |
Re: Finite difference operator |
Date: |
Fri, 31 May 2013 22:28:04 +0200 |
User-agent: |
Mutt/1.5.21hg (2012-12-30) |
Hi,
On Fri, May 31, 2013 at 04:52:26PM +0200, Juan Pablo Carbajal wrote:
> On Fri, May 31, 2013 at 4:47 PM, Nir Krakauer <address@hidden> wrote:
> > http://octave.sourceforge.net/octave/function/diff.html
> > or something more sophisticated?
>
> Thanks, yes far more sophisticated. I need to control accuracy... I
> mean a function to generate these guys
> http://en.wikipedia.org/wiki/Finite_difference_coefficient
> http://en.wikipedia.org/wiki/Difference_operator
>
> If it is not there (though I really remember it was there) I can write it.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
I wrote something that generates finite difference stencils a while ago. Can be
found here:
https://github.com/hoeltgman/m-files/blob/master/LinearAlgebra/DiffFilter1D.m
My code uses taylor expansions to set up a linear system. Its solution yields
the sought coefficients. I wrote it initially for my Matlab code, so it might
not run in octave out of the box. Also, I never did any thorough testing w.r.t.
weird parameter settings, but standard schemes seem to work well. The only
restriction is that the grid must be regular (size doesn't matter, though).
Regards,
Laurent