MS-C1650 - Numerical Analysis
Week 19: Lecture 8: Gauss Quadratures

Harri Hakula, 2021

Gauss

<<NumericalDifferentialEquationAnalysis`

polys=Table[Function[x,Evaluate[x^k],Listable],{k,0,40}];

n=5

{q,w}=Transpose[GaussianQuadratureWeights[n,-1,1]]

error=Table[{Exponent[p[x],x],Chop[Integrate[p[x],{x,-1,1}]-w.p[q]]},{p,polys}]

Gauss Point Distribution

n=5;
{q,w}=Transpose[GaussianQuadratureWeights[n,-1,1]]

ListPlot[Thread[List[q,0]],PlotMarkers->{Automatic, Medium},Frame->True]

n=15;
{q,w}=Transpose[GaussianQuadratureWeights[n,-1,1]];

ListPlot[Thread[List[q,0]],PlotMarkers->{Automatic, Medium},Frame->True]