<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve"><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><title>D02KDF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/D02/d02kdf.pdf">D02KDF (PDF version)</a></div><div><a class="chap" href="d02conts.xml">D02 Chapter Contents</a></div><div><a class="chapint" href="d02intro.xml">D02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>D02KDF</h1><div class="paramtext"><div class="header"><b>Note:</b>&#160; before using this routine, please read the Users' Note for your implementation to check the interpretation of <span class="bitalic">bold italicised</span> terms and other implementation-dependent details.</div></div> 
<div class="htmltoc">
<h2 class="htmltoc"><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">1&#160;&#160;<b>Purpose</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">2&#160;&#160;<b>Specification</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">3&#160;&#160;<b>Description</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">4&#160;&#160;<b>References</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">5&#160;&#160;<b>Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">6&#160;&#160;<b>Error Indicators and Warnings</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">7&#160;&#160;<b>Accuracy</b></a>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocfcomments');"><span class="htmltocplus" id="tocfcommentsplus">+</span><span class="htmltocminus" id="tocfcommentsminus">&#8722;</span></span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
<div class="htmltocitem" id="tocfcomments">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments1">8.1&#160;&#160;<b>Timing</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments2">8.2&#160;&#160;<b>General Description of the Algorithm</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments3">8.3&#160;&#160;<b>The Position of the Shooting Matching Point c</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments4">8.4&#160;&#160;<b>Examples of Coding the COEFFN</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments5">8.5&#160;&#160;<b>Examples of Boundary Conditions at Singular Points</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments6">8.6&#160;&#160;<b>The Sensitivity Parameters &#963;l and &#963;r</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments7">8.7&#160;&#160;<b>Missed Zeros</b></a>
</div>
</div>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocexample');"><span class="htmltocplus" id="tocexampleplus">+</span><span class="htmltocminus" id="tocexampleminus">&#8722;</span></span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocexample">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext">9.1&#160;&#160;<b>Program Text</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata">9.2&#160;&#160;<b>Program Data</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults">9.3&#160;&#160;<b>Program Results</b></a>
</div>
</div>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">D02KDF finds a specified eigenvalue of a regular or singular second-order Sturm&#8211;Liouville system on a finite or infinite interval, using a Pruefer transformation and a shooting method.  Provision is made for discontinuities in the coefficient functions or their derivatives.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;D02KDF&#160;(</td><td class="tdfspec2"><a class="arg" href="#XPOINT">XPOINT</a>, <a class="arg" href="#M">M</a>, <a class="arg" href="#COEFFN">COEFFN</a>, <a class="arg" href="#BDYVAL">BDYVAL</a>, <a class="arg" href="#K">K</a>, <a class="arg" href="#TOL">TOL</a>, <a class="arg" href="#ELAM">ELAM</a>, <a class="arg" href="#DELAM">DELAM</a>, <a class="arg" href="#HMAX">HMAX</a>, <a class="arg" href="#MAXIT">MAXIT</a>, <a class="arg" href="#MAXFUN">MAXFUN</a>, <a class="arg" href="#MONIT">MONIT</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">M, K, MAXIT, MAXFUN, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">XPOINT(M), TOL, ELAM, DELAM, HMAX(2,M)</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">COEFFN, BDYVAL, MONIT</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D02KDF finds a specified eigenvalue <m:math><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;of a Sturm&#8211;Liouville system defined by a self-adjoint differential equation of the second-order

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msup>
  <m:mfenced separators="">
   <m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced>
   <m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup>
  </m:mfenced>
  <m:mo>&#8242;</m:mo>
 </m:msup>
 <m:mo>+</m:mo>
 <m:mi>q</m:mi>
 <m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced>
 <m:mi>y</m:mi><m:mo>=</m:mo><m:mn>0</m:mn>
 <m:mtext>, &#8195;</m:mtext>
 <m:mi>a</m:mi><m:mo>&lt;</m:mo><m:mi>x</m:mi><m:mo>&lt;</m:mo><m:mi>b</m:mi>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

together with appropriate boundary conditions at the two, finite or infinite, end points <m:math><m:mi>a</m:mi></m:math>&#160;and <m:math><m:mi>b</m:mi></m:math>.  The functions <m:math><m:mi>p</m:mi></m:math>&#160;and <m:math><m:mi>q</m:mi></m:math>, which are real-valued, are defined by <a class="arg" href="#COEFFN">COEFFN</a>.  The boundary conditions must be defined by <a class="arg" href="#BDYVAL">BDYVAL</a>, and, in the case of a singularity at <m:math><m:mi>a</m:mi></m:math>&#160;or <m:math><m:mi>b</m:mi></m:math>, take the form of an asymptotic formula for the solution near the relevant end point.</div><div class="paramtext">For the theoretical basis of the numerical method to be valid, the following conditions should hold on the coefficient functions:
<table class="standard-100"><tr>
<td style="width:2.1em;" valign="baseline">(a)</td>
<td valign="top"><m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;must be nonzero and must not change sign throughout the interval <m:math><m:mfenced separators=""><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>; and,</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(b)</td>
<td valign="top"><m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>q</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>&#955;</m:mi></m:mrow>
 </m:mfrac>
</m:math>&#160;must not change sign throughout the interval <m:math><m:mfenced separators=""><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>&#160;for all relevant values of <m:math><m:mi>&#955;</m:mi></m:math>, and must not be identically zero as <m:math><m:mi>x</m:mi></m:math>&#160;varies, for any <m:math><m:mi>&#955;</m:mi></m:math>.</td>
</tr></table>
</div><div class="paramtext">Points of discontinuity in the functions <m:math><m:mi>p</m:mi></m:math>&#160;and <m:math><m:mi>q</m:mi></m:math>&#160;or their derivatives are allowed, and should be included as &#8216;break points&#8217; in the array <a class="arg" href="#XPOINT">XPOINT</a>.</div><div class="paramtext">The eigenvalue <m:math><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;is determined by a shooting method based on the Scaled Pruefer form of the differential equation as described in <a class="ref" href="#ref030">Pryce (1981)</a>, with certain modifications.  The  Pruefer equations are integrated by a special internal routine using Merson's  Runge&#8211;Kutta formula with automatic control of local error.  Providing certain assumptions (see <a class="sec" href="#fcomments1">Section 8.1</a>) are met, the computed value of <m:math><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;will be correct to within a mixed absolute/relative error specified by <a class="arg" href="#TOL">TOL</a>.</div><div class="paramtext">A good account of the theory of Sturm&#8211;Liouville systems, with some description of Pruefer transformations, is given in Chapter X of <a class="ref" href="#ref029">Birkhoff and Rota (1962)</a>.  An introduction to the use of Pruefer transformations for the numerical solution of eigenvalue problems arising from physics and chemistry is given in <a class="ref" href="#ref027">Bailey (1966)</a>.</div><div class="paramtext">The scaled Pruefer method is described in a short note by <a class="ref" href="#ref031">Pryce and Hargrave (1977)</a> and in some detail in the technical report by <a class="ref" href="#ref030">Pryce (1981)</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref126" id="ref126"/>Abramowitz M and Stegun I A (1972)  <i>Handbook of Mathematical Functions</i> (3rd Edition) Dover Publications </div>
<div class="paramtext"><a name="ref027" id="ref027"/>Bailey P B (1966)  Sturm&#8211;Liouville eigenvalues via a phase function <i>SIAM J. Appl. Math. </i> <b>14</b> 242&#8211;249 </div>
<div class="paramtext"><a name="ref028" id="ref028"/>Banks D O and Kurowski I (1968)  Computation of eigenvalues of singular Sturm&#8211;Liouville Systems <i>Math. Comput.</i> <b>22</b> 304&#8211;310 </div>
<div class="paramtext"><a name="ref029" id="ref029"/>Birkhoff G and Rota G C (1962)  <i>Ordinary Differential Equations</i> Ginn &amp; Co., Boston and New York </div>
<div class="paramtext"><a name="ref030" id="ref030"/>Pryce J D (1981)  Two codes for Sturm&#8211;Liouville problems <i>Technical Report CS-81-01</i> Department of Computer Science, Bristol University </div>
<div class="paramtext"><a name="ref031" id="ref031"/>Pryce J D and Hargrave B A (1977)  The scaled Pr&#252;fer method for one-parameter and multi-parameter eigenvalue problems in ODEs <i>IMA Numerical Analysis Newsletter</i> <b>1 (3)</b> </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="XPOINT" id="XPOINT"/>1: &#160;&#160;&#8194; XPOINT(<a class="arg" href="#M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the points where the boundary conditions computed by <a class="arg" href="#BDYVAL">BDYVAL</a> are to be imposed, and also any break points, i.e., <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;to <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>m</m:mi></m:mfenced></m:mrow></m:math>&#160;must contain values <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub></m:math>&#160;such that 
<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> <m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub><m:mo>&lt;</m:mo><m:mo>&#8943;</m:mo><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub> </m:math></td><td class="formula2"/></tr></table></div>
 with the following meanings: 
