-
Notifications
You must be signed in to change notification settings - Fork 55
/
sparse_grid_laguerre.html
431 lines (394 loc) · 13.2 KB
/
sparse_grid_laguerre.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<html>
<head>
<title>
SPARSE_GRID_LAGUERRE - Sparse Grids Based on Gauss-Laguerre Rules
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
SPARSE_GRID_LAGUERRE <br> Sparse Grids Based on Gauss-Laguerre Rules
</h1>
<hr>
<p>
<b>SPARSE_GRID_LAGUERRE</b>
is a MATLAB library which
constructs sparse grids based on 1D Gauss-Laguerre rules.
</p>
<p>
Sparse grids are more naturally constructed from a nested family
of quadrature rules. Gauss-Laguerre rules are not nested, but
have higher accuracy. Thus, there can be a tradeoff. If we compare
two sparse grids of the same "level", one using Gauss-Laguerre rules
and the other a nested rule, then the Gauss-Laguerre
sparse grid will have higher accuracy...but also a significantly
greater number of points. When measuring efficiency, we really need
to balance the cost in quadrature points against the accuracy, and
so it is not immediately obvious which choice is best!
</p>
<p>
To slightly complicate matters, Gauss-Laguerre rules are not
nested. A sparse grid constructed from Gauss-Laguerre rules
will thus generally have more abscissas than a grid built of nested
rules..
</p>
<p>
Here is a table showing the number of points in a sparse grid based on
Gauss-Laguerre rules, indexed by the spatial dimension, and by the
"level", which is simply an index for the family of sparse grids.
<table border = "1">
<tr>
<th>DIM:</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th>
</tr>
<tr>
<th>LEVEL_MAX</th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th>
</tr>
<tr>
<th>0</th><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td>
</tr>
<tr>
<th>1</th><td>3</td><td>7</td><td>10</td><td>13</td><td>16</td><td>19</td>
</tr>
<tr>
<th>2</th><td>7</td><td>29</td><td>58</td><td>95</td><td>141</td><td>196</td>
</tr>
<tr>
<th>3</th><td>15</td><td>95</td><td>255</td><td>515</td><td>906</td><td>1456</td>
</tr>
<tr>
<th>4</th><td>31</td><td>273</td><td>945</td><td>2309</td><td>4746</td><td>8722</td>
</tr>
<tr>
<th>5</th><td>63</td><td>723</td><td>3120</td><td>9065</td><td>21503</td><td>44758</td>
</tr>
<tr>
<th>6</th><td>127</td><td>1813</td><td>9484</td><td>32259</td><td>87358</td><td>204203</td>
</tr>
</table>
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>SPARSE_GRID_LAGUERRE</b> is available in
<a href = "../../cpp_src/sparse_grid_laguerre/sparse_grid_laguerre.html">a C++ version</a> and
<a href = "../../f_src/sparse_grid_laguerre/sparse_grid_laguerre.html">a FORTRAN90 version</a> and
<a href = "../../m_src/sparse_grid_laguerre/sparse_grid_laguerre.html">a MATLAB version.</a>
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../m_src/sgmga/sgmga.html">
SGMGA</a>,
a MATLAB library which
creates sparse grids based on a mixture of 1D quadrature rules,
allowing anisotropic weights for each dimension.
</p>
<p>
<a href = "../../c_src/smolpack/smolpack.html">
SMOLPACK</a>,
a C library which
implements Novak and Ritter's method for estimating the integral
of a function over a multidimensional hypercube using sparse grids.
</p>
<p>
<a href = "../../m_src/sparse_grid_composite/sparse_grid_composite.html">
SPARSE_GRID_COMPOSITE</a>,
a MATLAB library which
creates sparse grids based on 1D composite rules (currently only of order 1).
</p>
<p>
<a href = "../../m_src/sparse_grid_gl/sparse_grid_gl.html">
SPARSE_GRID_GL</a>,
a MATLAB library which
computes a sparse grid
based on 1D Gauss-Legendre rules.
</p>
<p>
<a href = "../../m_src/sparse_grid_hermite/sparse_grid_hermite.html">
SPARSE_GRID_HERMITE</a>,
a MATLAB library which
creates sparse grids based on Gauss-Hermite rules.
</p>
<p>
<a href = "../../m_src/sparse_grid_hw/sparse_grid_hw.html">
SPARSE_GRID_HW</a>,
a MATLAB library which
creates sparse grids based on Gauss-Legendre, Gauss-Hermite,
Gauss-Patterson, or a nested variation of Gauss-Hermite rules,
by Florian Heiss and Viktor Winschel.
</p>
<p>
<a href = "../../m_src/sparse_grid_mixed/sparse_grid_mixed.html">
SPARSE_GRID_MIXED</a>,
a MATLAB library which
constructs a sparse grid using different rules in each spatial dimension.
</p>
<p>
<a href = "../../m_src/sparse_grid_open/sparse_grid_open.html">
SPARSE_GRID_OPEN</a>,
a MATLAB library which
define define sparse grids based on open nested quadrature rules.
</p>
<p>
<a href = "../../m_src/spquad/spquad.html">
SPQUAD</a>,
a MATLAB library which
computes the points and weights of a sparse grid quadrature rule
for a multidimensional integral, based on the Clenshaw-Curtis quadrature rule,
by Greg von Winckel.
</p>
<p>
<a href = "../../m_src/toms847/toms847.html">
TOMS847</a>,
a MATLAB program which
uses sparse grids to carry out multilinear hierarchical interpolation.
It is commonly known as SPINTERP, and is by Andreas Klimke.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Volker Barthelmann, Erich Novak, Klaus Ritter,<br>
High Dimensional Polynomial Interpolation on Sparse Grids,<br>
Advances in Computational Mathematics,<br>
Volume 12, Number 4, 2000, pages 273-288.
</li>
<li>
Thomas Gerstner, Michael Griebel,<br>
Numerical Integration Using Sparse Grids,<br>
Numerical Algorithms,<br>
Volume 18, Number 3-4, 1998, pages 209-232.
</li>
<li>
Albert Nijenhuis, Herbert Wilf,<br>
Combinatorial Algorithms for Computers and Calculators,<br>
Second Edition,<br>
Academic Press, 1978,<br>
ISBN: 0-12-519260-6,<br>
LC: QA164.N54.
</li>
<li>
Fabio Nobile, Raul Tempone, Clayton Webster,<br>
A Sparse Grid Stochastic Collocation Method for Partial Differential
Equations with Random Input Data,<br>
SIAM Journal on Numerical Analysis,<br>
Volume 46, Number 5, 2008, pages 2309-2345.
</li>
<li>
Sergey Smolyak,<br>
Quadrature and Interpolation Formulas for Tensor Products of
Certain Classes of Functions,<br>
Doklady Akademii Nauk SSSR,<br>
Volume 4, 1963, pages 240-243.
</li>
<li>
Dennis Stanton, Dennis White,<br>
Constructive Combinatorics,<br>
Springer, 1986,<br>
ISBN: 0387963472,<br>
LC: QA164.S79.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "comp_next.m">
comp_next.m</a>
computes the compositions of the integer N into K parts.
</li>
<li>
<a href = "i4_choose.m">
i4_choose.m</a>
computes the binomial coefficient C(N,K).
</li>
<li>
<a href = "i4_log_2.m">
i4_log_2.m</a>
returns the logarithm base 2 of an I4.
</li>
<li>
<a href = "i4_modp.m">
i4_modp.m</a>
returns the nonnegative remainder of integer division.
</li>
<li>
<a href = "laguerre_abscissa.m">
laguerre_abscissa.m</a>
returns Gauss-Laguerre abscissas.
</li>
<li>
<a href = "laguerre_integral_nd.m">
laguerre_integral_nd.m</a>
returns the exact value of a multidimensional Laguerre integral.
</li>
<li>
<a href = "laguerre_weights.m">
laguerre_weights.m</a>
returns Gauss-Laguerre weights.
</li>
<li>
<a href = "level_to_order_open.m">
level_to_order_open.m</a>
converts a level to an order for open rules.
</li>
<li>
<a href = "monomial_quadrature.m">
monomial_quadrature.m</a>
applies a quadrature rule to a monomial.
</li>
<li>
<a href = "monomial_value.m">
monomial_value.m</a>
evaluates a monomial.
</li>
<li>
<a href = "multigrid_index_one.m">
multigrid_index_one.m</a>
returns an indexed multidimensional grid.
</li>
<li>
<a href = "product_weight_laguerre.m">
product_weight_laguerre.m</a>
computes weights for a Gauss-Laguerre product rule.
</li>
<li>
<a href = "r8_factorial.m">
r8_factorial.m</a>
returns the factorial function N!.
</li>
<li>
<a href = "r8_huge.m">
r8_huge.m</a>
returns a "huge" R8.
</li>
<li>
<a href = "r8mat_write.m">
r8mat_write.m</a>
writes an R8MAT file.
</li>
<li>
<a href = "r8vec_direct_product2.m">
r8vec_direct_product2.m</a>
direct product of R8VEC's.
</li>
<li>
<a href = "sparse_grid_laguerre.m">
sparse_grid_laguerre.m</a>
computes a sparse grid of Gauss-Laguerre points.
</li>
<li>
<a href = "sparse_grid_laguerre_index.m">
sparse_grid_laguerre_index.m</a>
indexes the points forming a sparse grid.
</li>
<li>
<a href = "sparse_grid_laguerre_size.m">
sparse_grid_laguerre_size.m</a>
sizes a sparse grid of Gauss-Laguerre points.
</li>
<li>
<a href = "timestamp.m">
timestamp.m</a>
prints the current YMDHMS date as a time stamp.
</li>
<li>
<a href = "vec_colex_next2.m">
vec_colex_next2.m</a>
generates vectors in colex order.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "sparse_grid_laguerre_test.m">
sparse_grid_laguerre_test.m</a>,
runs all the tests.
</li>
<li>
<a href = "sparse_grid_laguerre_test01.m">
sparse_grid_laguerre_test01.m</a>,
tests SPARSE_GRID_LAGUERRE_SIZE.
</li>
<li>
<a href = "sparse_grid_laguerre_test02.m">
sparse_grid_laguerre_test02.m</a>,
tests SPARSE_GRID_LAGUERRE_INDEX.
</li>
<li>
<a href = "sparse_grid_laguerre_test03.m">
sparse_grid_laguerre_test03.m</a>,
tests SPARSE_GRID_LAGUERRE.
</li>
<li>
<a href = "sparse_grid_laguerre_test04.m">
sparse_grid_laguerre_test04.m</a>,
tests computes the weights and sums them.
</li>
<li>
<a href = "sparse_grid_laguerre_test05.m">
sparse_grid_laguerre_test05.m</a>,
tests a Gauss-Laguerre sparse grid rule for exactness on monomials.
</li>
<li>
<a href = "sparse_grid_laguerre_test06.m">
sparse_grid_laguerre_test06.m</a>,
writes a Gauss-Laguerre sparse grid rule to three files.
</li>
<li>
<a href = "sparse_grid_laguerre_test_output.txt">
sparse_grid_laguerre_test_output.txt</a>,
the output from a run of the sample program.
</li>
</ul>
</p>
<p>
The test program creates some data files:
<ul>
<li>
<a href = "../../datasets/sparse_grid_laguerre/lg_d2_level3_r.txt">lg_d2_level3_r.txt</a>,
the "R" file for a sparse grid quadrature rule for spatial dimension 2
and level 3.
</li>
<li>
<a href = "../../datasets/sparse_grid_laguerre/lg_d2_level3_w.txt">lg_d2_level3_w.txt</a>,
the "W" file for a sparse grid quadrature rule for spatial dimension 2
and level 3.
</li>
<li>
<a href = "../../datasets/sparse_grid_laguerre/lg_d2_level3_x.txt">lg_d2_level3_x.txt</a>,
the "X" file for a sparse grid quadrature rule for spatial dimension 2
and level 3.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../m_src.html">
the MATLAB source codes</a>.
</p>
<hr>
<i>
Last revised on 11 October 2007.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>