Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!mit-eddie!ll-xn!adelie!axiom!linus!raybed2!applicon!hdsvx1!hoffman From: hoffman@hdsvx1.UUCP (Richard Hoffman) Newsgroups: sci.physics Subject: Re: Gauss Legendre Quadratures Message-ID: <855@hdsvx1.UUCP> Date: Mon, 20-Oct-86 09:43:57 EDT Article-I.D.: hdsvx1.855 Posted: Mon Oct 20 09:43:57 1986 Date-Received: Wed, 22-Oct-86 22:55:04 EDT References: <220@sri-arpa.ARPA> Reply-To: hoffman@hdsvx1.UUCP (Richard hoffman) Organization: Schlumberger HDS, Houston Lines: 19 In article <220@sri-arpa.ARPA> anderson@nrl-csr (Paul Anderson) writes: >I need to obtain an approximation to a function over the range [0,x] using >a Gauss-Legendre quadrature routine. I can find references to tables where >the weights are given over the interval [-1,1], but not over the interval [0,x] >where x will be a variable real number greater than zero, but specified prior >to the integration. The reason you can only find them on the range [-1,1] is that any function on any other range can be transformed into a function on the range [-1,1]. Thus, if your function is f(x) on the range [0,k], then let g(x) = k(x+1)/2, and interpolate the function f(g(x)) on the range [-1,1]. Alternately, you can use g(x) to transform the quadrature points into points in [0,k]. This might be more efficient if you have many functions to evaluate over the same range. -- Richard Hoffman | "They sought it with thimbles, they sought it with care, Schlumberger WS | They pursued it with forks and hope; hdsvx1!hoffman | They threatened its life with a railway share, 713-928-4750 | They charmed it with smiles and soap." (L. CARROLL)