forked from FDYdarmstadt/MomentFitting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gaussNodes.m
31 lines (30 loc) · 1.7 KB
/
gaussNodes.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function [ nodes ] = gaussNodes(noOfNodes)
%GAUSSNODES Gauss nodes within [-1, 1]
% Creates the nodes for a Gauss-Legendre quadrature rules using the given
% 'noOfNodes'. Currently, up to ten nodes are supported (i.e., quadrature
% order 19).
switch noOfNodes
case 1
nodes = 0;
case 2
nodes = [ -0.577350269189626; 0.577350269189626 ];
case 3
nodes = [ -0.774596669241484; 0; 0.774596669241484 ];
case 4
nodes = [ -0.861136311594053; -0.339981043584856; 0.339981043584856; 0.861136311594053 ];
case 5
nodes = [ -0.906179845938664; -0.538469310105683; 0; 0.538469310105683; 0.906179845938664 ];
case 6
nodes = [ -0.932469514203152; -0.661209386466264; -0.238619186083197; 0.238619186083197; 0.661209386466264; 0.932469514203152 ];
case 7
nodes = [ -0.949107912342758; -0.741531185599394; -0.405845151377397; 0; 0.405845151377397; 0.741531185599394; 0.949107912342758 ];
case 8
nodes = [ -0.960289856497536; -0.796666477413627; -0.525532409916329; -0.183434642495650; 0.183434642495650; 0.525532409916329; 0.796666477413627; 0.960289856497536 ];
case 9
nodes = [ -0.968160239507626; -0.836031107326636; -0.613371432700590; -0.324253423403809; 0; 0.324253423403809; 0.613371432700590; 0.836031107326636; 0.968160239507626 ];
case 10
nodes = [ -0.973906528517172; -0.865063366688985; -0.679409568299024; -0.433395394129247; -0.148874338981631; 0.148874338981631; 0.433395394129247; 0.679409568299024; 0.865063366688985; 0.973906528517172 ];
otherwise
error('Given number of nodes not supported');
end
end