<?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>D02GBF : 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/d02gbf.pdf">D02GBF (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/>D02GBF</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="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
</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">D02GBF solves a general linear two-point boundary value problem for a system of ordinary differential equations, using a deferred correction technique.</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;D02GBF&#160;(</td><td class="tdfspec2"><a class="arg" href="#A">A</a>, <a class="arg" href="#B">B</a>, <a class="arg" href="#N">N</a>, <a class="arg" href="#TOL">TOL</a>, <a class="arg" href="#FCNF">FCNF</a>, <a class="arg" href="#FCNG">FCNG</a>, <a class="arg" href="#C">C</a>, <a class="arg" href="#D">D</a>, <a class="arg" href="#GAM">GAM</a>, <a class="arg" href="#MNP">MNP</a>, <a class="arg" href="#X">X</a>, <a class="arg" href="#Y">Y</a>, <a class="arg" href="#NP">NP</a>, <a class="arg" href="#W">W</a>, <a class="arg" href="#LW">LW</a>, <a class="arg" href="#IW">IW</a>, <a class="arg" href="#LIW">LIW</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, MNP, NP, LW, IW(LIW), LIW, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">A, B, TOL, C(N,N), D(N,N), GAM(N), X(MNP), Y(N,MNP), W(LW)</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">FCNF, FCNG</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D02GBF solves a linear two-point boundary value problem for a system of <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;ordinary differential equations in the interval [<m:math><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:math>].  The system is written in the form

<div class="formula-eqn"><a name="eqn1" id="eqn1"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mi>y</m:mi><m:mo>+</m:mo><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced>
</m:math></td><td class="formula-eqn2">
      (1)
     </td></tr></table></div>

and the boundary conditions are written in the form

<div class="formula-eqn"><a name="eqn2" id="eqn2"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
<m:mi>C</m:mi><m:mi>y</m:mi><m:mfenced separators=""><m:mi>a</m:mi></m:mfenced><m:mo>+</m:mo><m:mi>D</m:mi><m:mi>y</m:mi><m:mfenced separators=""><m:mi>b</m:mi></m:mfenced><m:mo>=</m:mo><m:mi>&#947;</m:mi>
<m:mtext>.</m:mtext>
</m:math></td><td class="formula-eqn2">
      (2)
     </td></tr></table></div>

Here <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, <m:math><m:mi>C</m:mi></m:math>&#160;and <m:math><m:mi>D</m:mi></m:math>&#160;are <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;by <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;matrices, and <m:math><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mi>&#947;</m:mi></m:math>&#160;are <m:math><m:mi mathvariant="italic">n</m:mi></m:math>-component vectors.  The approximate solution to <a class="eqn" href="#eqn1">(1)</a> and <a class="eqn" href="#eqn2">(2)</a> is found using a finite-difference method with deferred correction.  The algorithm is a specialisation of that used in subroutine <a class="rout" href="../D02/d02raf.xml">D02RAF</a> which solves a nonlinear version of <a class="eqn" href="#eqn1">(1)</a> and <a class="eqn" href="#eqn2">(2)</a>.  The nonlinear version of the algorithm is described fully in <a class="ref" href="#ref189">Pereyra (1979)</a>.</div><div class="paramtext">You supply an absolute error tolerance and may also supply an initial mesh for the construction of the finite-difference equations (alternatively a default mesh is used).  The algorithm constructs a solution on a mesh defined by adding points to the initial mesh.  This solution is chosen so that the error is everywhere less than your tolerance and so that the error is approximately equidistributed on the final mesh.  The solution is returned on this final mesh.</div><div class="paramtext">If the solution is required at a few specific points then these should be included in the initial mesh.  If, on the other hand, the solution is required at several specific points, then you should use the interpolation routines provided in <a class="chap" href="../E01/e01conts.xml">Chapter E01</a> if these points do not themselves form a convenient mesh.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref189" id="ref189"/>Pereyra V (1979)  PASVA3: An adaptive finite-difference Fortran program for first order nonlinear, ordinary boundary problems <i>Codes for Boundary Value Problems in Ordinary Differential Equations. Lecture Notes in Computer Science</i> (eds B Childs, M Scott, J W Daniel, E Denman and P Nelson) <b>76</b> Springer&#8211;Verlag </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="A" id="A"/>1: &#160;&#160;&#8194; A &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:mi>a</m:mi></m:math>, the left-hand boundary point.</div></dd><dt class="paramhead"><a name="B" id="B"/>2: &#160;&#160;&#8194; B &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:mi>b</m:mi></m:math>, the right-hand boundary point.</div>
<div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#B"><m:mi mathcolor="#EE0000" mathvariant="bold">B</m:mi></m:maction><m:mo>&gt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#A"><m:mi mathcolor="#EE0000" mathvariant="bold">A</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="N" id="N"/>3: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: 



