Chapter 1Introduction

The PLT Scheme Science Collection is a collection of modules that provide functions for numerical computing. The structure of the science collection and many of the underlying algorithms were inspired by the GNU Scientific Library (GSL)[2]. The functions are written entirely in PLT Scheme[3] and present a true Scheme look-and-feel throughout. The source code is distributed with the science collection and licensed under the GNU Lesser General Public License (LGPL)[1].

The motivation behind the PLT Scheme Science Collection is to provide a numerical framework for knowledge-based simulation in PLT Scheme. Indeed, many of the routines were originally developed as part of the PLT Scheme Simulation Collection[8]. It was noted that much of the functionality (e.g., random number generation, random distributions, histograms, and statistics) did not depend on, or could be separated from, the underlying simulation engine. When this was done, it was further noted that this functionality represented a subset of the functionality available in the GSL. At that point, it was decided to use the structure and, to the extent practical, the algorithms of the GSL as a reference model. Thus, the PLT Scheme Science Collection was born.

This reference manual is based on the GNU Scientific Library Reference Manual[2]. Because of the differences between C and PLT Scheme, and the fundamental differences between the underlying numeric models of each, the presentation of the functions is different here than in the GSL Reference Manual. We also rely more on the graphical representation of results, using the plot collection distributed with PLT Scheme (PLoT Scheme)[7].

We are indebted to Dr. M. Galassi and Dr. J. Theiler of Los Alamos National Laboratory and the others who have contributed to the development of the GNU Scientific Library (GSL). Any weaknesses in the PLT Scheme Science Collection are our own and must not be construed as having origins in the GSL.

1.1  Routines Available in the Science Collection

The PLT Scheme Science Collection covers a range of topics in numerical computing. Functions are available for the following areas:1

• Mathematical Constants and Functions

• Special Functions

• Random Numbers

• Random Distributions

• Statistics

• Histograms

• Ordinary Differential Equations

• Chebyshev Approximations

The use of these functions is described in this manual. Each chapter provides detailed definitions of the functions, with example code.

Version 2.2.1

Version 2.2.1 is a point release of Version 2.2 where the discrete random routines were reimplemented using Walker's O(1) algorithm.

Version 2.2

Version 2.2 of the PLT Scheme Science Collection features a reformatted Reference Manual that is compatible with the PLT Scheme Help Desk. The reference manual was written in TEXand converted to HTML using tex2page. A pdf version of the reference manual is also available.

Bug Fixes:

The `gamma-inc-Q` function has been added. It was accidentally stubbed out in Version 2.1

Version 2.1

Version 2.1 of the PLT Scheme Science Collection added cummulative density functions for the rest of the 1-dimensional, continuous distributions (except the Gaussian tail distribution). The corresponding graphics routines were also updated to plot the cummulative density functions. Also, beta, incomplete gamma, and exponential integral special functions were implemented.

Bug Fixes:

The `lngamma` function returned incorrect values for positive values less than 0.5.

Downloading the science collection from PLaneT on a computer with less than(approximately) 1GB of memory failed. This is caused in a bug in the PLT Scheme setup collection that fails on large files. The pdf file for the reference manual - the large file that caused the problem - was removed from the distributed science collection.

2-dimensional histogram plots failed. This was an error in the PLoT package distributed with PLT Scheme. It is fixed in V301.5 and later.

Version 2.0

Version 2.0 of the PLT Scheme Science Collection added ordinary differential equations. These were needed for the PLT Scheme Simulation Collection.

1.2  The Science Collection is Free Software

The PLT Scheme Science Collection is free software - this means that anyone is free to use it and to redistribute it in other free programs. The science collection is not in the public domain - it is copyrighted and there are conditions on its distribution. Specifically, the PLT Scheme Science Collection is distributed under the GNU Lesser General Public License (LGPL)[1]. A copy of the LGPL is provided as Appendix A of this document.

1.3  Obtaining the Science Collection

The preferred method for obtaining the PLT Scheme Science Collection is via the PLaneT Package Repository (PLaneT), PLT Scheme's centralized package distribution system[6]. The PLaneT identifier for the PLT Scheme Science Collection, Version 2.1 (or later) is ("williams" "science.plt" 2 1). PLT Scheme will automatically download and install the science collection from the PLaneT server. See Chapter 2 for an example.

Note that Version 2.1 of the PLT Scheme Science Collection requires PLT Scheme Version 301 or higher. Versions later than 301.5 are recommended because of improved performance.

1.4  No Warranty

The PLT Scheme Science Collection is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. It is your responsibility to validate the behavior of the software and their accuracy using the source code provided. See the GNU Lesser General Public License (LGPL)[1] for more details.

1 This is only a fraction of the areas supported by the GSL. For a complete reference of the numerical computing areas supported by the GSL, please refer to the GSL Reference Manual[2].