<table class="standard-90"><tr>
<td style="width:2.1em;" valign="baseline">(a)</td>
<td valign="top"><m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub></m:math>&#160;are the left- and right-hand end points, <m:math><m:mi>a</m:mi></m:math>&#160;and <m:math><m:mi>b</m:mi></m:math>, of the domain of definition of the Sturm&#8211;Liouville system if these are finite. If either <m:math><m:mi>a</m:mi></m:math>&#160;or <m:math><m:mi>b</m:mi></m:math>&#160;is infinite, the corresponding value <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>&#160;or <m:math><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub></m:math>&#160;may be a more-or-less arbitrarily &#8216;large&#8217; number of appropriate sign.</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(b)</td>
<td valign="top"><m:math><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:math>&#160;are the Boundary Matching Points (BMPs), that is the points at which the left and right boundary conditions computed in <a class="arg" href="#BDYVAL">BDYVAL</a> are imposed.
<div class="paramtext">If the left-hand end point is a regular point then you should set <m:math><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>&#160;<m:math><m:mfenced separators=""><m:mo>=</m:mo><m:mi>a</m:mi></m:mfenced></m:math>, while if it is a singular point you must set <m:math><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>&gt;</m:mo><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>. Similarly <m:math><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub></m:math>&#160;(<m:math><m:mtext/><m:mo>=</m:mo><m:mi>b</m:mi></m:math>) if the right-hand end point is regular, and <m:math><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub></m:math>&#160;if it is singular.</div></td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(c)</td>
<td valign="top">The remaining <m:math><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>4</m:mn></m:math>&#160;points <m:math><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:msub></m:math>, if any, define &#8216;break points&#8217; which divide the interval <m:math><m:mfenced separators="" open="[" close="]"><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:mfenced></m:math>&#160;into <m:math><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>3</m:mn></m:math>&#160;sub-intervals 
<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> <m:msub><m:mi>i</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:mfenced separators="" open="[" close="]"><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub></m:mfenced><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>i</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>3</m:mn></m:mrow></m:msub><m:mo>=</m:mo><m:mfenced separators="" open="[" close="]"><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:mfenced><m:mtext>.</m:mtext> </m:math></td><td class="formula2"/></tr></table></div>

Numerical integration of the differential equation is stopped and restarted at each break point. In simple cases no break points are needed. However, if <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;or <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;are given by different formulae in different parts of the interval, then integration is more efficient if the range is broken up by break points in the appropriate way. Similarly points where any jumps occur in <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;or <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced></m:math>, or in their derivatives up to the fifth-order, should appear as break points.
<div class="paramtext">Examples are given in <a class="sec" href="#fcomments">Sections 8</a> and <a class="sec" href="#example">9</a>. <a class="arg" href="#XPOINT">XPOINT</a> determines the position of the Shooting Matching Point (SMP), as explained in <a class="sec" href="#fcomments3">Section 8.3</a>.</div></td>
</tr></table>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>&#8804;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mo>&#8943;</m:mo><m:mo>&lt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>&#8804;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:mfenced></m:mrow></m:math>.
</div></dd><dt class="paramhead"><a name="M" id="M"/>2: &#160;&#160;&#8194; M &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: 

the number of points in the array <a class="arg" href="#XPOINT">XPOINT</a>.</div>
<div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>4</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="COEFFN" id="COEFFN"/>3: &#160;&#160;&#8194; COEFFN &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#COEFFN">COEFFN</a> must compute the values of the coefficient functions <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;for given values of <m:math><m:mi>x</m:mi></m:math>&#160;and <m:math><m:mi>&#955;</m:mi></m:math>. <a class="sec" href="#description">Section 3</a> states the conditions which <m:math><m:mi>p</m:mi></m:math>&#160;and <m:math><m:mi>q</m:mi></m:math>&#160;must satisfy.
<a class="sec" href="#fcomments4">Sections 8.4</a> and <a class="sec" href="#example">9</a></div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#COEFFN">COEFFN</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;COEFFN&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02kdf.xml#COEFFN_P">P</a>, <a class="arg" href="../D02/d02kdf.xml#COEFFN_Q">Q</a>, <a class="arg" href="../D02/d02kdf.xml#COEFFN_DQDL">DQDL</a>, <a class="arg" href="../D02/d02kdf.xml#COEFFN_X">X</a>, <a class="arg" href="../D02/d02kdf.xml#COEFFN_ELAM">ELAM</a>, <a class="arg" href="../D02/d02kdf.xml#COEFFN_JINT">JINT</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">JINT</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">P, Q, DQDL, X, ELAM</td></tr></table>
<dl><dt class="paramhead"><a name="COEFFN_P" id="COEFFN_P"/>1: &#160;&#160;&#8194; P &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the value of <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;for the current value of <m:math><m:mi>x</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="COEFFN_Q" id="COEFFN_Q"/>2: &#160;&#160;&#8194; Q &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the value of <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;for the current value of <m:math><m:mi>x</m:mi></m:math>&#160;and the current trial value of <m:math><m:mi>&#955;</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="COEFFN_DQDL" id="COEFFN_DQDL"/>3: &#160;&#160;&#8194; DQDL &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the value of <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>q</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>&#955;</m:mi></m:mrow>
 </m:mfrac>
 <m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced>
</m:math>&#160;for the current value of <m:math><m:mi>x</m:mi></m:math>&#160;and the current trial value of <m:math><m:mi>&#955;</m:mi></m:math>. However <a class="arg" href="../D02/d02kdf.xml#COEFFN_DQDL">DQDL</a> is only used in error estimation and, in the rare cases where it may be difficult to evaluate, an approximation (say to within <m:math><m:mn>20</m:mn><m:mo>%</m:mo></m:math>) will suffice.</div></dd><dt class="paramhead"><a name="COEFFN_X" id="COEFFN_X"/>4: &#160;&#160;&#8194; X &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the current value of <m:math><m:mi>x</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="COEFFN_ELAM" id="COEFFN_ELAM"/>5: &#160;&#160;&#8194; ELAM &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the current trial value of the eigenvalue parameter <m:math><m:mi>&#955;</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="COEFFN_JINT" id="COEFFN_JINT"/>6: &#160;&#160;&#8194; JINT &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the index <m:math><m:mi>j</m:mi></m:math>&#160;of the sub-interval <m:math><m:msub><m:mi>i</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;(see specification of <a class="arg" href="#XPOINT">XPOINT</a>) in which <m:math><m:mi>x</m:mi></m:math>&#160;lies.</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#COEFFN">COEFFN</a> must be declared as EXTERNAL in the (sub)program from which D02KDF is called. Parameters denoted as <span class="italic">Input</span>  must <b>not</b>  be changed by this procedure.</div>
</dd><dt class="paramhead"><a name="BDYVAL" id="BDYVAL"/>4: &#160;&#160;&#8194; BDYVAL &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#BDYVAL">BDYVAL</a> must define the boundary conditions. For each end point, <a class="arg" href="#BDYVAL">BDYVAL</a> must return (in <a class="arg" href="../D02/d02kdf.xml#BDYVAL_YL">YL</a> or <a class="arg" href="../D02/d02kdf.xml#BDYVAL_YR">YR</a>) values of <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;which are consistent with the boundary conditions at the end points; only the ratio of the values matters. Here <m:math><m:mi>x</m:mi></m:math>&#160;is a given point (<a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a> or <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a>) equal to, or close to, the end point.</div>
<div class="paramtext">For a <b>regular</b> end point (<m:math><m:mi>a</m:mi></m:math>, say), <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>a</m:mi></m:math>, a boundary condition of the form 
<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> <m:msub><m:mi>c</m:mi><m:mn>1</m:mn></m:msub><m:mi>y</m:mi><m:mfenced separators=""><m:mi>a</m:mi></m:mfenced><m:mo>+</m:mo><m:msub><m:mi>c</m:mi><m:mn>2</m:mn></m:msub><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mfenced separators=""><m:mi>a</m:mi></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn> </m:math></td><td class="formula2"/></tr></table></div>
 can be handled by returning constant values in <a class="arg" href="../D02/d02kdf.xml#BDYVAL_YL">YL</a>, e.g., <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:msub><m:mi>c</m:mi><m:mn>2</m:mn></m:msub></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mo>-</m:mo><m:msub><m:mi>c</m:mi><m:mn>1</m:mn></m:msub><m:mi>p</m:mi><m:mfenced separators=""><m:mi>a</m:mi></m:mfenced></m:math>.</div>
