Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pdl::gsl::mroot(3pm) [debian man page]

MROOT(3pm)						User Contributed Perl Documentation						MROOT(3pm)

NAME
PDL::GSL::MROOT - PDL interface to multidimensional root-finding routines in GSL DESCRIPTION
This is an interface to the multidimensional root-finding package present in the GNU Scientific Library. At the moment there is a single function gslmroot_fsolver which provides an interface to the algorithms in the GSL library that do not use derivatives. SYNOPSIS
use PDL; use PDL::GSL::MROOT; my $init = pdl (-10.00, -5.0); my $epsabs = 1e-7; $res = gslmroot_fsolver($init, &rosenbrock, {Method => 0, EpsAbs => $epsabs}); sub rosenbrock{ my ($x) = @_; my $a = 1; my $b = 10; my $y = zeroes($x); my $y0 = $y->slice(0); $y0 .= $a * (1 - $x->slice(0)); my $y1 = $y->slice(1); $y1 .= $b * ($x->slice(1) - $x->slice(0)**2); return $y; } FUNCTIONS
gslmroot_fsolver -- Multidimensional root finder without using derivatives This function provides an interface to the multidimensional root finding algorithms in the GSL library. It takes a minimum of two argumennts: a piddle $init with an initial guess for the roots of the system and a reference to a function. The latter function must return a piddle whose i-th element is the i-th equation evaluated at the vector x (a piddle which is the sole input to this function). See the example in the Synopsis above for an illustration. The function returns a piddle with the roots for the system of equations. Two optional arguments can be specified as shown below. One is Method, which can take the values 0,1,2,3. They correspond to the 'hybrids', 'hybrid', 'dnewton' and 'broyden' algorithms respectively (see GSL documentation for details). The other optional argument is Epsabs, which sets the absolute accuracy to which the roots of the system of equations are required. The default value for Method is 0 ('hybrids' algorithm) and the default for Epsabs is 1e-3. Usage: $res = gslmroot_fsolver($init, $function_ref, [{Method => $method, Epsabs => $epsabs}]); SEE ALSO
PDL The GSL documentation is online at http://sources.redhat.com/gsl/ref/gsl-ref_toc.html AUTHOR
This file copyright (C) 2006 Andres Jordan <ajordan@eso.org> and Simon Casassus <simon@das.uchile.cl> All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. FUNCTIONS
fsolver_meat Signature: (double xfree(n); double epsabs(); int method(); SV* funcion1) info not available fsolver_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. perl v5.14.2 2012-05-30 MROOT(3pm)

Check Out this Related Man Page

INTERP(3pm)						User Contributed Perl Documentation					       INTERP(3pm)

NAME
PDL::GSL::INTERP - PDL interface to Interpolation routines in GSL DESCRIPTION
This is an interface to the interpolation package present in the GNU Scientific Library. SYNOPSIS
use PDL; use PDL::GSL::INTERP; my $x = sequence(10); my $y = exp($x); my $spl = PDL::GSL::INTERP->init('cspline',$x,$y); my $res = $spl->eval(4.35); $res = $spl->deriv(4.35); $res = $spl->deriv2(4.35); $res = $spl->integ(2.1,7.4); FUNCTIONS
init() The init method initializes a new instance of INTERP. It needs as input an interpolation type and two piddles holding the x and y values to be interpolated. The GSL routines require that x be monotonically increasing and a quicksort is performed by default to ensure that. You can skip the quicksort by passing the option {Sort => 0}. The available interpolation types are : linear polynomial cspline (natural cubic spline) cspline_periodic (periodic cubic spline) akima (natural akima spline) akima_periodic (periodic akima spline) Please check the GSL documentation for more information. Usage: $blessed_ref = PDL::GSL::INTERP->init($interp_method,$x,$y,$opt); Example: $x = sequence(10); $y = exp($x); $spl = PDL::GSL::INTERP->init('cspline',$x,$y) $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 1}) #same as above # no sorting done on x, user is certain that x is monotonically increasing $spl = PDL::GSL::INTERP->init('cspline',$x,$y,{Sort => 0}); eval() The function eval returns the interpolating function at a given point. By default it will barf if you try to extrapolate, to comply silently if the point to be evaluated is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->eval($points,$opt); Example: my $res = $spl->eval($x) $res = $spl->eval($x,{Extrapolate => 0}) #same as above # silently comply if $x is out of range $res = $spl->eval($x,{Extrapolate => 1}) deriv() The deriv function returns the derivative of the interpolating function at a given point. By default it will barf if you try to extrapolate, to comply silently if the point to be evaluated is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->deriv($points,$opt); Example: my $res = $spl->deriv($x) $res = $spl->deriv($x,{Extrapolate => 0}) #same as above # silently comply if $x is out of range $res = $spl->deriv($x,{Extrapolate => 1}) deriv2() The deriv2 function returns the second derivative of the interpolating function at a given point. By default it will barf if you try to extrapolate, to comply silently if the point to be evaluated is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->deriv2($points,$opt); Example: my $res = $spl->deriv2($x) $res = $spl->deriv2($x,{Extrapolate => 0}) #same as above # silently comply if $x is out of range $res = $spl->deriv2($x,{Extrapolate => 1}) integ() The integ function returns the integral of the interpolating function between two points. By default it will barf if you try to extrapolate, to comply silently if one of the integration limits is out of range pass the option {Extrapolate => 1} Usage: $result = $spl->integ($a,$b,$opt); Example: my $res = $spl->integ($a,$b) $res = $spl->integ($a,$b,{Extrapolate => 0}) #same as above # silently comply if $a or $b are out of range $res = $spl->eval($a,$b,{Extrapolate => 1}) BUGS
Feedback is welcome. SEE ALSO
PDL The GSL documentation is online at http://sources.redhat.com/gsl/ref/gsl-ref_toc.html AUTHOR
This file copyright (C) 2003 Andres Jordan <andresj@physics.rutgers.edu> All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL interpolation module was written by Gerard Jungman. perl v5.14.2 2012-05-30 INTERP(3pm)
Man Page