function [ xtab, weight ] = legendre_set_log ( norder ) %% LEGENDRE_SET_LOG sets a Gauss-Legendre rule for - LOG(X) * F(X) on [0,1]. % % Discussion: % % The integration interval is [ 0, 1 ]. % % The weight function is w(x) = -LOG(X) . % % The integral to approximate: % % Integral ( 0 <= X <= 1 ) - LOG(X) * F(X) dX % % The quadrature rule: % % Sum ( 1 <= I <= NORDER ) WEIGHT(I) * F ( XTAB(I) ) % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 13 October 2005 % % Author: % % John Burkardt % % Reference: % % Abramowitz, Stegun, % Handbook of Mathematical Functions, % National Bureau of Standards, 1964, page 920. % % Gwynne Evans, % Practical Numerical Integration, % Wiley, 1993, QA299.3E93, page 309. % % Arthur Stroud, Don Secrest, % Gaussian Quadrature Formulas, % Prentice Hall, 1966, % LC: QA299.4G3S7. % % Parameters: % % Input, integer NORDER, the order of the rule. % NORDER must be between 1 through 8, or 16. % % Output, real XTAB(NORDER), the abscissas of the rule. % % Output, real WEIGHT(NORDER), the weights of the rule. % if ( norder == 1 ) xtab(1) = 0.25; weight(1) = 1.0; elseif ( norder == 2 ) xtab(1) = 0.112008806166976182957205488948; xtab(2) = 0.602276908118738102757080225338; weight(1) = 0.718539319030384440665510200891; weight(2) = 0.281460680969615559334489799109; elseif ( norder == 3 ) xtab(1) = 0.0638907930873254049961166031363; xtab(2) = 0.368997063715618765546197645857; xtab(3) = 0.766880303938941455423682659817; weight(1) = 0.513404552232363325129300497567; weight(2) = 0.391980041201487554806287180966; weight(3) = 0.0946154065661491200644123214672; elseif ( norder == 4 ) xtab(1) = 0.0414484801993832208033213101564; xtab(2) = 0.245274914320602251939675759523; xtab(3) = 0.556165453560275837180184354376; xtab(4) = 0.848982394532985174647849188085; weight(1) = 0.383464068145135124850046522343; weight(2) = 0.386875317774762627336008234554; weight(3) = 0.190435126950142415361360014547; weight(4) = 0.0392254871299598324525852285552; elseif ( norder == 5 ) xtab(1) = 0.0291344721519720533037267621154; xtab(2) = 0.173977213320897628701139710829; xtab(3) = 0.411702520284902043174931924646; xtab(4) = 0.677314174582820380701802667998; xtab(5) = 0.894771361031008283638886204455; weight(1) = 0.297893471782894457272257877888; weight(2) = 0.349776226513224180375071870307; weight(3) = 0.234488290044052418886906857943; weight(4) = 0.0989304595166331469761807114404; weight(5) = 0.0189115521431957964895826824218; elseif ( norder == 6 ) xtab(1) = 0.0216340058441169489956958558537; xtab(2) = 0.129583391154950796131158505009; xtab(3) = 0.314020449914765508798248188420; xtab(4) = 0.538657217351802144548941893993; xtab(5) = 0.756915337377402852164544156139; xtab(6) = 0.922668851372120237333873231507; weight(1) = 0.238763662578547569722268303330; weight(2) = 0.308286573273946792969383109211; weight(3) = 0.245317426563210385984932540188; weight(4) = 0.142008756566476685421345576030; weight(5) = 0.0554546223248862900151353549662; weight(6) = 0.0101689586929322758869351162755; elseif ( norder == 7 ) xtab(1) = 0.0167193554082585159416673609320; xtab(2) = 0.100185677915675121586885031757; xtab(3) = 0.246294246207930599046668547239; xtab(4) = 0.433463493257033105832882482601; xtab(5) = 0.632350988047766088461805812245; xtab(6) = 0.811118626740105576526226796782; xtab(7) = 0.940848166743347721760134113379; weight(1) = 0.196169389425248207525427377585; weight(2) = 0.270302644247272982145271719533; weight(3) = 0.239681873007690948308072785252; weight(4) = 0.165775774810432906560869687736; weight(5) = 0.0889432271376579644357238403458; weight(6) = 0.0331943043565710670254494111034; weight(7) = 0.00593278701512592399918517844468; elseif ( norder == 8 ) xtab(1) = 0.0133202441608924650122526725243; xtab(2) = 0.0797504290138949384098277291424; xtab(3) = 0.197871029326188053794476159516; xtab(4) = 0.354153994351909419671463603538; xtab(5) = 0.529458575234917277706149699996; xtab(6) = 0.701814529939099963837152670310; xtab(7) = 0.849379320441106676048309202301; xtab(8) = 0.953326450056359788767379678514; weight(1) = 0.164416604728002886831472568326; weight(2) = 0.237525610023306020501348561960; weight(3) = 0.226841984431919126368780402936; weight(4) = 0.175754079006070244988056212006; weight(5) = 0.112924030246759051855000442086; weight(6) = 0.0578722107177820723985279672940; weight(7) = 0.0209790737421329780434615241150; weight(8) = 0.00368640710402761901335232127647; elseif ( norder == 16 ) xtab( 1) = 0.00389783448711591592405360527037; xtab( 2) = 0.0230289456168732398203176309848; xtab( 3) = 0.0582803983062404123483532298394; xtab( 4) = 0.108678365091054036487713613051; xtab( 5) = 0.172609454909843937760843776232; xtab( 6) = 0.247937054470578495147671753047; xtab( 7) = 0.332094549129917155984755859320; xtab( 8) = 0.422183910581948600115088366745; xtab( 9) = 0.515082473381462603476277704052; xtab(10) = 0.607556120447728724086384921709; xtab(11) = 0.696375653228214061156318166581; xtab(12) = 0.778432565873265405203868167732; xtab(13) = 0.850850269715391083233822761319; xtab(14) = 0.911086857222271905418818994060; xtab(15) = 0.957025571703542157591520509383; xtab(16) = 0.987047800247984476758697436516; weight( 1) = 0.0607917100435912328511733871235; weight( 2) = 0.102915677517582144387691736210; weight( 3) = 0.122355662046009193557547513197; weight( 4) = 0.127569246937015988717042209239; weight( 5) = 0.123013574600070915423123365137; weight( 6) = 0.111847244855485722621848903429; weight( 7) = 0.0965963851521243412529681650802; weight( 8) = 0.0793566643514731387824416770520; weight( 9) = 0.0618504945819652070951360853113; weight(10) = 0.0454352465077266686288299526509; weight(11) = 0.0310989747515818064092528627927; weight(12) = 0.0194597659273608420780860268669; weight(13) = 0.0107762549632055256455393162159; weight(14) = 0.00497254289008764171250524951646; weight(15) = 0.00167820111005119451503546419059; weight(16) = 0.000282353764668436321778085987413; else fprintf ( 1, '\n' ); fprintf ( 1, 'LEGENDRE_SET_LOG - Fatal error!\n' ); fprintf ( 1, ' Illegal value of NORDER = %d\n', norder ); error ( 'LEGENDRE_SET_LOG - Fatal error!' ); end