<div class="paramtext">For a <b>singular</b> end point however, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;will in general be functions of <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a> and <a class="arg" href="../D02/d02kdf.xml#BDYVAL_ELAM">ELAM</a>, and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;functions of <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a> and <a class="arg" href="../D02/d02kdf.xml#BDYVAL_ELAM">ELAM</a>, usually derived analytically from a power-series or asymptotic expansion. Examples are given in <a class="sec" href="#fcomments5">Sections 8.5</a> and <a class="sec" href="#example">9</a>.</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#BDYVAL">BDYVAL</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;BDYVAL&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a>, <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a>, <a class="arg" href="../D02/d02kdf.xml#BDYVAL_ELAM">ELAM</a>, <a class="arg" href="../D02/d02kdf.xml#BDYVAL_YL">YL</a>, <a class="arg" href="../D02/d02kdf.xml#BDYVAL_YR">YR</a>)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">XL, XR, ELAM, YL(3), YR(3)</td></tr></table>
<dl><dt class="paramhead"><a name="BDYVAL_XL" id="BDYVAL_XL"/>1: &#160;&#160;&#8194; XL &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:mi>a</m:mi></m:math>&#160;is a regular end point of the system (so that <m:math><m:mi>a</m:mi><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:math>), then <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a> contains <m:math><m:mi>a</m:mi></m:math>. If <m:math><m:mi>a</m:mi></m:math>&#160;is a singular point (so that <m:math><m:mi>a</m:mi><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:math>), then <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a> contains a point <m:math><m:mi>x</m:mi></m:math>&#160;such that <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>&lt;</m:mo><m:mi>x</m:mi><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:math>.</div></dd><dt class="paramhead"><a name="BDYVAL_XR" id="BDYVAL_XR"/>2: &#160;&#160;&#8194; XR &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:mi>b</m:mi></m:math>&#160;is a regular end point of the system (so that <m:math><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub><m:mo>=</m:mo><m:mi>b</m:mi></m:math>), then <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a> contains <m:math><m:mi>b</m:mi></m:math>. If <m:math><m:mi>b</m:mi></m:math>&#160;is a singular point (so that <m:math><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub><m:mo>&#8804;</m:mo><m:mi>b</m:mi></m:math>), then <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a> contains a point <m:math><m:mi>x</m:mi></m:math>&#160;such that <m:math><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>&#8804;</m:mo><m:mi>x</m:mi><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mi>m</m:mi></m:msub></m:math>.</div></dd><dt class="paramhead"><a name="BDYVAL_ELAM" id="BDYVAL_ELAM"/>3: &#160;&#160;&#8194; ELAM &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the current trial value of <m:math><m:mi>&#955;</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="BDYVAL_YL" id="BDYVAL_YL"/>4: &#160;&#160;&#8194; YL(<m:math><m:mn>3</m:mn></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;should contain values of <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;respectively (not both zero) which are consistent with the boundary condition at the left-hand end point, given by <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_XL"><m:mi mathcolor="#EE0000" mathvariant="bold">XL</m:mi></m:maction></m:math>. <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>3</m:mn></m:mfenced></m:mrow></m:math>&#160;should not be set.</div></dd><dt class="paramhead"><a name="BDYVAL_YR" id="BDYVAL_YR"/>5: &#160;&#160;&#8194; YR(<m:math><m:mn>3</m:mn></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;should contain values of <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;respectively (not both zero) which are consistent with the boundary condition at the right-hand end point, given by <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_XR"><m:mi mathcolor="#EE0000" mathvariant="bold">XR</m:mi></m:maction></m:math>. <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>3</m:mn></m:mfenced></m:mrow></m:math>&#160;should not be set.</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#BDYVAL">BDYVAL</a> must be declared as EXTERNAL in the (sub)program from which D02KDF is called. Parameters denoted as <span class="italic">Input</span>  must <b>not</b>  be changed by this procedure.</div>
</dd><dt class="paramhead"><a name="K" id="K"/>5: &#160;&#160;&#8194; K &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:mi>k</m:mi></m:math>, the index of the required eigenvalue when the eigenvalues are ordered 
 
<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
  <m:msub><m:mi>&#955;</m:mi><m:mn>0</m:mn></m:msub>
  <m:mo>&lt;</m:mo>
  <m:msub><m:mi>&#955;</m:mi><m:mn>1</m:mn></m:msub>
  <m:mo>&lt;</m:mo>
  <m:msub><m:mi>&#955;</m:mi><m:mn>2</m:mn></m:msub>
  <m:mo>&lt;</m:mo>
  <m:mo>&#8943;</m:mo>
  <m:mo>&lt;</m:mo>
  <m:msub><m:mi>&#955;</m:mi><m:mi>k</m:mi></m:msub>
  <m:mo>&lt;</m:mo>
  <m:mo>&#8943;</m:mo>
  <m:mtext>.</m:mtext>
 </m:math></td><td class="formula2"/></tr></table></div></div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#K"><m:mi mathcolor="#EE0000" mathvariant="bold">K</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="TOL" id="TOL"/>6: &#160;&#160;&#8194; TOL &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the tolerance parameter which determines the accuracy of the computed eigenvalue. The error estimate held in <a class="arg" href="#DELAM">DELAM</a> on exit satisfies the mixed absolute/relative error test 
<div class="formula-eqn"><a name="eqn1" id="eqn1"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block"> <m:maction actiontype="link" dsi:type="simple" dsi:href="#DELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">DELAM</m:mi></m:maction><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>&#215;</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1.0</m:mn><m:mo>,</m:mo><m:mfenced open="|" close="|" separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#ELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">ELAM</m:mi></m:maction></m:mfenced></m:mfenced></m:mrow><m:mtext>,</m:mtext> </m:math></td><td class="formula-eqn2">
      (1)
     </td></tr></table></div>
 where <a class="arg" href="#ELAM">ELAM</a> is the final estimate of the eigenvalue. <a class="arg" href="#DELAM">DELAM</a> is usually somewhat smaller than the right-hand side of <a class="eqn" href="#eqn1">(1)</a> but not several orders of magnitude smaller.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0.0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="ELAM" id="ELAM"/>7: &#160;&#160;&#8194; ELAM &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: an initial estimate of the eigenvalue <m:math><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover></m:math>.</div>
<div class="paramtext"><i>On exit</i>: the final computed estimate, whether or not an error occurred.</div></dd><dt class="paramhead"><a name="DELAM" id="DELAM"/>8: &#160;&#160;&#8194; DELAM &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: an indication of the scale of the problem in the <m:math><m:mi>&#955;</m:mi></m:math>-direction. <a class="arg" href="#DELAM">DELAM</a> holds the initial &#8216;search step&#8217; (positive or negative). Its value is not critical, but the first two trial evaluations are made at <a class="arg" href="#ELAM">ELAM</a> and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">ELAM</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#DELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">DELAM</m:mi></m:maction></m:math>, so the routine will work most efficiently if the eigenvalue lies between these values. A reasonable choice (if a closer bound is not known) is half the distance between adjacent eigenvalues in the neighbourhood of the one sought. In practice, there will often be a problem, similar to the one in hand but with known eigenvalues, which will help one to choose initial values for <a class="arg" href="#ELAM">ELAM</a> and <a class="arg" href="#DELAM">DELAM</a>.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#DELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">DELAM</m:mi></m:maction><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>&#160;on entry, it is given the default value of <m:math><m:mn>0.25</m:mn><m:mo>&#215;</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1.0</m:mn><m:mo>,</m:mo><m:mfenced open="|" close="|" separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#ELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">ELAM</m:mi></m:maction></m:mfenced></m:mfenced></m:mrow></m:math>.</div>
</div>
<div class="paramtext"><i>On exit</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>, <a class="arg" href="#DELAM">DELAM</a> holds an estimate of the absolute error in the computed eigenvalue, that is <m:math><m:mfenced open="|" close="|" separators=""><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover><m:mo>-</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#ELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">ELAM</m:mi></m:maction></m:mfenced><m:mo>&#8771;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#DELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">DELAM</m:mi></m:maction></m:math>. (In <a class="sec" href="#fcomments2">Section 8.2</a> we discuss the assumptions under which this is true.) The true error is rarely more than twice, or less than a tenth, of the estimated error.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>&#8800;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>, <a class="arg" href="#DELAM">DELAM</a> may hold an estimate of the error, or its initial value, depending on the value of <a class="arg" href="#IFAIL">IFAIL</a>. See <a class="sec" href="#errors">Section 6</a> for further details.</div>
</div></dd><dt class="paramhead"><a name="HMAX" id="HMAX"/>9: &#160;&#160;&#8194; HMAX(<m:math><m:mn>2</m:mn></m:math>,<a class="arg" href="#M">M</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;should contain a maximum step size to be used by the differential equation code in the <m:math><m:mi>j</m:mi></m:math>th sub-interval <m:math><m:msub><m:mi>i</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;(as described in the specification of parameter <a class="arg" href="#XPOINT">XPOINT</a>), for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>3</m:mn></m:math>. If it is zero the routine generates a maximum step size internally.
<div class="paramtext">It is recommended that <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;be set to zero unless the coefficient functions <m:math><m:mi>p</m:mi></m:math>&#160;and <m:math><m:mi>q</m:mi></m:math>&#160;have features (such as a narrow peak) within the <m:math><m:mi>j</m:mi></m:math>th sub-interval that could be &#8216;missed&#8217; if a long step were taken. In such a case <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;should be set to about half the distance over which the feature should be observed. Too small a value will increase the computing time for the routine. See <a class="sec" href="#fcomments">Section 8</a> for further suggestions.</div>
<div class="paramtext">The rest of the array is used as workspace.</div>
</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mi>m</m:mi></m:mfenced></m:mrow></m:math>&#160;contain the sensitivity coefficients <m:math><m:msub><m:mi>&#963;</m:mi><m:mi>l</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>&#963;</m:mi><m:mi>r</m:mi></m:msub></m:math>, described in <a class="sec" href="#fcomments6">Section 8.6</a>. Other entries contain diagnostic output in the case of an error exit (see <a class="sec" href="#errors">Section 6</a>).</div></dd><dt class="paramhead"><a name="MAXIT" id="MAXIT"/>10: &#8194; MAXIT &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: a bound on <m:math><m:msub><m:mi>n</m:mi><m:mi>r</m:mi></m:msub></m:math>, the number of root-finding iterations allowed, that is the number of trial values of <m:math><m:mi>&#955;</m:mi></m:math>&#160;that are used. If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXIT"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXIT</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0</m:mn></m:math>, no such bound is assumed. (See also <a class="arg" href="#MAXFUN">MAXFUN</a>.)</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXIT"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXIT</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>.