the number of equations; that is <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;is the order of system <a class="eqn" href="#eqn1">(1)</a>.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>2</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="TOL" id="TOL"/>4: &#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>: a positive absolute error tolerance. If 

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> <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>&lt;</m:mo><m:msub><m:mi>x</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>x</m:mi><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction></m:msub><m:mo>=</m:mo><m:mi>b</m:mi> </m:math></td><td class="formula2"/></tr></table></div>
 
is the final mesh, <m:math><m:mi>z</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is the approximate solution from D02GBF and <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is the true solution of equations <a class="eqn" href="#eqn1">(1)</a> and <a class="eqn" href="#eqn2">(2)</a> then, except in extreme cases, it is expected that 

<div class="formula-eqn"><a name="eqnd02TOL-g" id="eqnd02TOL-g"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block"> <m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>z</m:mi><m:mo>-</m:mo><m:mi>y</m:mi></m:mfenced><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:math></td><td class="formula-eqn2">
      (3)
     </td></tr></table></div>
 
where 

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> 
<m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>u</m:mi></m:mfenced>
<m:mo>=</m:mo>
<m:munder>
<m:mi mathvariant="normal">max</m:mi>
<m:mrow><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:mi>i</m:mi><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:mrow>
</m:munder><m:mspace width="0.25em"/>
<m:munder>
<m:mi mathvariant="normal">max</m:mi>
<m:mrow><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:mi>j</m:mi><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction></m:mrow>
</m:munder><m:mspace width="0.25em"/>
<m:mfenced open="|" close="|" separators=""><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:mfenced></m:mfenced>
<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="#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="FCNF" id="FCNF"/>5: &#160;&#160;&#8194; FCNF &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#FCNF">FCNF</a> must evaluate the matrix <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;in <a class="eqn" href="#eqn1">(1)</a> at a general point <m:math><m:mi>x</m:mi></m:math>.</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#FCNF">FCNF</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;FCNF&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02gbf.xml#FCNF_X">X</a>, <a class="arg" href="../D02/d02gbf.xml#FCNF_F">F</a>)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X, F(<m:math><m:mi mathvariant="italic">n</m:mi></m:math>,<m:math><m:mi mathvariant="italic">n</m:mi></m:math>)</td></tr></table>
<div class="paramtext">where <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;is the actual value of <a class="arg" href="#N">N</a> in the call of D02GBF.</div>
<dl><dt class="paramhead"><a name="FCNF_X" id="FCNF_X"/>1: &#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>: <m:math><m:mi>x</m:mi></m:math>, the value of the independent variable.</div></dd><dt class="paramhead"><a name="FCNF_F" id="FCNF_F"/>2: &#160;&#160;&#8194; F(<m:math><m:mi mathvariant="italic">n</m:mi></m:math>,<m:math><m:mi mathvariant="italic">n</m:mi></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the <m:math><m:mfenced separators=""><m:mi>i</m:mi><m:mo>,</m:mo><m:mi>j</m:mi></m:mfenced></m:math>th element of the matrix <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, for <m:math><m:mi>i</m:mi><m:mo>,</m:mo><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 mathvariant="italic">n</m:mi></m:math>. (See <a class="sec" href="#example">Section 9</a> for an example.)</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#FCNF">FCNF</a> must be declared as EXTERNAL in the (sub)program from which D02GBF 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="FCNG" id="FCNG"/>6: &#160;&#160;&#8194; FCNG &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#FCNG">FCNG</a> must evaluate the vector <m:math><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;in <a class="eqn" href="#eqn1">(1)</a> at a general point <m:math><m:mi>x</m:mi></m:math>.</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#FCNG">FCNG</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;FCNG&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02gbf.xml#FCNG_X">X</a>, <a class="arg" href="../D02/d02gbf.xml#FCNG_G">G</a>)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X, G(<m:math><m:mi mathvariant="italic">n</m:mi></m:math>)</td></tr></table>
<div class="paramtext">where <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;is the actual value of <a class="arg" href="#N">N</a> in the call of D02GBF.</div>
<dl><dt class="paramhead"><a name="FCNG_X" id="FCNG_X"/>1: &#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>: <m:math><m:mi>x</m:mi></m:math>, the value of the independent variable.</div></dd><dt class="paramhead"><a name="FCNG_G" id="FCNG_G"/>2: &#160;&#160;&#8194; G(<m:math><m:mi mathvariant="italic">n</m:mi></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the <m:math><m:mi>i</m:mi></m:math>th element of the vector <m:math><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, for <m:math><m:mi>i</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 mathvariant="italic">n</m:mi></m:math>. (See <a class="sec" href="#example">Section 9</a> for an example.)</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#FCNG">FCNG</a> must be declared as EXTERNAL in the (sub)program from which D02GBF 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="C" id="C"/>7: &#160;&#160;&#8194; C(<a class="arg" href="#N">N</a>,<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dt class="multi-paramhead"><a name="D" id="D"/>8: &#160;&#160;&#8194; D(<a class="arg" href="#N">N</a>,<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dt class="multi-paramhead"><a name="GAM" id="GAM"/>9: &#160;&#160;&#8194; GAM(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the arrays <a class="arg" href="#C">C</a> and <a class="arg" href="#D">D</a> must be set to the matrices <m:math><m:mi>C</m:mi></m:math>&#160;and <m:math><m:mi>D</m:mi></m:math>&#160;in <a class="eqn" href="#eqn2">(2)</a>). <a class="arg" href="#GAM">GAM</a> must be set to the vector <m:math><m:mi>&#947;</m:mi></m:math>&#160;in <a class="eqn" href="#eqn2">(2)</a>.</div>
<div class="paramtext"><i>On exit</i>: the rows of <a class="arg" href="#C">C</a> and <a class="arg" href="#D">D</a> and the components of <a class="arg" href="#GAM">GAM</a> are reordered so that the boundary conditions are in the order: <table class="standard-90"><tr>
<td style="width:2.1em;" valign="baseline">(i)</td>
<td valign="top">conditions on <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>a</m:mi></m:mfenced></m:math>&#160;only;</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(ii)</td>
<td valign="top">condition involving <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>a</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>b</m:mi></m:mfenced></m:math>; and</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(iii)</td>
<td valign="top">conditions on <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>b</m:mi></m:mfenced></m:math>&#160;only.</td>
</tr></table> 
<div class="paramtext">The routine will be slightly more efficient if the arrays <a class="arg" href="#C">C</a>, <a class="arg" href="#D">D</a> and <a class="arg" href="#GAM">GAM</a> are ordered in this way before entry, and in this event they will be unchanged on exit.</div>
<div class="paramtext">Note that the problems <a class="eqn" href="#eqn1">(1)</a> and <a class="eqn" href="#eqn2">(2)</a> must be of boundary value type, that is neither <m:math><m:mi>C</m:mi></m:math>&#160;nor <m:math><m:mi>D</m:mi></m:math>&#160;may be identically zero. Note also that the rank of the matrix <m:math><m:mfenced separators="" open="[" close="]"><m:mi>C</m:mi><m:mo>,</m:mo><m:mi>D</m:mi></m:mfenced></m:math>&#160;must be <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;for the problem to be properly posed. Any violation of these conditions will lead to an error exit.</div>
</div></dd><dt class="paramhead"><a name="MNP" id="MNP"/>10: &#8194; MNP &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: 

