home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
RADIANCE
/
CAL
/
GAUSS.CAL
< prev
next >
Wrap
Text File
|
1993-10-07
|
2KB
|
105 lines
{
Gaussian Integration
10/20/87
order - order of integral (# of sample points)
xmin - interval begin
xmax - interval end
f(x) - integrand
integ - integral value
}
{ Defaults }
order = 24 ;
xmin = -1 ;
xmax = 1 ;
integ = q1(ceil(order/2-.25)) * (xmax-xmin)/2 ;
q1(i) = if( i-1.5, wght(i)*(f1(absc(i))+f1(-absc(i))) + q1(i-1),
wght(1)*(f1(absc(1))+if(even,f1(-absc(1)),0)) ) ;
even = floor(order/2+.25) - order/2 + .25 ;
f1(u) = f((xmax*(1+u)+xmin*(1-u))/2) ;
{ Abscissas }
absc(i) = select( order,
0,
.577350269189626, { n = 2 }
select( i, { n = 3 }
0,
.774596669241483
),
0, 0,
select( i, { n = 6 }
.238619186083197,
.661209386466265,
.932469514203152
),
0, 0, 0, 0, 0,
select( i, { n = 12 }
.125233408511469,
.367831498998180,
.587317954286617,
.769902674194305,
.904117256370475,
.981560634246719
),
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
select( i, { n = 24 }
.064056892862606,
.191118867473616,
.315042679696163,
.433793507626045,
.545421471388840,
.648093651936976,
.740124191578554,
.820001985973903,
.886415527004401,
.938274552002733,
.974728555971309,
.995187219997021
)
) ;
{ Weights }
wght(i) = select( order,
0,
1, { n = 2 }
select( i, { n = 3 }
.888888888888888,
.555555555555555
),
0, 0,
select( i, { n = 6 }
.467913934572691,
.360761573048139,
.171324492379170
),
0, 0, 0, 0, 0,
select( i, { n = 12 }
.249147045813403,
.233492536538355,
.203167426723066,
.160078328543346,
.106939325995318,
.047175336386512
),
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
select( i, { n = 24 }
.127938195346752,
.125837456346828,
.121670472927803,
.115505668053726,
.107444270115966,
.097618652104114,
.086190161531953,
.073346481411080,
.059298584915437,
.044277438817420,
.028531388628934,
.012341229799987
)
) ;