</div>
<div class="paramtext"><i>On exit</i>: will have been decreased by the number of iterations actually performed, whether or not it was positive on entry.</div></dd><dt class="paramhead"><a name="MAXFUN" id="MAXFUN"/>11: &#8194; MAXFUN &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: a bound on <m:math><m:msub><m:mi>n</m:mi><m:mi>f</m:mi></m:msub></m:math>, the number of calls to <a class="arg" href="#COEFFN">COEFFN</a> made in any one root-finding iteration. If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXFUN"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXFUN</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0</m:mn></m:math>, no such bound is assumed.</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXFUN"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXFUN</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>.
<div class="paramtext"><a class="arg" href="#MAXFUN">MAXFUN</a> and <a class="arg" href="#MAXIT">MAXIT</a> may be used to limit the computational cost of a call to D02KDF, which is roughly proportional to <m:math><m:msub><m:mi>n</m:mi><m:mi>r</m:mi></m:msub><m:mo>&#215;</m:mo><m:msub><m:mi>n</m:mi><m:mi>f</m:mi></m:msub></m:math>.</div></div></dd><dt class="paramhead"><a name="MONIT" id="MONIT"/>12: &#8194; MONIT &#8211; SUBROUTINE, supplied by the NAG Library or the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#MONIT">MONIT</a> is called by D02KDF at the end of each root-finding iteration and allows you to monitor the course of the computation by printing out the parameters (see <a class="sec" href="#example">Section 9</a> for an example).</div>
<div class="paramtext">If no monitoring is required, the dummy (sub)program D02KAY may be used. (D02KAY is included in the NAG Library.)</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#MONIT">MONIT</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;MONIT&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02kdf.xml#MONIT_MAXIT">MAXIT</a>, <a class="arg" href="../D02/d02kdf.xml#MONIT_IFLAG">IFLAG</a>, <a class="arg" href="../D02/d02kdf.xml#MONIT_ELAM">ELAM</a>, <a class="arg" href="../D02/d02kdf.xml#MONIT_FINFO">FINFO</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">MAXIT, IFLAG</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">ELAM, FINFO(15)</td></tr></table>
<dl><dt class="paramhead"><a name="MONIT_MAXIT" id="MONIT_MAXIT"/>1: &#160;&#160;&#8194; MAXIT &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the current value of the parameter <a class="arg" href="../D02/d02kdf.xml#MONIT_MAXIT">MAXIT</a> of D02KDF, this is decreased by one at each iteration.</div></dd><dt class="paramhead"><a name="MONIT_IFLAG" id="MONIT_IFLAG"/>2: &#160;&#160;&#8194; IFLAG &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: describes what phase the computation is in. 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>An error occurred in the computation at this iteration; an error exit from D02KDF with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mo>-</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction></m:math>&#160;will follow.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>The routine is trying to bracket the eigenvalue <m:math><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>The routine is converging to the eigenvalue <m:math><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;(having already bracketed it).</dd></dl>
</div></dd><dt class="paramhead"><a name="MONIT_ELAM" id="MONIT_ELAM"/>3: &#160;&#160;&#8194; ELAM &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the current trial value of <m:math><m:mi>&#955;</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="MONIT_FINFO" id="MONIT_FINFO"/>4: &#160;&#160;&#8194; FINFO(<m:math><m:mn>15</m:mn></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: information about the behaviour of the shooting method, and diagnostic information in the case of errors. It should not normally be printed in full if no error has occurred (that is, if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>), though the first few components may be of interest to you. In case of an error (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>) all the components of <a class="arg" href="../D02/d02kdf.xml#MONIT_FINFO">FINFO</a> should be printed.
<div class="paramtext">The contents of <a class="arg" href="../D02/d02kdf.xml#MONIT_FINFO">FINFO</a> are as follows:

<dl>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The current value of the &#8216;miss-distance&#8217; or &#8216;residual&#8217; function <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;on which the shooting method is based. (See <a class="sec" href="#fcomments2">Section 8.2</a> for further information.) <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;is set to zero if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>An estimate of the quantity <m:math><m:mi>&#8706;</m:mi><m:mi>&#955;</m:mi></m:math>&#160;defined as follows. Consider the perturbation in the miss-distance <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;that would result if the local error in the solution of the differential equation were always positive and equal to its maximum permitted value. Then <m:math><m:mi>&#8706;</m:mi><m:mi>&#955;</m:mi></m:math>&#160;is the perturbation in <m:math><m:mi>&#955;</m:mi></m:math>&#160;that would have the same effect on <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>. Thus, at the zero of <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced><m:mo>,</m:mo><m:mfenced open="|" close="|" separators=""><m:mi>&#8706;</m:mi><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;is an approximate bound on the perturbation of the zero (that is the eigenvalue) caused by errors in numerical solution. If <m:math><m:mi>&#8706;</m:mi><m:mi>&#955;</m:mi></m:math>&#160;is very large then it is possible that there has been a programming error in <a class="arg" href="#COEFFN">COEFFN</a> such that <m:math><m:mi>q</m:mi></m:math>&#160;is independent of <m:math><m:mi>&#955;</m:mi></m:math>. If this is the case, an error exit with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq5"><m:mn mathcolor="#003399" mathvariant="bold">5</m:mn></m:maction></m:math>&#160;should follow. <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;is set to zero if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>3</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of internal iterations, using the same value of <m:math><m:mi>&#955;</m:mi></m:math>&#160;and tighter accuracy tolerances, needed to bring the accuracy (that is, the value of <m:math><m:mi>&#8706;</m:mi><m:mi>&#955;</m:mi></m:math>) to an acceptable value. Its value should normally be <m:math><m:mn>1.0</m:mn></m:math>, and should almost never exceed <m:math><m:mn>2.0</m:mn></m:math>.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>4</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of calls to <a class="arg" href="#COEFFN">COEFFN</a> at this iteration.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>5</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of successful steps taken by the internal differential equation solver at this iteration. A step is successful if it is used to advance the integration.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>6</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of unsuccessful steps used by the internal integrator at this iteration.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>7</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of successful steps at the maximum step size taken by the internal integrator at this iteration.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>8</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>Not used.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>9</m:mn></m:mfenced></m:mrow></m:math>&#160;to <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>15</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>Set to zero, unless <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_IFLAG"><m:mi mathcolor="#EE0000" mathvariant="bold">IFLAG</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>&#160;in which case they hold the following values describing the point of failure: 

