4.625

4.6 | 16 ratings Rate this file 154 Downloads (last 30 days) File Size: 1.69 KB File ID: #4540

Legendre-Gauss Quadrature Weights and Nodes

by Greg von Winckel

 

26 Feb 2004 (Updated 11 May 2004)

Computes the Legendre-Gauss weights and nodes for solving definite integrals.

| Watch this File

File Information
Description

This is a simple script which produces the Legendre-Gauss weights and nodes for computing the definite integral of a continuous function on some interval [a,b]. Users are encouraged to improve and redistribute this script. See also the script Chebyshev-Gauss-Lobatto quadrature (File ID 4461).

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (21)
24 Jan 2005 Dave Farrell

Very handy tool, which for some reason is missing in matlab, like the zeros of the bessel functions.

I did notice the weights are not normalized to 1 however, which seemed to result in an over estimation of the integral.

Good work and thank you

24 Mar 2005 Tim Warburton

Very nice quadrature routine!.

29 Mar 2005 DEIVEEGAN M  
05 Apr 2005 Nabeel Azar

My QUADG function in the quadrature category contains a subfunction called "gausslegendre" that does an equivalent computation using EIG; it can be used as a separate function if desired.

I don't know about the accuracy of your approach, but if I remember correctly the algorithm I had used is considered quite accurate. It's also very fast.

26 Jun 2005 kumar gautam  
07 Oct 2006 vish j  
09 Jan 2007 s b

works well in emag apps for tough integrands, fast and simple function

04 Aug 2007 Phuong Huynh

I would like Tabulated Gauss points

29 Nov 2007 a a  
02 Mar 2008 Dawid Z

Works pretty well - thanx

22 Apr 2008 Xinghui Zhong  
11 Sep 2008 alex qren  
05 Feb 2009 Mohan KV  
05 Feb 2009 Mohan KV

Neat program. Well done!

22 Mar 2009 Christine Acou

Excellent! Thanks for sharing. Do you have a reference for your algorithm?

28 Apr 2010 Tim

very handy tool! thanks!

29 Oct 2010 Orkan Umurhan

Thank you very much. The results are good and there are no problems with the accuracy of the approach nor are there any issues with normalization as some people above suggested. I have checked the integration for a wide range of reasonable functions and the numbers check out just right. Thanks!

01 Nov 2010 David

Brilliant piece of code! I have been using this quite a lot without trouble. I'm always amazed that how quickly Gaussian quadrature converges.

29 Mar 2011 rahman

excellent

28 Jun 2011 AVIGYAN SINHA  
06 Nov 2011 Javier Vazquez

Very Good, thanks.

Please login to add a comment or rating.
Updates
10 May 2004

Found a bug in scaling of weights. Also slight improvement to speed.

11 May 2004

Forgot to include interval mapping in previous revison.

Tag Activity for this File
Tag Applied By Date/Time
integration Greg von Winckel 22 Oct 2008 07:15:07
legendre Greg von Winckel 22 Oct 2008 07:15:07
quadrature Greg von Winckel 22 Oct 2008 07:15:07
numerical Greg von Winckel 22 Oct 2008 07:15:07
weights Greg von Winckel 22 Oct 2008 07:15:07
nodes Greg von Winckel 22 Oct 2008 07:15:07
integration reena 11 Mar 2011 05:23:20
integration carlos gütler 09 May 2011 10:29:42
legendre Peng Liu 15 Jul 2011 23:22:57
quadrature Keith 21 Oct 2011 10:37:24
very goog Javier Vazquez 06 Nov 2011 15:52:32
thaks a lot Javier Vazquez 06 Nov 2011 15:52:32

Contact us at files@mathworks.com