the maximum permitted number of mesh points.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MNP"><m:mi mathcolor="#EE0000" mathvariant="bold">MNP</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>32</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="X" id="X"/>11: &#8194; X(<a class="arg" href="#MNP">MNP</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>4</m:mn></m:math>&#160;(see <a class="arg" href="#NP">NP</a>), the first <a class="arg" href="#NP">NP</a> elements must define an initial mesh. Otherwise the elements of <m:math><m:mi>x</m:mi></m:math>&#160;need not be set.</div><div class="paramtext"><i>Constraint</i>:
  
<div class="formula-eqn"><a name="eqnd02X-n" id="eqnd02X-n"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block"> 
<m:maction actiontype="link" dsi:type="simple" dsi:href="#A"><m:mi mathcolor="#EE0000" mathvariant="bold">A</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</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="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction></m:mfenced></m:mrow><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#B"><m:mi mathcolor="#EE0000" mathvariant="bold">B</m:mi></m:maction><m:mtext>, &#8195;</m:mtext> <m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>4</m:mn>
<m:mtext>.</m:mtext>
</m:math></td><td class="formula-eqn2">
      (4)
     </td></tr></table></div>
</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</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="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction></m:mfenced></m:mrow></m:math>&#160;define the final mesh (with the returned value of <a class="arg" href="#NP">NP</a>) satisfying the relation <a class="eqn" href="#eqnd02X-n">(4)</a>.</div></dd><dt class="paramhead"><a name="Y" id="Y"/>12: &#8194; Y(<a class="arg" href="#N">N</a>,<a class="arg" href="#MNP">MNP</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the approximate solution <m:math><m:mi>z</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;satisfying <a class="eqn" href="#eqnd02TOL-g">(3)</a>, on the final mesh, that is 
<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="#Y"><m:mi mathcolor="#EE0000" mathvariant="bold">Y</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:msub><m:mi>z</m:mi><m:mi>j</m:mi></m:msub><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mtext>, &#8195;</m:mtext><m:mi>i</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:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction><m:mtext>&#8203; and &#8203;</m:mtext><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 mathvariant="italic">n</m:mi> </m:math></td><td class="formula2"/></tr></table></div>
 where <a class="arg" href="#NP">NP</a> is the number of points in the final mesh.