<dl>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>9</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The index of the sub-interval where failure occurred, in the range <m:math><m:mn>1</m:mn></m:math>&#160;to <m:math><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>3</m:mn></m:math>. In case of an error in <a class="arg" href="#BDYVAL">BDYVAL</a>, it is set to <m:math><m:mn>0</m:mn></m:math>&#160;or <m:math><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>2</m:mn></m:math>&#160;depending on whether the left or right boundary condition caused the error.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>10</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The value of the independent variable, <m:math><m:mi>x</m:mi></m:math>, the point at which the error occurred. In case of an error in <a class="arg" href="#BDYVAL">BDYVAL</a>, it is set to the value of <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a> or <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a> as appropriate (see the specification of <a class="arg" href="#BDYVAL">BDYVAL</a>).</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>11</m:mn></m:mfenced></m:mrow></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>12</m:mn></m:mfenced></m:mrow></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>13</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The current values of the Pruefer dependent variables <m:math><m:mi>&#946;</m:mi></m:math>, <m:math><m:mi>&#981;</m:mi></m:math>&#160;and <m:math><m:mi>&#961;</m:mi></m:math>&#160;respectively. These are set to zero in case of an error in <a class="arg" href="#BDYVAL">BDYVAL</a>.
<a class="rout" href="../D02/d02kef.xml">D02KEF</a></dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>14</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The local-error tolerance being used by the internal integrator at the point of failure. This is set to zero in the case of an error in <a class="arg" href="#BDYVAL">BDYVAL</a>.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONIT_FINFO"><m:mi mathcolor="#EE0000" mathvariant="bold">FINFO</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>15</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The last integration mesh point. This is set to zero in the case of an error in <a class="arg" href="#BDYVAL">BDYVAL</a>.</dd></dl></dd></dl>
</div>
</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#MONIT">MONIT</a> must be declared as EXTERNAL in the (sub)program from which D02KDF is called. Parameters denoted as <span class="italic">Input</span>  must <b>not</b>  be changed by this procedure.</div>
</dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>13: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>). <div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn mathvariant="bold">1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div></div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeq1" id="IFeq1"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>
<div class="paramtext">A parameter error.  All parameters (except <a class="arg" href="#IFAIL">IFAIL</a>) are left unchanged.  The reason for the error is shown by the value of <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;as follows:
<table class="standard-90"><tr>
<td style="width:9.0em;" valign="baseline"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>1</m:mn></m:math>:</td>
<td valign="top"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>4</m:mn></m:math>;</td>
</tr><tr>
<td style="width:9.0em;" valign="baseline"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>2</m:mn></m:math>:</td>
<td valign="top"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#K"><m:mi mathcolor="#EE0000" mathvariant="bold">K</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>;</td>
</tr><tr>
<td style="width:9.0em;" valign="baseline"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>3</m:mn></m:math>:</td>
<td valign="top"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0.0</m:mn></m:math>;</td>
</tr><tr>
<td style="width:9.0em;" valign="baseline"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>4</m:mn></m:math>:</td>
<td valign="top"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;to <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XPOINT"><m:mi mathcolor="#EE0000" mathvariant="bold">XPOINT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>m</m:mi></m:mfenced></m:mrow></m:math>&#160;are not in ascending order.  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;gives the position <m:math><m:mi>i</m:mi></m:math>&#160;in <a class="arg" href="#XPOINT">XPOINT</a> where this was detected.</td>
</tr></table>
</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq2" id="IFeq2"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>
<div class="paramtext">At some call to <a class="arg" href="#BDYVAL">BDYVAL</a>, invalid values were returned, that is, either <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>, or <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>&#160;(a programming error in <a class="arg" href="#BDYVAL">BDYVAL</a>). See the last call of <a class="arg" href="#MONIT">MONIT</a> for details.</div><div class="paramtext">This error exit will also occur if <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is zero at the point where the boundary condition is imposed. Probably <a class="arg" href="#BDYVAL">BDYVAL</a> was called with <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a> equal to a singular end point <m:math><m:mi>a</m:mi></m:math>&#160;or with <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a> equal to a singular end point <m:math><m:mi>b</m:mi></m:math>.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq3" id="IFeq3"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>
<div class="paramtext">At some point between <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XL">XL</a> and <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a> the value of <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;computed by <a class="arg" href="#COEFFN">COEFFN</a> became zero or changed sign. See the last call of <a class="arg" href="#MONIT">MONIT</a> for details.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq4" id="IFeq4"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn></m:math></dt>
<dd>
<div class="paramtext"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXIT"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXIT</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>&#160;on entry, and after <a class="arg" href="#MAXIT">MAXIT</a> iterations the eigenvalue had not been found to the required accuracy.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq5" id="IFeq5"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>5</m:mn></m:math></dt>
<dd>
<div class="paramtext">The &#8216;bracketing&#8217; phase (with parameter <a class="arg" href="../D02/d02kdf.xml#MONIT_IFLAG">IFLAG</a> of the <a class="arg" href="#MONIT">MONIT</a> equal to <m:math><m:mn>1</m:mn></m:math>) failed to bracket the eigenvalue within ten iterations.  This is caused by an error in formulating the problem (for example, <m:math><m:mi>q</m:mi></m:math>&#160;is independent of <m:math><m:mi>&#955;</m:mi></m:math>), or by very poor initial estimates of <a class="arg" href="#ELAM">ELAM</a> and <a class="arg" href="#DELAM">DELAM</a>.</div><div class="paramtext">On exit, <a class="arg" href="#ELAM">ELAM</a> and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">ELAM</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#DELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">DELAM</m:mi></m:maction></m:math>&#160;give the end points of the interval within which no eigenvalue was located by the routine.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq6" id="IFeq6"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>6</m:mn></m:math></dt>
<dd>
<div class="paramtext"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXFUN"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXFUN</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>&#160;on entry, and the last iteration was terminated because more than <a class="arg" href="#MAXFUN">MAXFUN</a> calls to <a class="arg" href="#COEFFN">COEFFN</a> were used. See the last call of <a class="arg" href="#MONIT">MONIT</a> for details.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq7" id="IFeq7"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>7</m:mn></m:math></dt>
<dd>
<div class="paramtext">To obtain the desired accuracy the local error tolerance was set so small at the start of some sub-interval that the differential equation solver could not choose an initial step size large enough to make significant progress. See the last call of <a class="arg" href="#MONIT">MONIT</a> for diagnostics.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq8" id="IFeq8"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>8</m:mn></m:math></dt>
<dd>
<div class="paramtext">At some point inside a sub-interval the step size in the differential equation solver was reduced to a value too small to make significant progress (for the same reasons as with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq7"><m:mn mathcolor="#003399" mathvariant="bold">7</m:mn></m:maction></m:math>).  This could be due to pathological behaviour of <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;or to an unreasonable accuracy requirement or to the current value of <m:math><m:mi>&#955;</m:mi></m:math>&#160;making the equations &#8216;stiff&#8217;.  See the last call of <a class="arg" href="#MONIT">MONIT</a> for details.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq9" id="IFeq9"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>9</m:mn></m:math></dt>
<dd>
<div class="paramtext"><a class="arg" href="#TOL">TOL</a> is too small for the problem being solved and the <span class="bitalic">machine precision</span> is being used.  The final value of <a class="arg" href="#ELAM">ELAM</a> should be a very good approximation to the eigenvalue.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq10" id="IFeq10"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>10</m:mn></m:math></dt>
<dd>
<div class="paramtext"><a class="rout" href="../C05/c05azf.xml">C05AZF</a>, called by D02KDF, has terminated with the error exit corresponding to a pole of the residual function <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>.  This error exit should not occur, but if it does, try solving the problem again with a smaller value for <a class="arg" href="#TOL">TOL</a>.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq11" id="IFeq11"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>11</m:mn></m:math></dt>
<dt class="multi-errorhead"><a name="IFeq12" id="IFeq12"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>12</m:mn></m:math></dt>
<dd>
<div class="paramtext">A serious error has occurred in an internal call. Check all (sub)program calls and array dimensions. Seek expert help.</div></dd>
</dl>
<div class="paramtext"><b>Note:</b> error exits with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq2"><m:mn mathcolor="#003399" mathvariant="bold">2</m:mn></m:maction></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq3"><m:mn mathcolor="#003399" mathvariant="bold">3</m:mn></m:maction></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq6"><m:mn mathcolor="#003399" mathvariant="bold">6</m:mn></m:maction></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq7"><m:mn mathcolor="#003399" mathvariant="bold">7</m:mn></m:maction></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq8"><m:mn mathcolor="#003399" mathvariant="bold">8</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq11"><m:mn mathcolor="#003399" mathvariant="bold">11</m:mn></m:maction></m:math>&#160;are caused by being unable to set up or solve the differential equation at some iteration and will be immediately preceded by a call of <a class="arg" href="#MONIT">MONIT</a> giving diagnostic information.  For other errors, diagnostic information is contained in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>, for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>m</m:mi></m:math>, where appropriate.</div><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">See the discussion in <a class="sec" href="#fcomments2">Section 8.2</a>.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2><h3 class="standard"><a class="sec" name="fcomments1" id="fcomments1"/>8.1&#160;&#160;Timing</h3>
<div class="paramtext">The time taken by D02KDF depends on the complexity of the coefficient functions, whether they or their derivatives are rapidly changing, the tolerance demanded, and how many iterations are needed to obtain convergence.  The amount of work per iteration is roughly doubled when <a class="arg" href="#TOL">TOL</a> is divided by <m:math><m:mn>16</m:mn></m:math>.  To make the most economical use of the routine, one should try to obtain good initial values for <a class="arg" href="#ELAM">ELAM</a> and <a class="arg" href="#DELAM">DELAM</a>, and, where appropriate, good asymptotic formulae.  Also the boundary matching points should not be set unnecessarily close to singular points.</div><h3 class="standard"><a class="sec" name="fcomments2" id="fcomments2"/>8.2&#160;&#160;General Description of the Algorithm</h3>
<div class="paramtext">A shooting method, for differential equation problems containing unknown parameters, relies on the construction of a &#8216;miss-distance function&#8217;,  which for given trial values of the parameters measures how far the conditions of the problem are from being met.  The problem is then reduced to one of finding the values of the parameters for which the miss-distance function is zero, that is to a root-finding process.  Shooting methods differ mainly in how the miss-distance is defined.</div><div class="paramtext">D02KDF defines a miss-distance <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;based on the rotation about the origin of the point <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#COEFFN_P"><m:mi mathcolor="#EE0000" mathvariant="bold">P</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>x</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:mfenced separators=""><m:mrow><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>y</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:mrow></m:mfenced></m:math>&#160;in the Phase Plane as the solution proceeds from <m:math><m:mi>a</m:mi></m:math>&#160;to <m:math><m:mi>b</m:mi></m:math>.  The <b>boundary conditions</b> define the ray (i.e., two-sided line through the origin) on which <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;should start, and the ray on which it should finish.  The <b>eigenvalue</b> <m:math><m:mi>k</m:mi></m:math>&#160;defines the total number of half-turns it should make.  Numerical solution is actually done by &#8216;shooting forward&#8217; from <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>a</m:mi></m:math>&#160;and &#8216;shooting backward&#8217; from <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>b</m:mi></m:math>&#160;to a matching point <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>c</m:mi></m:math>.  Then <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;is taken as the angle between the rays to the two resulting points <m:math><m:msub><m:mi>P</m:mi><m:mi>a</m:mi></m:msub><m:mfenced separators=""><m:mi>c</m:mi></m:mfenced></m:math>&#160;and <m:math><m:msub><m:mi>P</m:mi><m:mi>b</m:mi></m:msub><m:mfenced separators=""><m:mi>c</m:mi></m:mfenced></m:math>.  A relative scaling of the <m:math><m:mi>p</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>&#160;and <m:math><m:mi>y</m:mi></m:math>&#160;axes, based on the behaviour of the coefficient functions <m:math><m:mi>p</m:mi></m:math>&#160;and <m:math><m:mi>q</m:mi></m:math>, is used to improve the numerical behaviour.
<div class="figure"><a name="D02KDF1" id="D02KDF1"/><img src="../figures/D02KDF1fl17.png" style="height: 21em" alt="Figure 1"/></div><div class="figure"><b>Figure 1</b></div>
</div><div class="paramtext">The resulting function <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;is monotonic over <m:math><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mo>&lt;</m:mo><m:mi>&#955;</m:mi><m:mo>&lt;</m:mo><m:mi>&#8734;</m:mi></m:math>, increasing if <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>q</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>&#955;</m:mi></m:mrow>
 </m:mfrac><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>&#160;and decreasing if <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>q</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>&#955;</m:mi></m:mrow>
 </m:mfrac><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>, with a unique zero at the desired eigenvalue <m:math><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover></m:math>.  The routine measures <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;in units of a half-turn.  This means that as <m:math><m:mi>&#955;</m:mi></m:math>&#160;increases, <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;varies by about <m:math><m:mn>1</m:mn></m:math>&#160;as each eigenvalue is passed.  (This feature implies that the values of <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;at successive iterations &#8211; especially in the early stages of the iterative process &#8211; can be used with suitable extrapolation or interpolation to help the choice of initial estimates for eigenvalues near to the one currently being found.)</div><div class="paramtext">The routine actually computes a value for <m:math><m:mi>f</m:mi><m:mfenced separators=""><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;with errors, arising from the local errors of the differential equation code and from the asymptotic formulae provided by you if singular points are involved.  However, the error estimate output in <a class="arg" href="#DELAM">DELAM</a> is usually fairly realistic, in that the actual error <m:math><m:mfenced open="|" close="|" separators=""><m:mover><m:mi>&#955;</m:mi><m:mo>~</m:mo></m:mover><m:mo>-</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#ELAM"><m:mi mathcolor="#EE0000" mathvariant="bold">ELAM</m:mi></m:maction></m:mfenced></m:math>&#160;is within an order of magnitude of <a class="arg" href="#DELAM">DELAM</a>.</div><h3 class="standard"><a class="sec" name="fcomments3" id="fcomments3"/>8.3&#160;&#160;The Position of the Shooting Matching Point <m:math><m:mi>c</m:mi></m:math></h3>
<div class="paramtext">This point is always one of the values <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;in array <a class="arg" href="#XPOINT">XPOINT</a>.  It is chosen to be the value of that <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>,  <m:math><m:mn>2</m:mn><m:mo>&#8804;</m:mo><m:mi>i</m:mi><m:mo>&#8804;</m:mo><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:math>, that lies closest to the middle of the interval <m:math><m:mfenced separators="" open="[" close="]"><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:mfenced></m:math>.  If there is a tie, the rightmost candidate is chosen.  In particular if there are no break points, then <m:math><m:mi>c</m:mi><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:math>&#160;(<m:math><m:mtext/><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mn>3</m:mn></m:msub></m:math>); that is, the shooting is from left to right in this case.  A break point may be inserted purely to move <m:math><m:mi>c</m:mi></m:math>&#160;to an interior point of the interval, even though the form of the equations does not require it.  This often speeds up convergence especially with singular problems.</div><h3 class="standard"><a class="sec" name="fcomments4" id="fcomments4"/>8.4&#160;&#160;Examples of Coding the <a class="arg" href="#COEFFN">COEFFN</a></h3>
<div class="paramtext">Coding <a class="arg" href="#COEFFN">COEFFN</a> is straightforward except when break points are needed.  The examples below show:
<table class="standard-100"><tr>
<td style="width:2.1em;" valign="baseline">(a)</td>
<td valign="top">a simple case,</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(b)</td>
<td valign="top">a case in which discontinuities in the coefficient functions or their derivatives necessitate break points, and</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(c)</td>
<td valign="top">a case where break points together with the <a class="arg" href="#HMAX">HMAX</a> parameter are an efficient way to deal with a coefficient function that is well-behaved except over one short interval.</td>
</tr></table>
</div><div class="paramtext">(Some of these cases are among the examples in <a class="sec" href="#example">Section 9</a>.)</div><div class="paramtext"><b>Example A</b></div><div class="paramtext">The modified Bessel equation

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mi>x</m:mi>
 <m:msup>
  <m:mfenced separators=""><m:mi>x</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mfenced>
  <m:mo>&#8242;</m:mo>
 </m:msup>
 <m:mo>+</m:mo>
 <m:mfenced separators=""><m:mi>&#955;</m:mi><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup><m:mo>-</m:mo><m:msup><m:mi>&#957;</m:mi><m:mn>2</m:mn></m:msup></m:mfenced>
 <m:mi>y</m:mi><m:mo>=</m:mo><m:mn>0</m:mn>
 <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><div class="paramtext">Assuming the interval of solution does not contain the origin and dividing through by <m:math><m:mi>x</m:mi></m:math>, we have <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:mi>x</m:mi></m:math>&#160;and <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mi>x</m:mi><m:mo>-</m:mo><m:msup><m:mi>&#957;</m:mi><m:mn>2</m:mn></m:msup><m:mo>/</m:mo><m:mi>x</m:mi></m:math>.  The code could be
<pre class="verbatim">
SUBROUTINE COEFFN (P,Q,DQDL,X,ELAM,JINT)
...
P = X
Q = ELAM*X - NU*NU/X
DQDL = X
RETURN
END
</pre>

where

<span class="mono">NU</span> (standing for <m:math><m:mi>&#957;</m:mi></m:math>) is a <span class="bitalic">double precision</span> variable that might be defined in a DATA statement, or might be in user-declared COMMON so that its value could be set in the main program.


</div><div class="paramtext"><b>Example B</b></div><div class="paramtext">The Schroedinger equation

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mrow><m:mo>&#8242;</m:mo><m:mo>&#8242;</m:mo></m:mrow></m:msup><m:mo>+</m:mo><m:mfenced separators=""><m:mi>&#955;</m:mi><m:mo>+</m:mo><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:mfenced><m:mi>y</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced>
 <m:mo>=</m:mo>
 <m:mfenced open="{" close="" separators="">
  <m:mtable columnalign="left">
   <m:mtr>
    <m:mtd><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup><m:mo>-</m:mo> <m:mn>10</m:mn></m:mtd>
    <m:mtd><m:mfenced separators=""><m:mfenced open="|" close="|" separators=""><m:mi>x</m:mi></m:mfenced><m:mo>&#8804;</m:mo> <m:mn>4</m:mn></m:mfenced><m:mtext>,</m:mtext></m:mtd>
   </m:mtr><m:mtr>
    <m:mtd/>
    <m:mtd/>
   </m:mtr><m:mtr>
    <m:mtd><m:mfrac other="display">
     <m:mn>6</m:mn><m:mfenced open="|" close="|" separators=""><m:mi>x</m:mi></m:mfenced>
    </m:mfrac></m:mtd>
    <m:mtd><m:mfenced separators=""><m:mfenced open="|" close="|" separators=""><m:mi>x</m:mi></m:mfenced><m:mo>&gt;</m:mo> <m:mn>4</m:mn></m:mfenced><m:mtext>,</m:mtext></m:mtd>
   </m:mtr>
  </m:mtable>
 </m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

over some interval &#8216;approximating to <m:math><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mo>,</m:mo><m:mi>&#8734;</m:mi></m:mfenced></m:math>&#8217;, say <m:math><m:mfenced separators="" open="[" close="]"><m:mrow><m:mo>-</m:mo><m:mn>20</m:mn></m:mrow><m:mo>,</m:mo><m:mn>20</m:mn></m:mfenced></m:math>.  Here we need break points at <m:math><m:mrow><m:mo>&#177;</m:mo><m:mn>4</m:mn></m:mrow></m:math>,  forming three sub-intervals <m:math><m:msub><m:mi>i</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:mfenced separators="" open="[" close="]"><m:mrow><m:mo>-</m:mo><m:mn>20</m:mn></m:mrow><m:mo>,</m:mo><m:mrow><m:mo>-</m:mo><m:mn>4</m:mn></m:mrow></m:mfenced></m:math>,  <m:math><m:msub><m:mi>i</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mfenced separators="" open="[" close="]"><m:mrow><m:mo>-</m:mo><m:mn>4</m:mn></m:mrow><m:mo>,</m:mo><m:mn>4</m:mn></m:mfenced></m:math>, <m:math><m:msub><m:mi>i</m:mi><m:mn>3</m:mn></m:msub><m:mo>=</m:mo><m:mfenced separators="" open="[" close="]"><m:mn>4</m:mn><m:mo>,</m:mo><m:mn>20</m:mn></m:mfenced></m:math>.  The code could be
<pre class="verbatim">
SUBROUTINE COEFFN(P,Q,DQDL,X,ELAM,JINT)
...
IF (JINT.EQ.2) THEN
  Q = ELAM + X*X - 10.0D0
ELSE
  Q = ELAM + 6.0D0/ABS(X)
ENDIF
P = 1.0D0
DQDL = 1.0D0
RETURN
END
</pre>

The array <a class="arg" href="#XPOINT">XPOINT</a> would contain the values <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>,  <m:math><m:mrow><m:mo>-</m:mo><m:mn>20.0</m:mn></m:mrow></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>4.0</m:mn></m:mrow></m:math>, <m:math><m:mrow><m:mo>+</m:mo><m:mn>4.0</m:mn></m:mrow></m:math>,  <m:math><m:mrow><m:mo>+</m:mo><m:mn>20.0</m:mn></m:mrow></m:math>, <m:math><m:msub><m:mi>x</m:mi><m:mn>6</m:mn></m:msub></m:math>&#160;and <m:math><m:mi>m</m:mi></m:math>&#160;would be <m:math><m:mn>6</m:mn></m:math>.  The choice of appropriate values for <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>x</m:mi><m:mn>6</m:mn></m:msub></m:math>&#160;depends on the form of the asymptotic formula computed by <a class="arg" href="#BDYVAL">BDYVAL</a> and the technique is discussed in <a class="sec" href="#fcomments5">Section 8.5</a>.</div><div class="paramtext"><b>Example C</b></div><div class="paramtext"><div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mrow><m:mo>&#8242;</m:mo><m:mo>&#8242;</m:mo></m:mrow></m:msup><m:mo>+</m:mo><m:mi>&#955;</m:mi><m:mfenced separators=""><m:mn>1</m:mn><m:mo>-</m:mo><m:mn>2</m:mn><m:mo>&#8290;</m:mo><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mn>100</m:mn><m:mo>&#8290;</m:mo><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup></m:mrow></m:msup></m:mfenced><m:mi>y</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>, &#8195;</m:mtext><m:mo>-</m:mo><m:mn>10</m:mn><m:mo>&#8804;</m:mo><m:mi>x</m:mi><m:mo>&#8804;</m:mo><m:mn>10</m:mn><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

Here <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced></m:math>&#160;is nearly constant over the range except for a sharp inverted spike over approximately <m:math><m:mrow><m:mo>-</m:mo><m:mn>0.1</m:mn></m:mrow><m:mo>&#8804;</m:mo><m:mi>x</m:mi><m:mo>&#8804;</m:mo><m:mn>0.1</m:mn></m:math>.  There is a danger that the routine will build up to a large step size and &#8216;step over&#8217; the spike without noticing it.  By using break points  &#8211; say at <m:math><m:mrow><m:mo>&#177;</m:mo><m:mn>0.5</m:mn></m:mrow></m:math>&#160;&#8211; one can restrict the step size near the spike without impairing the efficiency elsewhere.</div><div class="paramtext">The code for <a class="arg" href="#COEFFN">COEFFN</a> could be
<pre class="verbatim">
SUBROUTINE COEFFN(P,Q,DQDL,X,ELAM,JINT)
...
P = 1.0D0
DQDL = 1.0D0 - 2.0D0*EXP(-100.0D0*X*X)
Q = ELAM*DQDL
RETURN
END
</pre><a class="arg" href="#XPOINT">XPOINT</a> might contain <m:math><m:mrow><m:mo>-</m:mo><m:mn>10.0</m:mn></m:mrow></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>10.0</m:mn></m:mrow></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>0.5</m:mn></m:mrow></m:math>, <m:math><m:mn>0.5</m:mn></m:math>, <m:math><m:mn>10.0</m:mn></m:math>, <m:math><m:mn>10.0</m:mn></m:math>&#160;(assuming <m:math><m:mrow><m:mo>&#177;</m:mo><m:mn>10</m:mn></m:mrow></m:math>&#160;are regular points) and <m:math><m:mi>m</m:mi></m:math>&#160;would be <m:math><m:mn>6</m:mn></m:math>.  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>, for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mn>3</m:mn></m:math>, might contain <m:math><m:mn>0.0</m:mn></m:math>, <m:math><m:mn>0.1</m:mn></m:math>&#160;and <m:math><m:mn>0.0</m:mn></m:math>.</div><h3 class="standard"><a class="sec" name="fcomments5" id="fcomments5"/>8.5&#160;&#160;Examples of Boundary Conditions at Singular Points</h3>
<div class="paramtext">Quoting from page 243 of <a class="ref" href="#ref027">Bailey (1966)</a>: &#8216;Usually ...  the differential equation has two essentially different types of solution near a singular point, and the boundary condition there merely serves to distinguish one kind from the other.  This is the case in all the standard examples of mathematical physics.&#8217;</div><div class="paramtext">In most cases the behaviour of the ratio <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>/</m:mo><m:mi>y</m:mi></m:math>&#160;near the point is quite different for the two types of solution.  Essentially what you provide through the <a class="arg" href="#BDYVAL">BDYVAL</a> is an approximation to this ratio, valid as <m:math><m:mi>x</m:mi></m:math>&#160;tends to the singular point (SP).</div><div class="paramtext">You must decide (a) how accurate to make this approximation or asymptotic formula, for example how many terms of a series to use, and (b) where to place the boundary matching point (BMP) at which the numerical solution of the differential equation takes over from the asymptotic formula.  Taking the BMP closer to the SP will generally improve the accuracy of the asymptotic formula, but will make the computation more expensive as the Pruefer differential equations generally become progressively more ill-behaved as the SP is approached.  You are strongly recommended to experiment with placing the BMPs.  In many singular problems quite crude asymptotic formulae will do.  To help you avoid needlessly accurate formulae, D02KDF outputs two &#8216;sensitivity coefficients&#8217;
<m:math><m:msub><m:mi>&#963;</m:mi><m:mi>l</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>&#963;</m:mi><m:mi>r</m:mi></m:msub></m:math>&#160;which estimate how much the errors at the BMPs affect the computed eigenvalue.  They are described in detail in <a class="sec" href="#fcomments6">Section 8.6</a>.</div><div class="paramtext"><b>Example of coding <a class="arg" href="#BDYVAL">BDYVAL</a>:</b></div><div class="paramtext">The example below illustrates typical situations:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mrow><m:mo>&#8242;</m:mo><m:mo>&#8242;</m:mo></m:mrow></m:msup><m:mo>+</m:mo><m:mfenced separators=""><m:mi>&#955;</m:mi><m:mo>-</m:mo><m:mi>x</m:mi><m:mo>-</m:mo><m:mfrac><m:mn>2</m:mn><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup></m:mfrac></m:mfenced>
<m:mi>y</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>, &#8195;</m:mtext><m:mn>0</m:mn><m:mo>&lt;</m:mo><m:mi>x</m:mi><m:mo>&lt;</m:mo><m:mi>&#8734;</m:mi>
</m:math></td><td class="formula2"/></tr></table></div>

the boundary conditions being that <m:math><m:mi>y</m:mi></m:math>&#160;should remain bounded as <m:math><m:mi>x</m:mi></m:math>&#160;tends to <m:math><m:mn>0</m:mn></m:math>&#160;and <m:math><m:mi>x</m:mi></m:math>&#160;tends to <m:math><m:mi>&#8734;</m:mi></m:math>.</div><div class="paramtext">At the end <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;there is one solution that behaves like <m:math><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup></m:math>&#160;and another that behaves like <m:math><m:msup><m:mi>x</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup></m:math>.  For the first of these solutions <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>/</m:mo><m:mi>y</m:mi></m:math>&#160;is asymptotically <m:math><m:mn>2</m:mn><m:mo>/</m:mo><m:mi>x</m:mi></m:math>&#160;while for the second it is asymptotically <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mo>/</m:mo><m:mi>x</m:mi></m:math>.  Thus the desired ratio is specified by setting

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mi>x</m:mi><m:mtext>&#8195; and &#8195;</m:mtext><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YL"><m:mi mathcolor="#EE0000" mathvariant="bold">YL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>2.0</m:mn><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><div class="paramtext">At the end <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#8734;</m:mi></m:math>&#160;the equation behaves like Airy's equation shifted through <m:math><m:mi>&#955;</m:mi></m:math>, i.e., like <m:math><m:msup><m:mi>y</m:mi><m:mrow><m:mo>&#8242;</m:mo><m:mo>&#8242;</m:mo></m:mrow></m:msup><m:mo>-</m:mo><m:mi>t</m:mi><m:mi>y</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;where <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>&#955;</m:mi></m:math>, so again there are two types of solution.  The solution we require behaves as

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mo>-</m:mo><m:mfrac><m:mn>2</m:mn><m:mn>3</m:mn></m:mfrac><m:msup><m:mi>t</m:mi><m:mfrac><m:mn>3</m:mn><m:mn>2</m:mn></m:mfrac></m:msup></m:mfenced></m:mrow><m:mo>/</m:mo><m:mroot><m:mi>t</m:mi><m:mn>4</m:mn></m:mroot>
</m:math></td><td class="formula2"/></tr></table></div>

and the other as

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mo>+</m:mo><m:mfrac><m:mn>2</m:mn><m:mn>3</m:mn></m:mfrac><m:msup><m:mi>t</m:mi><m:mfrac><m:mn>3</m:mn><m:mn>2</m:mn></m:mfrac></m:msup></m:mfenced></m:mrow><m:mo>/</m:mo><m:mroot><m:mi>t</m:mi><m:mn>4</m:mn></m:mroot><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

Hence, the desired solution has <m:math><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>/</m:mo><m:mi>y</m:mi><m:mo>&#8764;</m:mo><m:mo>-</m:mo><m:msqrt><m:mi>t</m:mi></m:msqrt></m:math>&#160;so that we could set <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>1.0</m:mn></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#BDYVAL_YR"><m:mi mathcolor="#EE0000" mathvariant="bold">YR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mo>-</m:mo><m:msqrt><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>&#955;</m:mi></m:msqrt></m:math>.  The complete subroutine might thus be
<pre class="verbatim">
SUBROUTINE BDYVAL (XL,XR,ELAM,YL,YR)
<span class="bitalic">double precision</span> XL, XR, ELAM, YL(3), YR(3)
YL(1) = XL
YL(2) = 2.0D0
YR(1) = 1.0D0
YR(2) = -SQRT(XR-ELAM)
RETURN
END
</pre>

Clearly for this problem it is essential that any value given by D02KDF to <a class="arg" href="../D02/d02kdf.xml#BDYVAL_XR">XR</a> is well to the right of the value of <a class="arg" href="#ELAM">ELAM</a>, so that you must vary the right-hand BMP with the eigenvalue index <m:math><m:mi>k</m:mi></m:math>.  One would expect <m:math><m:msub><m:mi>&#955;</m:mi><m:mi>k</m:mi></m:msub></m:math>&#160;to be near the <m:math><m:mi>k</m:mi></m:math>th zero of the Airy function <m:math><m:mrow><m:mi>Ai</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>, so there is no problem estimating <a class="arg" href="#ELAM">ELAM</a>.</div><div class="paramtext">More accurate asymptotic formulae are easily found: near <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;by the standard Frobenius method, and near <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#8734;</m:mi></m:math>&#160;by using standard asymptotics for <m:math><m:mrow><m:mi>Ai</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>, <m:math><m:mrow><m:msup><m:mi mathvariant="normal">Ai</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>, (see page 448 of <a class="ref" href="#ref126">Abramowitz and Stegun (1972)</a>).</div><div class="paramtext">For example, by the Frobenius method the solution near <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;has the expansion

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>y</m:mi><m:mo>=</m:mo><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup><m:mfenced separators=""><m:msub><m:mi>c</m:mi><m:mn>0</m:mn></m:msub><m:mo>+</m:mo><m:msub><m:mi>c</m:mi><m:mn>1</m:mn></m:msub><m:mi>x</m:mi><m:mo>+</m:mo><m:msub><m:mi>c</m:mi><m:mn>2</m:mn></m:msub><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mo>&#8943;</m:mo></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

with

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>c</m:mi><m:mn>0</m:mn></m:msub><m:mo>=</m:mo> <m:mn>1</m:mn><m:mo>,</m:mo><m:msub><m:mi>c</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo> <m:mn>0</m:mn><m:mo>,</m:mo> <m:msub><m:mi>c</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mfrac><m:mrow><m:mo>-</m:mo><m:mi>&#955;</m:mi></m:mrow><m:mn>10</m:mn></m:mfrac><m:mo>,</m:mo> <m:msub><m:mi>c</m:mi><m:mn>3</m:mn></m:msub><m:mo>=</m:mo><m:mfrac other="small"><m:mn>1</m:mn><m:mn>18</m:mn></m:mfrac><m:mo>,</m:mo><m:mo>&#8943;</m:mo><m:mo>,</m:mo> <m:msub><m:mi>c</m:mi><m:mi>n</m:mi></m:msub><m:mo>=</m:mo><m:mfrac><m:mrow><m:msub><m:mi>c</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo> <m:mn>3</m:mn></m:mrow></m:msub><m:mo>-</m:mo><m:mi>&#955;</m:mi> <m:msub><m:mi>c</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo> <m:mn>2</m:mn></m:mrow></m:msub></m:mrow>
  <m:mrow><m:mi>n</m:mi><m:mfenced separators=""><m:mi>n</m:mi><m:mo>+</m:mo> <m:mn>3</m:mn></m:mfenced></m:mrow>
 </m:mfrac><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

This yields

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mfrac><m:mrow><m:mi>p</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mrow><m:mi>y</m:mi></m:mfrac><m:mo>=</m:mo><m:mfrac><m:mrow><m:mn>2</m:mn><m:mo>-</m:mo><m:mfrac><m:mn>2</m:mn><m:mn>5</m:mn></m:mfrac><m:mi>&#955;</m:mi><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mo>&#8943;</m:mo></m:mrow>
  <m:mrow><m:mi>x</m:mi>
<m:mfenced separators=""><m:mn>1</m:mn><m:mo>-</m:mo><m:mfrac><m:mi>&#955;</m:mi><m:mn>10</m:mn></m:mfrac><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mo>&#8943;</m:mo></m:mfenced>
</m:mrow>
 </m:mfrac><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><h3 class="standard"><a class="sec" name="fcomments6" id="fcomments6"/>8.6&#160;&#160;The Sensitivity Parameters <m:math><m:msub><m:mi>&#963;</m:mi><m:mi>l</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>&#963;</m:mi><m:mi>r</m:mi></m:msub></m:math></h3>
<div class="paramtext">The sensitivity parameters <m:math><m:msub><m:mi>&#963;</m:mi><m:mi>l</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>&#963;</m:mi><m:mi>r</m:mi></m:msub></m:math>&#160;(held in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mrow><m:mi>m</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#HMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">HMAX</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn><m:mi>m</m:mi></m:mfenced></m:mrow></m:math>&#160;on output) estimate the effect of errors in the boundary conditions.  For sufficiently small errors <m:math><m:mi>&#916;</m:mi><m:mi>y</m:mi></m:math>, <m:math><m:mi>&#916;</m:mi><m:mi>p</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>&#160;in <m:math><m:mi>y</m:mi></m:math>&#160;and <m:math><m:mi>p</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>&#160;respectively, the relations

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable columnalign="left">
 <m:mtr>
  <m:mtd><m:mi>&#916;</m:mi><m:mi>&#955;</m:mi><m:mo>&#8771;</m:mo><m:msub><m:mfenced separators=""><m:mi>y</m:mi><m:mo>.</m:mo><m:mi>&#916;</m:mi><m:mi>p</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>-</m:mo><m:mi>p</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>.</m:mo><m:mi>&#916;</m:mi><m:mi>y</m:mi></m:mfenced><m:mi>l</m:mi></m:msub><m:msub><m:mi>&#963;</m:mi><m:mi>l</m:mi></m:msub></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:mi>&#916;</m:mi><m:mi>&#955;</m:mi><m:mo>&#8771;</m:mo><m:msub><m:mfenced separators=""><m:mi>y</m:mi><m:mo>.</m:mo><m:mi>&#916;</m:mi><m:mi>p</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>-</m:mo><m:mi>p</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>.</m:mo><m:mi>&#916;</m:mi><m:mi>y</m:mi></m:mfenced><m:mi>r</m:mi></m:msub><m:msub><m:mi>&#963;</m:mi><m:mi>r</m:mi></m:msub></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

are satisfied, where the subscripts <m:math><m:mi>l</m:mi></m:math>, <m:math><m:mi>r</m:mi></m:math>&#160;denote errors committed at the left- and right-hand BMPs respectively, and <m:math><m:mi>&#916;</m:mi><m:mi>&#955;</m:mi></m:math>&#160;denotes the consequent error in the computed eigenvalue.</div><h3 class="standard"><a class="sec" name="fcomments7" id="fcomments7"/>8.7&#160;&#160;&#8216;Missed Zeros&#8217;</h3>
<div class="paramtext">This is a pitfall to beware of at a singular point.  If the BMP is chosen so far from the SP that a zero of the desired eigenfunction lies in between them, then the routine will fail to &#8216;notice&#8217; this zero.  Since the index of <m:math><m:mi>k</m:mi></m:math>&#160;of an eigenvalue is the number of zeros of its eigenfunction, the result will be that
<table class="standard-100"><tr>
<td style="width:2.1em;" valign="baseline">(a)</td>
<td valign="top">the wrong eigenvalue will be computed for the given index <m:math><m:mi>k</m:mi></m:math>&#160;&#8211; in fact some <m:math><m:msub><m:mi>&#955;</m:mi><m:mrow><m:mi>k</m:mi><m:mo>+</m:mo><m:msup><m:mi>k</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mrow></m:msub></m:math>&#160;will be found where <m:math><m:msup><m:mi>k</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>;</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(b)</td>
<td valign="top">the same index <m:math><m:mi>k</m:mi></m:math>&#160;can cause convergence to any of several eigenvalues depending on the initial values of <a class="arg" href="#ELAM">ELAM</a> and <a class="arg" href="#DELAM">DELAM</a>.</td>
</tr></table>
</div><div class="paramtext">It is up to you to take suitable precautions &#8211; for instance by varying the position of the BMPs in the light of knowledge of the asymptotic behaviour of the eigenfunction at different eigenvalues.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example finds the 11th eigenvalue of the example of <a class="sec" href="#fcomments5">Section 8.5</a>, using the simple asymptotic formulae for the boundary conditions.  The results exhibit slow convergence, mainly because <a class="arg" href="#XPOINT">XPOINT</a> is set so that the shooting matching point <m:math><m:mi>c</m:mi></m:math>&#160;is at the right-hand end <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mn>30.0</m:mn></m:math>.  The example results for <a class="rout" href="../D02/d02kef.xml">D02KEF</a> show that much faster convergence is obtained if <a class="arg" href="#XPOINT">XPOINT</a> is set to contain an additional break point at or near the maximum of the coefficient function <m:math><m:mi>q</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>;</m:mo><m:mi>&#955;</m:mi></m:mfenced></m:math>,  which in this case is at <m:math><m:mi>x</m:mi><m:mo>=</m:mo><m:mroot><m:mn>4</m:mn><m:mn>3</m:mn></m:mroot></m:math>.</div><h3 class="standard"><a class="sec" name="examtext" id="examtext"/>9.1&#160;&#160;Program Text</h3>
<p><a class="verbatimref" href="../../examples/source/d02kdfe.f">Program Text (d02kdfe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<div class="paramtext">None.</div><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/d02kdfe.r">Program Results (d02kdfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/D02/d02kdf.pdf">D02KDF (PDF version)</a></div><div><a class="chap" href="d02conts.xml">D02 Chapter Contents</a></div><div><a class="chapint" href="d02intro.xml">D02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
