Dear all,

I wonder if someone can illuminate me on numerical integration with
PDL. I have tried (almost) hard with both chia (PDL::Slatec) and
gslinteg_qng (PDL::GSL::INTEG) but got a bit swamped.

Essentially, I have two piddles coming from the output of "hist": one
contains xvals and the other the frequencies. What I need to do is to
calculate the integral of that histogram over different intervals .

My actual code looks like this (using GSL):

use PDL;
use PDL::GSL::INTEG;

my $xmin = min $a; # the minimum limit of integration
my $xmax = max $glacier; # maximum limit
my $s_ave = avg $s; # some value extracted from another piddle

my $epsrel = 0;  # this value is taken from the example in the documentation
my $epsabs = 1e-3;  # same as above, but a bit higher
my ($a1,$abserr,$ierr,$neval); # define variables

# try to integrate. $b is a 1-D piddle containing the
($a1,$abserr,$ierr,$neval) = gslinteg_qng( $b, $zmin, $s_ave, $epsrel,$epsabs);


Then I get this:

Not a CODE reference at
/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/PDL/GSL/INTEG.pm
line 589.


May be there is a problem because I did not define a certain
subroutine &myfunc, but the fact is that I do not have a function in
the traditional sense, but two list of values, one representing the
independent variable and the other the (unknown) function values.

Any hint will be appreciated,


Thanks in advance


Hernán



-- 

Hernán De Angelis
Linux user # 397217

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to