<div class="paramtext">The remaining columns of <a class="arg" href="#Y">Y</a> are not used.</div>
</div></dd><dt class="paramhead"><a name="NP" id="NP"/>13: &#8194; NP &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: determines whether a default mesh or user-supplied mesh is used. 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>A default value of <m:math><m:mn>4</m:mn></m:math>&#160;for <a class="arg" href="#NP">NP</a> and a corresponding equispaced mesh <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</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="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction></m:mfenced></m:mrow></m:math>&#160;are used.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>4</m:mn></m:math></dt>
<dd>You must define an initial mesh <a class="arg" href="#X">X</a> as in <a class="eqn" href="#eqnd02X-n">(4)</a>.</dd></dl>
</div>
<div class="paramtext"><i>On exit</i>: the number of points in the final (returned) mesh.</div></dd><dt class="paramhead"><a name="W" id="W"/>14: &#8194; W(<a class="arg" href="#LW">LW</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Workspace</span></dt><dt class="multi-paramhead"><a name="LW" id="LW"/>15: &#8194; LW &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the dimension of the array <a class="arg" href="#W">W</a> as declared in the (sub)program from which D02GBF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LW"><m:mi mathcolor="#EE0000" mathvariant="bold">LW</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MNP"><m:mi mathcolor="#EE0000" mathvariant="bold">MNP</m:mi></m:maction><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mn>3</m:mn><m:mo>&#8290;</m:mo><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mn>5</m:mn><m:mo>&#8290;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>2</m:mn></m:mfenced><m:mo>+</m:mo><m:mn>3</m:mn><m:mo>&#8290;</m:mo><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:mn>5</m:mn><m:mo>&#8290;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="IW" id="IW"/>16: &#8194; IW(<a class="arg" href="#LIW">LIW</a>) &#8211; INTEGER array<span class="pclass">Workspace</span></dt><dt class="multi-paramhead"><a name="LIW" id="LIW"/>17: &#8194; LIW &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the dimension of the array <a class="arg" href="#IW">IW</a> as declared in the (sub)program from which D02GBF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LIW"><m:mi mathcolor="#EE0000" mathvariant="bold">LIW</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MNP"><m:mi mathcolor="#EE0000" mathvariant="bold">MNP</m:mi></m:maction><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mn>2</m:mn><m:mo>&#8290;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>18: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext">For this routine, the normal use of <a class="arg" href="#IFAIL">IFAIL</a> is extended to control the printing of error and warning messages as well as specifying hard or soft failure (see <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction).</div>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to a value with the decimal expansion <m:math><m:mi mathvariant="italic">cba</m:mi></m:math>, where each of the decimal digits <m:math><m:mi>c</m:mi></m:math>, <m:math><m:mi>b</m:mi></m:math>&#160;and <m:math><m:mi>a</m:mi></m:math>&#160;must have a value of <m:math><m:mn>0</m:mn></m:math>&#160;or <m:math><m:mn>1</m:mn></m:math>.
<table class="standard-90"><tr>
<td style="width:3.0em;" valign="baseline"><m:math><m:mi>a</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math></td>
<td valign="top">specifies hard failure, otherwise soft failure;</td>
</tr><tr>
<td style="width:3.0em;" valign="baseline"><m:math><m:mi>b</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math></td>
<td valign="top">suppresses error messages, otherwise error messages will be printed (see <a class="sec" href="#errors">Section 6</a>);</td>
</tr><tr>
<td style="width:3.0em;" valign="baseline"><m:math><m:mi>c</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math></td>
<td valign="top">suppresses warning messages, otherwise warning messages will be printed (see <a class="sec" href="#errors">Section 6</a>).</td>
</tr></table>
<div class="paramtext">The recommended value for inexperienced users is <m:math><m:mn>110</m:mn></m:math>&#160;(i.e., hard failure with all messages printed).</div>
</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></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">One or more of the parameters <a class="arg" href="#N">N</a>, <a class="arg" href="#TOL">TOL</a>, <a class="arg" href="#NP">NP</a>, <a class="arg" href="#MNP">MNP</a>, <a class="arg" href="#LW">LW</a> or <a class="arg" href="#LIW">LIW</a> is incorrectly set, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#B"><m:mi mathcolor="#EE0000" mathvariant="bold">B</m:mi></m:maction><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#A"><m:mi mathcolor="#EE0000" mathvariant="bold">A</m:mi></m:maction></m:math>&#160;or the condition <a class="eqn" href="#eqnd02X-n">(4)</a> on <a class="arg" href="#X">X</a> is not satisfied.</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">There are three possible reasons for this error exit to be taken:
<table class="standard-90"><tr>
<td style="width:2.1em;" valign="baseline">(i)</td>
<td valign="top">one of the matrices <m:math><m:mi>C</m:mi></m:math>&#160;or <m:math><m:mi>D</m:mi></m:math>&#160;is identically zero (that is, the problem is of initial value and not boundary value type).  In this case, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;on exit;</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(ii)</td>
<td valign="top">a row of <m:math><m:mi>C</m:mi></m:math>&#160;and the corresponding row of <m:math><m:mi>D</m:mi></m:math>&#160;are identically zero (that is, the boundary conditions are rank deficient).  In this case, on exit <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;contains the index of the first such row encountered; and</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(iii)</td>
<td valign="top">more than <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;of the columns of the <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;by <m:math><m:mn>2</m:mn><m:mi mathvariant="italic">n</m:mi></m:math>&#160;matrix <m:math><m:mfenced separators="" open="[" close="]"><m:mi>C</m:mi><m:mo>,</m:mo><m:mi>D</m:mi></m:mfenced></m:math>&#160;are identically zero (that is, the boundary conditions are rank deficient).  In this case, on exit <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;contains minus the number of non-identically zero columns.</td>
</tr></table>
</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">The routine has failed to find a solution to the specified accuracy.  There are a variety of possible reasons including:
<table class="standard-90"><tr>
<td style="width:2.1em;" valign="baseline"><a name="IFeq3i" id="IFeq3i"/>(i)</td>
<td valign="top">the boundary conditions are rank deficient, which may be indicated by the message that the Jacobian is singular.  However this is an unlikely explanation for the error exit as all rank deficient boundary conditions should lead instead to error exits with either <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>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq5"><m:mn mathcolor="#003399" mathvariant="bold">5</m:mn></m:maction></m:math>; see also <a class="item" href="#IFeq3iv">(iv)</a>;</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline"><a name="IFeq3ii" id="IFeq3ii"/>(ii)</td>
<td valign="top">not enough mesh points are permitted in order to attain the required accuracy.  This is indicated by <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NP"><m:mi mathcolor="#EE0000" mathvariant="bold">NP</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#MNP"><m:mi mathcolor="#EE0000" mathvariant="bold">MNP</m:mi></m:maction></m:math>&#160;on return from a call to D02GBF. This difficulty may be aggravated by a poor initial choice of mesh points;</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline"><a name="IFeq3iii" id="IFeq3iii"/>(iii)</td>
<td valign="top">the accuracy requested cannot be attained on the computer being used; and</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline"><a name="IFeq3iv" id="IFeq3iv"/>(iv)</td>
<td valign="top">an unlikely combination of values of <m:math><m:mi>F</m:mi><m:mi>x</m:mi></m:math>&#160;has led to a singular  Jacobian.  The error should not persist if more mesh points are allowed.</td>
</tr></table>
</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">A serious error has occurred in a call to D02GBF.  Check all array subscripts and subroutine parameter lists in calls to D02GBF.  Seek expert help.</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">There are two possible reasons for this error exit which occurs when checking the rank of the boundary conditions by reduction to a row echelon form:
<table class="standard-90"><tr>
<td style="width:2.1em;" valign="baseline"><a name="item1" id="item1"/>(i)</td>
<td valign="top">at least one row of the <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;by <m:math><m:mn>2</m:mn><m:mi mathvariant="italic">n</m:mi></m:math>&#160;matrix <m:math><m:mfenced separators="" open="[" close="]"><m:mi>C</m:mi><m:mo>,</m:mo><m:mi>D</m:mi></m:mfenced></m:math>&#160;is a linear combination of the other rows and hence the boundary conditions are rank deficient.  The index of the first such row encountered is given by <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;on exit; and</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline"><a name="item2" id="item2"/>(ii)</td>
<td valign="top">as <a class="item" href="#item1">(i)</a> but the rank deficiency implied by this error exit has only been determined up to a numerical tolerance.  Minus the index of the first such row encountered is given by <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IW"><m:mi mathcolor="#EE0000" mathvariant="bold">IW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;on exit.</td>
</tr></table>
</div>
<div class="paramtext">In case <a class="item" href="#item2">(ii)</a> there is some doubt as to the rank deficiency of the boundary conditions.  However even if the boundary conditions are not rank deficient they are not posed in a suitable form for use with this routine.</div>
<div class="paramtext">For example, if

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>C</m:mi><m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="left">
  <m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mi>&#949;</m:mi></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>, &#8195;</m:mtext><m:mi>D</m:mi><m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="left">
  <m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>, &#8195;</m:mtext><m:mi>&#947;</m:mi><m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="left">
  <m:mtr>
   <m:mtd><m:msub><m:mi>&#947;</m:mi><m:mn>1</m:mn></m:msub></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:msub><m:mi>&#947;</m:mi><m:mn>2</m:mn></m:msub></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

