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

Last change on this file since 338 was 338, checked in by smasson, 16 years ago

update documentation

File size: 10.1 KB
Line 
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
66 spl_incr function returns an interpolated value for the given values
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>
80      <dd><font size="-1"> </font></dd>
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>
83      <dd><font size="-1"> </font></dd>
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>
101 y2: f(x2) = y2. Double precision array
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   
121 An n-elements (at least 2) input vector that specifies the tabulate points in
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   
157 f(x) = y. An n-elements input vector that specifies the values
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
214    <h3>Examples</h3><pre>
215 IDL> n = 100L
216 IDL> x = (dindgen(n))^2
217 IDL> y = abs(randomn(0, n))
218 IDL> y[n/2:n/2+1] = 0.
219 IDL> y[n-n/3] = 0.
220 IDL> y[n-n/6:n-n/6+5] = 0.
221 IDL> y = total(y, /cumulative, /double)
222 IDL> x2 = dindgen((n-1)^2)
223 IDL> n2 = n_elements(x2)
224 IDL> print, min(y[1:n-1]-y[0:n-2]) LT 0
225 IDL> y2 = spl_incr( x, y, x2)
226 IDL> splot, x, y, xstyle = 1, ystyle = 1, ysurx=.25, petit = [1, 2, 1], /land
227 IDL> oplot, x2, y2, color = 100
228 IDL> c = y2[1:n2-1] - y2[0:n2-2]
229 IDL> print, min(c) LT 0
230 IDL> print, min(c, max = ma), ma
231 IDL> splot,c,xstyle=1,ystyle=1, yrange=[-.01,.05], ysurx=.25, petit = [1, 2, 2], /noerase
232 IDL> oplot,[0, n_elements(c)], [0, 0], linestyle = 1
233
234    </pre><h3>Version history</h3>
235   
236    <h4>Version</h4>
237 $Id: spl_incr.pro 327 2007-12-13 16:22:35Z pinsard $
238
239    <h4>History</h4>
240  Sebastien Masson (smasson@lodyc.jussieu.fr): May-Dec 2005
241
242   
243
244    <h3>Known issues</h3>
245   
246   
247   
248    <h4>Restrictions</h4>
249 It might be possible that y2[i+1]-y2[i] has very small negative
250 values (amplitude smaller than 1.e-6)...
251
252
253   
254   
255   
256   
257   
258   
259   
260
261    <font size="-3"><p>&nbsp;</p></font>
262    <hr size="1" color="#CCCCCC"/>
263     
264      <a name="#_pure_convex"></a>
265
266      <h2>pure_convex  </h2>
267
268      <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>
269
270   
271
272
273   
274
275   
276    <h3>Parameters</h3>
277   
278
279    <a name="#_pure_convex_keyword_x1"></a>
280    <h4>x1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
281      <font size="-1" color="#006633">in</font>
282     
283     
284      <font size="-1" color="#006633">required</font>
285     
286     
287     
288     
289    </h4>
290
291   
292 An n-elements (at least 2) input vector that specifies the tabulate points in
293 a strict ascending order.
294
295   
296
297    <a name="#_pure_convex_keyword_x2"></a>
298    <h4>x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
299      <font size="-1" color="#006633">in</font>
300     
301     
302      <font size="-1" color="#006633">required</font>
303     
304     
305     
306     
307    </h4>
308
309   
310 The input values for which the interpolated values are
311 desired. Its values must be strictly monotonically increasing.
312
313   
314
315    <a name="#_pure_convex_keyword_y1"></a>
316    <h4>y1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
317      <font size="-1" color="#006633">in</font>
318     
319     
320      <font size="-1" color="#006633">required</font>
321     
322     
323     
324     
325    </h4>
326
327   
328 f(x) = y. An n-elements input vector that specifies the values
329    of the tabulated function F(Xi) corresponding to Xi. As f is
330    supposed to be monotonically increasing, y values must be
331    monotonically increasing. y can have equal consecutive values.
332
333   
334
335    <a name="#_pure_convex_keyword_y2"></a>
336    <h4>y2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
337     
338     
339     
340     
341     
342     
343     
344     
345    </h4>
346
347   
348   
349
350    <a name="#_pure_convex_keyword_der2"></a>
351    <h4>der2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
352     
353     
354     
355     
356     
357     
358     
359     
360    </h4>
361
362   
363
364   
365
366    <a name="#_pure_convex_keyword_x"></a>
367    <h4>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
368     
369     
370     
371     
372     
373     
374     
375     
376    </h4>
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    <font size="-3"><p>&nbsp;</p></font>
407    <hr size="1" color="#CCCCCC"/>
408     
409      <a name="#_spl_incr"></a>
410
411      <h2>spl_incr  </h2>
412
413      <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>
414
415   
416
417
418   
419
420   
421    <h3>Parameters</h3>
422   
423
424    <a name="#_spl_incr_keyword_x"></a>
425    <h4>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
426     
427     
428     
429     
430     
431     
432     
433     
434    </h4>
435
436   
437   
438
439    <a name="#_spl_incr_keyword_y"></a>
440    <h4>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
441     
442     
443     
444     
445     
446     
447     
448     
449    </h4>
450
451   
452   
453
454    <a name="#_spl_incr_keyword_x2"></a>
455    <h4>x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
456     
457     
458     
459     
460     
461     
462     
463     
464    </h4>
465
466   
467   
468   
469
470   
471    <h3>Keywords</h3>
472
473   
474    <a name="#_spl_incr_keyword_YP0"></a>
475    <h4>YP0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
476     
477     
478     
479     
480     
481     
482     
483     
484    </h4>
485
486   
487 The first derivative of the interpolating function at the
488    point X0. If YP0 is omitted, the second derivative at the
489    boundary is set to zero, resulting in a "natural spline."
490
491   
492    <a name="#_spl_incr_keyword_YPN_1"></a>
493    <h4>YPN_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
494     
495     
496     
497     
498     
499     
500     
501     
502    </h4>
503
504   
505 The first derivative of the interpolating function at the
506    point Xn-1. If YPN_1 is omitted, the second derivative at the
507    boundary is set to zero, resulting in a "natural spline."
508   
509   
510
511   
512   
513   
514   
515   
516   
517
518   
519   
520   
521   
522   
523
524   
525   
526   
527   
528   
529   
530   
531
532    <font size="-3"><p>&nbsp;</p></font>
533    <hr size="1" color="#CCCCCC"/>
534     
535
536   
537
538    <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0.</font></p>
539
540  </body>
541</html>
Note: See TracBrowser for help on using the repository browser.