Go to the first, previous, next, last section, table of contents.

Gaussian integration algorithm

This package is contributed by Alexey Goldin, alexey@oddjob.uchicago.edu.

This documents the Gaussian Integration package.

;;From: Alexey Goldin <alexey@oddjob.uchicago.edu> ;;To: rosalia@sst10a.lanl.gov ;;Subject: GNUDL ;;Date: Thu, 5 Oct 1995 15:14:04 -0500

;;Here is Gauss integration algorithm. Function grule gnerates ;;list of 2 vectors -- basepoints and weights. May be useful for ;;other applications as well. After you load this file ;;type

;;gnudl> (print (gauss-int (lambda (x) (sin x)) 0 3.141592653 5)) ;;2.0000001102845 ;;^this is with 5 points.

;;Of course sometimes Simpson rule is better...

;;(BTW, would be good to have some constants predefined.)

;; grule was blindly copied from Matlab ( or Octave ) routine, do ;; not blame me too much for how it looks. Gauss-int is my first ;; Scheme code. (Yuckk!! It works though). I am using some ;; functions my friend wrote -- you probably could add them to ;; "utils.scm" -- I'll attach them after first file.

;; BTW, if there was consensus how matrices should be represented I ;; probably could glue in some Lapack stuff. SLIB arrays will not ;; work -- for Fortran you need continuous array and FIRST INDEX ;; CHANGES FASTEST!

;; What about followin --- ;; ('matrix nd (nind1 nind2 nind3 ..) #(big array of data))

;; First -- just tag not to mix with something else, then -- ;; number of dimensions, then -- size in all dimensions (nind1, ;; nind2, etc...), then -- vector, actual storage.

;; Tag may be needed to tell (print) how it should be printed. ;; It certainly should not be printed like it does now.

;; (what do you think?)

;; Anyway, here goes gauss-int, then -- some utils that may be ;; useful. I got Ok to use them how I like and to give it to anyone ;; including Microsoft.

;;; -*- Scheme -*- ; ; ; ; This function computes Gauss base points and weight factors ; using the algorithm given by Davis and Rabinowitz in 'Methods ; of Numerical Integration', page 365, Academic Press, 1975. ; ; Warning! I am scheme newbie. ; I just blindly copied Matlab routine. ; Certainly it could be done better.


Go to the first, previous, next, last section, table of contents.