and <m:math><m:mi>&#949;</m:mi></m:math>&#160;is small enough, this error exit is likely to be taken.  A better form for the boundary conditions in this case would be

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>C</m:mi><m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="left">
  <m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>1</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>, &#8195;</m:mtext><m:mi>D</m:mi><m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="left">
  <m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>, &#8195;</m:mtext><m:mi>&#947;</m:mi><m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="left">
  <m:mtr>
   <m:mtd><m:msub><m:mi>&#947;</m:mi><m:mn>1</m:mn></m:msub></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:msup><m:mi>&#949;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:mfenced separators=""><m:msub><m:mi>&#947;</m:mi><m:mn>2</m:mn></m:msub><m:mo>-</m:mo><m:msub><m:mi>&#947;</m:mi><m:mn>1</m:mn></m:msub></m:mfenced></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The solution returned by the routine will be accurate to your tolerance as defined by the relation <a class="eqn" href="#eqnd02TOL-g">(3)</a> except in extreme circumstances.  If too many points are specified in the initial mesh, the solution may be more accurate than requested and the error may not be approximately equidistributed.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The time taken by D02GBF depends on the difficulty of the problem, the number of mesh points (and meshes) used and the number of deferred corrections.</div><div class="paramtext">You are strongly recommended to set <a class="arg" href="#IFAIL">IFAIL</a> to obtain self-explanatory error messages, and also monitoring information about the course of the computation.  You may select the channel numbers on which this output is to appear by calls of <a class="rout" href="../X04/x04aaf.xml">X04AAF</a> (for error messages) or <a class="rout" href="../X04/x04abf.xml">X04ABF</a> (for monitoring information) &#8211; see <a class="sec" href="#example">Section 9</a> for an example.  Otherwise the default channel numbers will be used, as specified in the <a class="url" href="http://www.nag.co.uk/doc/inun/fl22.html">Users' Note</a>.</div><div class="paramtext">In the case where you wish to solve a sequence of similar problems, the final mesh from solving one case is strongly recommended as the initial mesh for the next.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example solves the problem (written as a first-order system)

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>&#949;</m:mi> <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:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mn>0</m:mn>
</m:math></td><td class="formula2"/></tr></table></div>

