source: trunk/SRC/Documentation/idldoc_assistant_output/Interpolation/spl_incr.html @ 402

Last change on this file since 402 was 402, checked in by smasson, 15 years ago

update documentation

File size: 10.1 KB
RevLine 
[163]1
2
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4  <head>
5    <title>spl_incr.pro (SAXO Documentation Assistant)</title>
6  </head>
7
8  <body text="#000000" bgcolor="#FFFFFF">
9
10   
11<!-- Navbar template takes a structure with the following fields:
12       overview_href :
13       overview_selected :
14       dir_overview_href :
15       dir_overview_selected :
16       categories_href :
17       categories_selected :
18       index_href :
19       index_selected :
20       search_href :
21       search_selected :
22       file_selected :
23       source_href :
24       source_selected :
25       help_href :
26       help_selected :
27       etc_selected :
28
29       prev_file_href :
30       next_file_href :
31
32       view_single_page_href :
33       view_frames_href :
34
35       summary_fields_href :
36       summary_routine_href :
37       details_routine_href :
38
39       title :
40       subtitle :
41       user :
42-->
43
44
45<table border="0" cellpadding="0" cellspacing="0" width="98%" bgcolor="#F0F0FF" valign="bottom">
46  <tr>
47    <td width="10%">
48<a href="spl_fstdrv.html"><img src="./../prev.gif" border="0" alt="Previous"></a></td>
49    <td width="80%" align="center" valign="center">
50<font size=-1><i>SAXO Documentation Assistant</i>: <a href="./../home.html">Overview</a></font></td>
51    <td width="10%" align="right">
52<a href="spl_keep_mean.html"><img src="./../next.gif" border="0" alt="Next"></a></td>
53  </tr>
54</table>
55
56
57    <h1><font size="-2">Interpolation/</font></h1>
58    <h2>spl_incr.pro</h2>
59
60    <dl>
61    </dl>
62
63   
64 Given the arrays X and Y, which tabulate a function (with the X[i]
65 AND Y[i] in ascending order), and given an input value X2, the
[242]66 spl_incr function returns an interpolated value for the given values
[163]67 of X2. The interpolation method is based on cubic spline, corrected
68 in a way that interpolated values are also monotonically increasing.
69
70
71   
72    <h2>Routine summary</h2>
73
74    <dl>
75     
76      <dt><a href="#_pure_concave"><i>result = </i>pure_concave(<i>x1, x2, y1, y2, der2, x</i>)</a><dt>
77      <dd><font size="-1"> </font></dd>
78     
79      <dt><a href="#_pure_convex"><i>result = </i>pure_convex(<i>x1, x2, y1, y2, der2, x</i>)</a><dt>
[242]80      <dd><font size="-1"> </font></dd>
[163]81     
82      <dt><a href="#_spl_incr"><i>result = </i>spl_incr(<i>x, y, x2</i>, YP0=<i>YP0</i>, YPN_1=<i>YPN_1</i>)</a><dt>
[242]83      <dd><font size="-1"> </font></dd>
[163]84     
85    </dl>
86
87    <p>&nbsp;</p>
88   
89
90     
91      <a name="#_pure_concave"></a>
92
93      <h2>pure_concave  </h2>
94
95      <p><font face="Courier"><i>result = </i>pure_concave(<i><a href="#_pure_concave_keyword_x1">x1</a>, <a href="#_pure_concave_keyword_x2">x2</a>, <a href="#_pure_concave_keyword_y1">y1</a>, <a href="#_pure_concave_keyword_y2">y2</a>, <a href="#_pure_concave_keyword_der2">der2</a>, <a href="#_pure_concave_keyword_x">x</a></i>)</font></p>
96
97   
98
99
100    <h3>Return value</h3>
[242]101 y2: f(x2) = y2. Double precision array
[163]102
103
104   
105    <h3>Parameters</h3>
106   
107
108    <a name="#_pure_concave_keyword_x1"></a>
109    <h4>x1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
110      <font size="-1" color="#006633">in</font>
111     
112     
113      <font size="-1" color="#006633">required</font>
114     
115     
116     
117     
118    </h4>
119
120   
[242]121 An n-elements (at least 2) input vector that specifies the tabulate points in
[163]122 a strict ascending order.
123
124   
125
126    <a name="#_pure_concave_keyword_x2"></a>
127    <h4>x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
128      <font size="-1" color="#006633">in</font>
129     
130     
131      <font size="-1" color="#006633">required</font>
132     
133     
134     
135     
136    </h4>
137
138   
139 The input values for which the interpolated values are
140 desired. Its values must be strictly monotonically increasing.
141
142   
143
144    <a name="#_pure_concave_keyword_y1"></a>
145    <h4>y1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
146      <font size="-1" color="#006633">in</font>
147     
148     
149      <font size="-1" color="#006633">required</font>
150     
151     
152     
153     
154    </h4>
155
156   
[242]157 f(x) = y. An n-elements input vector that specifies the values
[163]158 of the tabulated function F(Xi) corresponding to Xi. As f is
159 supposed to be monotonically increasing, y values must be
160 monotonically increasing. y can have equal consecutive values.
161
162   
163
164    <a name="#_pure_concave_keyword_y2"></a>
165    <h4>y2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
166     
167     
168     
169     
170     
171     
172     
173     
174    </h4>
175
176   
177   
178
179    <a name="#_pure_concave_keyword_der2"></a>
180    <h4>der2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
181     
182     
183     
184     
185     
186     
187     
188     
189    </h4>
190
191   
192
193   
194
195    <a name="#_pure_concave_keyword_x"></a>
196    <h4>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
197     
198     
199     
200     
201     
202     
203     
204     
205    </h4>
206
207   
208
209   
210   
211
212   
213
[234]214    <h3>Examples</h3><pre>
[163]215
[402]216   IDL> n = 100L
217   IDL> x = (dindgen(n))^2
218   IDL> y = abs(randomn(0, n))
219   IDL> y[n/2:n/2+1] = 0.
220   IDL> y[n-n/3] = 0.
221   IDL> y[n-n/6:n-n/6+5] = 0.
222   IDL> y = total(y, /cumulative, /double)
223   IDL> x2 = dindgen((n-1)^2)
224   IDL> n2 = n_elements(x2)
225   IDL> print, min(y[1:n-1]-y[0:n-2]) LT 0
226   IDL> y2 = spl_incr( x, y, x2)
227   IDL> splot, x, y, xstyle = 1, ystyle = 1, ysurx=.25, petit = [1, 2, 1], /land
228   IDL> oplot, x2, y2, color = 100
229   IDL> c = y2[1:n2-1] - y2[0:n2-2]
230   IDL> print, min(c) LT 0
231   IDL> print, min(c, max = ma), ma
232   IDL> splot,c,xstyle=1,ystyle=1, yrange=[-.01,.05], ysurx=.25, petit = [1, 2, 2], /noerase
233   IDL> oplot,[0, n_elements(c)], [0, 0], linestyle = 1
234
[234]235    </pre><h3>Version history</h3>
[163]236   
[234]237    <h4>Version</h4>
[402]238 $Id: spl_incr.pro 371 2008-08-07 09:32:02Z pinsard $
[163]239
240    <h4>History</h4>
241  Sebastien Masson (smasson@lodyc.jussieu.fr): May-Dec 2005
242
243   
244
245    <h3>Known issues</h3>
246   
247   
248   
249    <h4>Restrictions</h4>
250 It might be possible that y2[i+1]-y2[i] has very small negative
251 values (amplitude smaller than 1.e-6)...
252
253
254   
255   
256   
257   
258   
259   
260   
261
262    <font size="-3"><p>&nbsp;</p></font>
263    <hr size="1" color="#CCCCCC"/>
264     
265      <a name="#_pure_convex"></a>
266
267      <h2>pure_convex  </h2>
268
269      <p><font face="Courier"><i>result = </i>pure_convex(<i><a href="#_pure_convex_keyword_x1">x1</a>, <a href="#_pure_convex_keyword_x2">x2</a>, <a href="#_pure_convex_keyword_y1">y1</a>, <a href="#_pure_convex_keyword_y2">y2</a>, <a href="#_pure_convex_keyword_der2">der2</a>, <a href="#_pure_convex_keyword_x">x</a></i>)</font></p>
270
271   
272
[242]273
[163]274   
275
276   
277    <h3>Parameters</h3>
278   
279
280    <a name="#_pure_convex_keyword_x1"></a>
281    <h4>x1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
282      <font size="-1" color="#006633">in</font>
283     
284     
285      <font size="-1" color="#006633">required</font>
286     
287     
288     
289     
290    </h4>
291
292   
[242]293 An n-elements (at least 2) input vector that specifies the tabulate points in
[163]294 a strict ascending order.
295
296   
297
298    <a name="#_pure_convex_keyword_x2"></a>
299    <h4>x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
300      <font size="-1" color="#006633">in</font>
301     
302     
303      <font size="-1" color="#006633">required</font>
304     
305     
306     
307     
308    </h4>
309
310   
311 The input values for which the interpolated values are
312 desired. Its values must be strictly monotonically increasing.
313
314   
315
316    <a name="#_pure_convex_keyword_y1"></a>
317    <h4>y1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
318      <font size="-1" color="#006633">in</font>
319     
320     
321      <font size="-1" color="#006633">required</font>
322     
323     
324     
325     
326    </h4>
327
328   
[242]329 f(x) = y. An n-elements input vector that specifies the values
[163]330    of the tabulated function F(Xi) corresponding to Xi. As f is
331    supposed to be monotonically increasing, y values must be
332    monotonically increasing. y can have equal consecutive values.
333
334   
335
336    <a name="#_pure_convex_keyword_y2"></a>
337    <h4>y2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
338     
339     
340     
341     
342     
343     
344     
345     
346    </h4>
347
348   
349   
350
351    <a name="#_pure_convex_keyword_der2"></a>
352    <h4>der2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
353     
354     
355     
356     
357     
358     
359     
360     
361    </h4>
362
363   
[242]364
[163]365   
366
367    <a name="#_pure_convex_keyword_x"></a>
368    <h4>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
369     
370     
371     
372     
373     
374     
375     
376     
377    </h4>
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    <font size="-3"><p>&nbsp;</p></font>
408    <hr size="1" color="#CCCCCC"/>
409     
410      <a name="#_spl_incr"></a>
411
412      <h2>spl_incr  </h2>
413
414      <p><font face="Courier"><i>result = </i>spl_incr(<i><a href="#_spl_incr_keyword_x">x</a>, <a href="#_spl_incr_keyword_y">y</a>, <a href="#_spl_incr_keyword_x2">x2</a></i>, <a href="#_spl_incr_keyword_YP0">YP0</a>=<i>YP0</i>, <a href="#_spl_incr_keyword_YPN_1">YPN_1</a>=<i>YPN_1</i>)</font></p>
415
416   
417
[242]418
[163]419   
420
421   
422    <h3>Parameters</h3>
423   
424
425    <a name="#_spl_incr_keyword_x"></a>
426    <h4>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
427     
428     
429     
430     
431     
432     
433     
434     
435    </h4>
436
437   
438   
439
440    <a name="#_spl_incr_keyword_y"></a>
441    <h4>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
442     
443     
444     
445     
446     
447     
448     
449     
450    </h4>
451
452   
453   
454
455    <a name="#_spl_incr_keyword_x2"></a>
456    <h4>x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
457     
458     
459     
460     
461     
462     
463     
464     
465    </h4>
466
467   
468   
469   
470
471   
472    <h3>Keywords</h3>
473
474   
475    <a name="#_spl_incr_keyword_YP0"></a>
476    <h4>YP0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
477     
478     
479     
480     
481     
482     
483     
484     
485    </h4>
486
[242]487   
488 The first derivative of the interpolating function at the
[163]489    point X0. If YP0 is omitted, the second derivative at the
490    boundary is set to zero, resulting in a "natural spline."
[242]491
[163]492   
493    <a name="#_spl_incr_keyword_YPN_1"></a>
494    <h4>YPN_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
495     
496     
497     
498     
499     
500     
501     
502     
503    </h4>
504
[242]505   
506 The first derivative of the interpolating function at the
[163]507    point Xn-1. If YPN_1 is omitted, the second derivative at the
508    boundary is set to zero, resulting in a "natural spline."
509   
510   
511
512   
513   
514   
515   
516   
517   
518
519   
520   
521   
522   
523   
524
525   
526   
527   
528   
529   
530   
531   
532
533    <font size="-3"><p>&nbsp;</p></font>
534    <hr size="1" color="#CCCCCC"/>
535     
536
537   
538
[187]539    <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0.</font></p>
[163]540
541  </body>
[249]542</html>
Note: See TracBrowser for help on using the repository browser.