with boundary conditions

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>y</m:mi><m:mfenced separators=""><m:mn>0</m:mn></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>, &#8195;</m:mtext><m:mi>y</m:mi><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced><m:mo>=</m:mo><m:mn>1</m:mn>
</m:math></td><td class="formula2"/></tr></table></div>

for the cases <m:math><m:mi>&#949;</m:mi><m:mo>=</m:mo><m:msup><m:mn>10</m:mn><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup></m:math>&#160;and <m:math><m:mi>&#949;</m:mi><m:mo>=</m:mo><m:msup><m:mn>10</m:mn><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:msup></m:math>&#160;using the default initial mesh in the first case, and the final mesh of the first case as initial mesh for the second (more difficult) case.  We give the solution and the error at each mesh point to illustrate the accuracy of the method given the accuracy request <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>=</m:mo><m:mtext>1.0D&#8722;3</m:mtext></m:math>.</div><div class="paramtext">Note the call to <a class="rout" href="../X04/x04abf.xml">X04ABF</a> prior to the call to D02GBF.</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/d02gbfe.f">Program Text (d02gbfe.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/d02gbfe.r">Program Results (d02gbfe.r)</a></p><div class="figure"><a name="d02gbf-plot" id="d02gbf-plot"/><img src="../figures/d02gbf-plot.png" alt="Example Program Plot for d02gbf-plot"/></div>
<hr/><div><a class="rout" href="../../pdf/D02/d02gbf.pdf">D02GBF (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>
