<?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>D02NEF : 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/d02nef.pdf">D02NEF (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/>D02NEF</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">D02NEF is a routine for integrating stiff systems of implicit ordinary differential equations coupled with algebraic equations.</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;D02NEF&#160;(</td><td class="tdfspec2"><a class="arg" href="#NEQ">NEQ</a>, <a class="arg" href="#T">T</a>, <a class="arg" href="#TOUT">TOUT</a>, <a class="arg" href="#Y">Y</a>, <a class="arg" href="#YDOT">YDOT</a>, <a class="arg" href="#RTOL">RTOL</a>, <a class="arg" href="#ATOL">ATOL</a>, <a class="arg" href="#ITASK">ITASK</a>, <a class="arg" href="#RES">RES</a>, <a class="arg" href="#JAC">JAC</a>, <a class="arg" href="#ICOM">ICOM</a>, <a class="arg" href="#COM">COM</a>, <a class="arg" href="#LCOM">LCOM</a>, <a class="arg" href="#IUSER">IUSER</a>, <a class="arg" href="#RUSER">RUSER</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, ITASK, ICOM(50+NEQ), LCOM, IUSER(*), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, TOUT, Y(NEQ), YDOT(NEQ), RTOL(*), ATOL(*), COM(LCOM), RUSER(*)</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">RES, JAC</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D02NEF is a general purpose routine for integrating the initial value problem for a stiff system of implicit ordinary differential equations with coupled algebraic equations written in the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
  <m:mi>F</m:mi>
  <m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi><m:mo>,</m:mo><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mfenced>
  <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">D02NEF uses the DASSL implementation of the Backward Differentiation Formulae (BDF) of orders one to five to solve a system of the above form for <m:math><m:mi>y</m:mi></m:math>&#160;(<a class="arg" href="#Y">Y</a>) and <m:math><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>&#160;(<a class="arg" href="#YDOT">YDOT</a>).  Values for <a class="arg" href="#Y">Y</a> and <a class="arg" href="#YDOT">YDOT</a> at the initial time must be given as input.  These values must be consistent, (i.e., if <a class="arg" href="#T">T</a>, <a class="arg" href="#Y">Y</a>, <a class="arg" href="#YDOT">YDOT</a> are the given initial values, they must satisfy <m:math><m:mi>F</m:mi><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#T"><m:mi mathcolor="#EE0000" mathvariant="bold">T</m:mi></m:maction><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#Y"><m:mi mathcolor="#EE0000" mathvariant="bold">Y</m:mi></m:maction><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#YDOT"><m:mi mathcolor="#EE0000" mathvariant="bold">YDOT</m:mi></m:maction></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn></m:math>). The routine solves the system from <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#T"><m:mi mathcolor="#EE0000" mathvariant="bold">T</m:mi></m:maction></m:math>&#160;to <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOUT"><m:mi mathcolor="#EE0000" mathvariant="bold">TOUT</m:mi></m:maction></m:math>.</div><div class="paramtext">An outline of a typical calling program for D02NEF is given below.  It calls the DASSL implementation of the BDF integrator setup routine <a class="rout" href="../D02/d02mwf.xml">D02MWF</a> and the banded matrix setup routine <a class="rout" href="../D02/d02npf.xml">D02NPF</a> (if required), and, if the integration needs to proceed, calls <a class="rout" href="../D02/d02mcf.xml">D02MCF</a> before continuing the integration.
<pre class="verbatim">
C     Declarations
C
      EXTERNAL RES, JAC
             .
             .
             .
C     Initialize the integrator
      CALL D02MWF(...)
C     Is the Jacobian matrix banded?
      IF (BANDED) CALL D02NPF(...)

C     Set DT to the required temporal resolution
C     Set TEND to the final time
C     Call the integrator for each temporal value:
1000  CALL D02NEF(...,RES,JAC,...)
C     Continue integration?
      IF (TOUT.LT.TEND .AND. ITASK.GE.0) THEN
        IF (ITASK.NE.1) TOUT = MIN(TOUT+DT,TEND)
C       Print solution
        CALL D02MCF(...)
        GO TO 1000
      ENDIF
             .
             .
             .
</pre></div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2>
<div class="paramtext">None.</div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="NEQ" id="NEQ"/>1: &#160;&#160;&#8194; NEQ &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 
the number of differential-algebraic equations to be solved.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div>
</dd><dt class="paramhead"><a name="T" id="T"/>2: &#160;&#160;&#8194; T &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: the initial value of the independent variable, <m:math><m:mi>t</m:mi></m:math>.</div>
<div class="paramtext"><i>On intermediate exit</i>:
<m:math><m:mi>t</m:mi></m:math>, the current value of the independent variable.</div>
<div class="paramtext"><i>On final exit</i>: the value of the independent variable at which the computed solution <m:math><m:mi>y</m:mi></m:math>&#160;is returned (usually at <a class="arg" href="#TOUT">TOUT</a>).</div></dd><dt class="paramhead"><a name="TOUT" id="TOUT"/>3: &#160;&#160;&#8194; TOUT &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the next value of <m:math><m:mi>t</m:mi></m:math>&#160;at which a computed solution is desired.</div> 
<div class="paramtext"><i>On initial entry</i>: <a class="arg" href="#TOUT">TOUT</a> is used to determine the direction of integration. Integration is permitted in either direction (see also <a class="arg" href="#ITASK">ITASK</a>).</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOUT"><m:mi mathcolor="#EE0000" mathvariant="bold">TOUT</m:mi></m:maction><m:mo>&#8800;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#T"><m:mi mathcolor="#EE0000" mathvariant="bold">T</m:mi></m:maction></m:math>.
</div>
</dd><dt class="paramhead"><a name="Y" id="Y"/>4: &#160;&#160;&#8194; Y(<a class="arg" href="#NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: the vector of initial values of the dependent variables <m:math><m:mi>y</m:mi></m:math>.</div>
<div class="paramtext"><i>On intermediate exit</i>:
the computed solution vector, <m:math><m:mi>y</m:mi></m:math>, evaluated at <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:mi>T</m:mi></m:math>.</div>
<div class="paramtext"><i>On final exit</i>: the computed solution vector, evaluated at <m:math><m:mi>t</m:mi></m:math>&#160;(usually <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOUT"><m:mi mathcolor="#EE0000" mathvariant="bold">TOUT</m:mi></m:maction></m:math>).</div></dd><dt class="paramhead"><a name="YDOT" id="YDOT"/>5: &#160;&#160;&#8194; YDOT(<a class="arg" href="#NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On initial entry</i>: <a class="arg" href="#YDOT">YDOT</a> must contain approximations to the time derivatives <m:math><m:mi>y</m:mi><m:mo>'</m:mo></m:math>&#160;of the vector <m:math><m:mi>y</m:mi></m:math>&#160;evaluated at the initial value of the independent variable.</div>
<div class="paramtext"><i>On exit</i>: the time derivatives <m:math><m:mi>y</m:mi><m:mo>'</m:mo></m:math>&#160;of the vector <m:math><m:mi>y</m:mi></m:math>&#160;at the last integration point.</div>
</dd><dt class="paramhead"><a name="RTOL" id="RTOL"/>6: &#160;&#160;&#8194; RTOL(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#RTOL">RTOL</a>&#160;which depends on the value of <a class="arg" href="../D02/d02mwf.xml#ITOL">ITOL</a> as set in <a class="rout" href="../D02/d02mwf.xml">D02MWF</a>; it&#160;
must be at least
<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;and at least <m:math><m:mn>1</m:mn></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>&#160;(see <a class="rout" href="../D02/d02mwf.xml">D02MWF</a>).</div>
<div class="paramtext"><i>On entry</i>: the relative local error tolerance.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RTOL"><m:mi mathcolor="#EE0000" mathvariant="bold">RTOL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&#8805;</m:mo><m:mn>0.0</m:mn></m:math>,  for <m:math><m:mi mathvariant="italic">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>n</m:mi></m:math><div class="paramtext">where <m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;and <m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;otherwise.</div></div>
<div class="paramtext"><i>On exit</i>: <a class="arg" href="#RTOL">RTOL</a> remains unchanged unless D02NEF 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="#IFeq16"><m:mn mathcolor="#003399" mathvariant="bold">16</m:mn></m:maction></m:math>&#160;in which case the values may have been increased to values estimated to be appropriate for continuing the integration.</div>
</dd><dt class="paramhead"><a name="ATOL" id="ATOL"/>7: &#160;&#160;&#8194; ATOL(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#ATOL">ATOL</a>&#160;which depends on the value of <a class="arg" href="../D02/d02mwf.xml#ITOL">ITOL</a> as set in <a class="rout" href="../D02/d02mwf.xml">D02MWF</a>; it&#160;
must be at least
<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;and at least <m:math><m:mn>1</m:mn></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>&#160;(see <a class="rout" href="../D02/d02mwf.xml">D02MWF</a>).</div>
<div class="paramtext"><i>On entry</i>: the absolute local error tolerance.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ATOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ATOL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&#8805;</m:mo><m:mn>0.0</m:mn></m:math>,  for <m:math><m:mi mathvariant="italic">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>n</m:mi></m:math><div class="paramtext">where <m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;and 
<m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;otherwise.</div></div>
<div class="paramtext"><i>On exit</i>: <a class="arg" href="#ATOL">ATOL</a> remains unchanged unless D02NEF 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="#IFeq16"><m:mn mathcolor="#003399" mathvariant="bold">16</m:mn></m:maction></m:math>&#160;in which case the values may have been increased to values estimated to be appropriate for continuing the integration.</div>
</dd><dt class="paramhead"><a name="ITASK" id="ITASK"/>8: &#160;&#160;&#8194; ITASK &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: need not be set.</div>
<div class="paramtext"><i>On exit</i>: the task performed by the integrator on successful completion or an indicator that a problem occurred during integration.

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITASK"><m:mi mathcolor="#EE0000" mathvariant="bold">ITASK</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>The integration to <a class="arg" href="#TOUT">TOUT</a> was successfully completed (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#T"><m:mi mathcolor="#EE0000" mathvariant="bold">T</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOUT"><m:mi mathcolor="#EE0000" mathvariant="bold">TOUT</m:mi></m:maction></m:math>) by stepping exactly to <a class="arg" href="#TOUT">TOUT</a>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITASK"><m:mi mathcolor="#EE0000" mathvariant="bold">ITASK</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>The integration to <a class="arg" href="#TOUT">TOUT</a> was successfully completed (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#T"><m:mi mathcolor="#EE0000" mathvariant="bold">T</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOUT"><m:mi mathcolor="#EE0000" mathvariant="bold">TOUT</m:mi></m:maction></m:math>) by stepping past <a class="arg" href="#TOUT">TOUT</a>.  <a class="arg" href="#Y">Y</a> and <a class="arg" href="#YDOT">YDOT</a> are obtained by interpolation.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITASK"><m:mi mathcolor="#EE0000" mathvariant="bold">ITASK</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>Different negative values of <a class="arg" href="#ITASK">ITASK</a> returned correspond to different failure exits. <a class="arg" href="#IFAIL">IFAIL</a> should always be checked in such cases and the corrective action taken where appropriate.</dd></dl>
<div class="paramtext"><a class="arg" href="#ITASK">ITASK</a> must remain <b>unchanged</b> between calls to D02NEF.</div>
</div>
</dd><dt class="paramhead"><a name="RES" id="RES"/>9: &#160;&#160;&#8194; RES &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd><div class="paramtext"><a class="arg" href="#RES">RES</a> must evaluate the residual

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
  <m:mi>R</m:mi>
  <m:mo>=</m:mo>
  <m:mi>F</m:mi>
  <m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi><m:mo>,</m:mo><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mfenced>
  <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div>
<div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#RES">RES</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;RES&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02nef.xml#RES_NEQ">NEQ</a>, <a class="arg" href="../D02/d02nef.xml#RES_T">T</a>, <a class="arg" href="../D02/d02nef.xml#RES_Y">Y</a>, <a class="arg" href="../D02/d02nef.xml#RES_YDOT">YDOT</a>, <a class="arg" href="../D02/d02nef.xml#RES_R">R</a>, <a class="arg" href="../D02/d02nef.xml#RES_IRES">IRES</a>, <a class="arg" href="../D02/d02nef.xml#RES_IUSER">IUSER</a>, <a class="arg" href="../D02/d02nef.xml#RES_RUSER">RUSER</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, IRES, IUSER(*)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, Y(NEQ), YDOT(NEQ), R(NEQ), RUSER(*)</td></tr></table>
<dl><dt class="paramhead"><a name="RES_NEQ" id="RES_NEQ"/>1: &#160;&#160;&#8194; NEQ &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>:  the number of differential-algebraic equations being solved.</div>
</dd><dt class="paramhead"><a name="RES_T" id="RES_T"/>2: &#160;&#160;&#8194; T &#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>t</m:mi></m:math>, the current value of the independent variable.</div></dd><dt class="paramhead"><a name="RES_Y" id="RES_Y"/>3: &#160;&#160;&#8194; Y(<a class="arg" href="../D02/d02nef.xml#RES_NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:math>, the current solution component, 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:maction actiontype="link" dsi:type="simple" dsi:href="#RES_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.</div></dd><dt class="paramhead"><a name="RES_YDOT" id="RES_YDOT"/>4: &#160;&#160;&#8194; YDOT(<a class="arg" href="../D02/d02nef.xml#RES_NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the derivative of the solution at the current point <m:math><m:mi>t</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="RES_R" id="RES_R"/>5: &#160;&#160;&#8194; R(<a class="arg" href="../D02/d02nef.xml#RES_NEQ">NEQ</a>) &#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="#RES_R"><m:mi mathcolor="#EE0000" mathvariant="bold">R</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;must contain the <m:math><m:mi>i</m:mi></m:math>th component of <m:math><m:mi>R</m:mi></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:maction actiontype="link" dsi:type="simple" dsi:href="#RES_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;where 

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> 
  <m:mi>R</m:mi>
  <m:mo>=</m:mo>
  <m:mi>F</m:mi>
  <m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#RES_T"><m:mi mathcolor="#EE0000" mathvariant="bold">T</m:mi></m:maction><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#RES_Y"><m:mi mathcolor="#EE0000" mathvariant="bold">Y</m:mi></m:maction><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#RES_YDOT"><m:mi mathcolor="#EE0000" mathvariant="bold">YDOT</m:mi></m:maction></m:mfenced> 
  <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
 
</div>
</dd><dt class="paramhead"><a name="RES_IRES" id="RES_IRES"/>6: &#160;&#160;&#8194; IRES &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: is always equal to zero.</div>
<div class="paramtext"><i>On exit</i>: <a class="arg" href="../D02/d02nef.xml#RES_IRES">IRES</a> should normally be left unchanged.  However, if an illegal value of <a class="arg" href="../D02/d02nef.xml#RES_Y">Y</a> is encountered, <a class="arg" href="../D02/d02nef.xml#RES_IRES">IRES</a> should be set to <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>; D02NEF will then attempt to resolve the problem so that illegal values of <a class="arg" href="../D02/d02nef.xml#RES_Y">Y</a> are not encountered.  <a class="arg" href="../D02/d02nef.xml#RES_IRES">IRES</a> should be set to <m:math><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:math>&#160;if you wish to return control to the calling (sub)routine; this will cause D02NEF to 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="#IFeq23"><m:mn mathcolor="#003399" mathvariant="bold">23</m:mn></m:maction></m:math>.</div>
</dd><dt class="paramhead"><a name="RES_IUSER" id="RES_IUSER"/>7: &#160;&#160;&#8194; IUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; INTEGER array<span class="pclass">User Workspace</span></dt><dt class="multi-paramhead"><a name="RES_RUSER" id="RES_RUSER"/>8: &#160;&#160;&#8194; RUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">User Workspace</span></dt><dd>
<div class="paramtext">You are free to use the arrays <a class="arg" href="../D02/d02nef.xml#RES_IUSER">IUSER</a> and <a class="arg" href="../D02/d02nef.xml#RES_RUSER">RUSER</a> to supply information to <a class="arg" href="#RES">RES</a>.</div>
</dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#RES">RES</a> must be declared as EXTERNAL in the (sub)program from which D02NEF 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="JAC" id="JAC"/>10: &#8194; JAC &#8211; SUBROUTINE, supplied by the NAG Library or the user.<span class="pclass">External Procedure</span></dt><dd><div class="paramtext">Evaluates the matrix of partial derivatives, <m:math><m:mi>J</m:mi></m:math>, where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msub>
  <m:mi>J</m:mi>
  <m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow>
 </m:msub>
  <m:mo>=</m:mo>
  <m:mfrac>
    <m:mrow><m:mi>&#8706;</m:mi><m:msub><m:mi>F</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
    <m:mrow><m:mi>&#8706;</m:mi><m:msub><m:mi>y</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
  </m:mfrac>
  <m:mo>+</m:mo>
  <m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_CJ"><m:mi mathcolor="#EE0000" mathvariant="bold">CJ</m:mi></m:maction>
  <m:mo>&#215;</m:mo>
  <m:mfrac>
    <m:mrow><m:mi>&#8706;</m:mi><m:msub><m:mi>F</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
    <m:mrow><m:mi>&#8706;</m:mi><m:msub><m:msup><m:mi>y</m:mi><m:mi>&#8242;</m:mi></m:msup><m:mi>j</m:mi></m:msub></m:mrow>
  </m:mfrac>
  <m:mtext>,&#8195;</m:mtext>
  <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:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction>
  <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div>
<div class="paramtext">If this option is not required, the actual argument for <a class="arg" href="#JAC">JAC</a> must be the dummy routine D02NEZ. (D02NEZ is included in the NAG Library.) You must indicate to the integrator whether this option is to be used by setting the parameter <a class="arg" href="../D02/d02mwf.xml#JCEVAL">JCEVAL</a> appropriately in a call to the setup routine <a class="rout" href="../D02/d02mwf.xml">D02MWF</a>.</div>
<div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#JAC">JAC</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;JAC&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02nef.xml#JAC_NEQ">NEQ</a>, <a class="arg" href="../D02/d02nef.xml#JAC_T">T</a>, <a class="arg" href="../D02/d02nef.xml#JAC_Y">Y</a>, <a class="arg" href="../D02/d02nef.xml#JAC_YDOT">YDOT</a>, <a class="arg" href="../D02/d02nef.xml#JAC_PD">PD</a>, <a class="arg" href="../D02/d02nef.xml#JAC_CJ">CJ</a>, <a class="arg" href="../D02/d02nef.xml#JAC_IUSER">IUSER</a>, <a class="arg" href="../D02/d02nef.xml#JAC_RUSER">RUSER</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, IUSER(*)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, Y(NEQ), YDOT(NEQ), PD(*), CJ, RUSER(*)</td></tr></table>
<dl><dt class="paramhead"><a name="JAC_NEQ" id="JAC_NEQ"/>1: &#160;&#160;&#8194; NEQ &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>:  the number of differential-algebraic equations being solved.</div>
</dd><dt class="paramhead"><a name="JAC_T" id="JAC_T"/>2: &#160;&#160;&#8194; T &#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>t</m:mi></m:math>, the current value of the independent variable.</div></dd><dt class="paramhead"><a name="JAC_Y" id="JAC_Y"/>3: &#160;&#160;&#8194; Y(<a class="arg" href="../D02/d02nef.xml#JAC_NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:math>, the current solution component, 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:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.</div></dd><dt class="paramhead"><a name="JAC_YDOT" id="JAC_YDOT"/>4: &#160;&#160;&#8194; YDOT(<a class="arg" href="../D02/d02nef.xml#JAC_NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the derivative of the solution at the current point <m:math><m:mi>t</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="JAC_PD" id="JAC_PD"/>5: &#160;&#160;&#8194; PD(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="../D02/d02nef.xml#JAC_PD">PD</a>
is
<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;when the Jacobian is full and will be <m:math><m:mfenced separators=""><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;when the Jacobian is banded (that is, a prior call to <a class="rout" href="../D02/d02npf.xml">D02NPF</a> has been made) &#160;(see <a class="rout" href="../D02/d02npf.xml">D02NPF</a>).</div><div class="paramtext"><i>On entry</i>: <a class="arg" href="../D02/d02nef.xml#JAC_PD">PD</a> is preset to zero before the call to <a class="arg" href="#JAC">JAC</a>.</div>
<div class="paramtext"><i>On exit</i>: if the Jacobian is full then <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_PD"><m:mi mathcolor="#EE0000" mathvariant="bold">PD</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mfenced separators=""><m:mi>i</m:mi><m:mo>-</m:mo><m:mi>j</m:mi></m:mfenced><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:mi>i</m:mi></m:mrow></m:mfenced></m:mrow><m:mo>=</m:mo><m:msub><m:mi>J</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></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:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>; if the Jacobian is banded then <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_PD"><m:mi mathcolor="#EE0000" mathvariant="bold">PD</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mfenced separators=""><m:mi>j</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mi>i</m:mi><m:mo>-</m:mo><m:mi>j</m:mi></m:mrow></m:mfenced></m:mrow><m:mo>=</m:mo><m:msub><m:mi>J</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>, for <m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:mrow><m:mi>j</m:mi><m:mo>-</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction></m:mrow></m:mfenced></m:mrow><m:mo>&#8804;</m:mo><m:mi>i</m:mi><m:mo>&#8804;</m:mo><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>n</m:mi><m:mo>,</m:mo><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction></m:mrow></m:mfenced></m:mrow></m:math>; (see also  in <a class="rout" href="../F07/f07bdf.xml">F07BDF (DGBTRF)</a>).</div>
</dd><dt class="paramhead"><a name="JAC_CJ" id="JAC_CJ"/>6: &#160;&#160;&#8194; CJ &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="../D02/d02nef.xml#JAC_CJ">CJ</a> is a scalar constant which will be defined in D02NEF.</div>
</dd><dt class="paramhead"><a name="JAC_IUSER" id="JAC_IUSER"/>7: &#160;&#160;&#8194; IUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; INTEGER array<span class="pclass">User Workspace</span></dt><dt class="multi-paramhead"><a name="JAC_RUSER" id="JAC_RUSER"/>8: &#160;&#160;&#8194; RUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">User Workspace</span></dt><dd>
<div class="paramtext">You are free to use the arrays <a class="arg" href="../D02/d02nef.xml#JAC_IUSER">IUSER</a> and <a class="arg" href="../D02/d02nef.xml#JAC_RUSER">RUSER</a> to supply information to <a class="arg" href="#JAC">JAC</a>.</div>
</dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#JAC">JAC</a> must be declared as EXTERNAL in the (sub)program from which D02NEF 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="ICOM" id="ICOM"/>11: &#8194; ICOM(<m:math><m:mn>50</m:mn><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>) &#8211; INTEGER array<span class="pclass">Communication Array</span></dt><dd>
<div class="paramtext"><a class="arg" href="#ICOM">ICOM</a> contains information which is usually of no interest, but is necessary for subsequent calls.  However you may find the following useful:

<dl>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ICOM"><m:mi mathcolor="#EE0000" mathvariant="bold">ICOM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>22</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The order of the method to be attempted on the next step.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ICOM"><m:mi mathcolor="#EE0000" mathvariant="bold">ICOM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>23</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The order of the method used on the last step.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ICOM"><m:mi mathcolor="#EE0000" mathvariant="bold">ICOM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>26</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of steps taken so far.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ICOM"><m:mi mathcolor="#EE0000" mathvariant="bold">ICOM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>27</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of calls to <a class="arg" href="#RES">RES</a> so far.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ICOM"><m:mi mathcolor="#EE0000" mathvariant="bold">ICOM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>28</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The number of evaluations of the matrix of partial derivatives needed so far.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ICOM"><m:mi mathcolor="#EE0000" mathvariant="bold">ICOM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>29</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The total number of error test failures so far.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ICOM"><m:mi mathcolor="#EE0000" mathvariant="bold">ICOM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>30</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The total number of convergence test failures so far.</dd></dl></div>
</dd><dt class="paramhead"><a name="COM" id="COM"/>12: &#8194; COM(<a class="arg" href="#LCOM">LCOM</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Communication Array</span></dt><dd>
<div class="paramtext"><a class="arg" href="#COM">COM</a> contains information which is usually of no interest, but is necessary for subsequent calls.  However you may find the following useful:

<dl>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#COM"><m:mi mathcolor="#EE0000" mathvariant="bold">COM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>3</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The step size to be attempted on the next step.</dd>
<dt class="paramval"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#COM"><m:mi mathcolor="#EE0000" mathvariant="bold">COM</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>4</m:mn></m:mfenced></m:mrow></m:math></dt>
<dd>The current value of the independent variable, i.e., the farthest point integration has reached.  This will be different from <a class="arg" href="#T">T</a> only when interpolation has been performed (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITASK"><m:mi mathcolor="#EE0000" mathvariant="bold">ITASK</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>).</dd></dl>
</div>
</dd><dt class="paramhead"><a name="LCOM" id="LCOM"/>13: &#8194; LCOM &#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="#COM">COM</a> as declared in the (sub)program from which D02NEF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LCOM"><m:mi mathcolor="#EE0000" mathvariant="bold">LCOM</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>40</m:mn><m:mo>+</m:mo><m:mfenced separators=""><m:mi mathvariant="italic">maxorder</m:mi><m:mo>+</m:mo><m:mn>4</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#215;</m:mo><m:mi>p</m:mi><m:mo>+</m:mo><m:mi>q</m:mi></m:math>&#160;where <m:math><m:mi mathvariant="italic">maxorder</m:mi></m:math>&#160;is the maximum order that can be used by the integration method (see <a class="arg" href="../D02/d02mwf.xml#MAXORD">MAXORD</a> in <a class="rout" href="../D02/d02mwf.xml">D02MWF</a>); <m:math><m:mi>p</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;when the Jacobian is full and <m:math><m:mi>p</m:mi><m:mo>=</m:mo><m:mfenced separators=""><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced></m:math>&#160;when the Jacobian is banded; and, <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>/</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced></m:mfenced><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;when the Jacobian is to be evaluated numerically and <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;otherwise.
</div>
</dd><dt class="paramhead"><a name="IUSER" id="IUSER"/>14: &#8194; IUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; INTEGER array<span class="pclass">User Workspace</span></dt><dt class="multi-paramhead"><a name="RUSER" id="RUSER"/>15: &#8194; RUSER(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">User Workspace</span></dt><dd>
<div class="paramtext"><b>Note:</b> the dimension of the arrays <a class="arg" href="#IUSER">IUSER</a> and <a class="arg" href="#RUSER">RUSER</a>
must be at least
<m:math><m:mn>1</m:mn></m:math>.</div>
<div class="paramtext">You are free to use the arrays <a class="arg" href="#IUSER">IUSER</a> and <a class="arg" href="#RUSER">RUSER</a> to supply information to the calling subroutine.</div>
</dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>16: &#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, because for this routine the values of the output parameters may be useful even 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>&#160;on exit, the recommended value is <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></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>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"><b>Note:</b> D02NEF may return useful information for one or more of the following detected errors or warnings.</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>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>1</m:mn></m:math></td></tr></table>
</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>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOUT"><m:mi mathcolor="#EE0000" mathvariant="bold">TOUT</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#T"><m:mi mathcolor="#EE0000" mathvariant="bold">T</m:mi></m:maction></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><a class="arg" href="#TOUT">TOUT</a> is too close to <a class="arg" href="#T">T</a> to start integration,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><a class="arg" href="#TOUT">TOUT</a> is behind <a class="arg" href="#T">T</a> in the direction of <a class="arg" href="../D02/d02mwf.xml#H0">H0</a> (see <a class="rout" href="../D02/d02mwf.xml">D02MWF</a>),</td></tr></table>
</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>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#RTOL"><m:mi mathcolor="#EE0000" mathvariant="bold">RTOL</m:mi></m:maction><m:mfenced separators=""><m:mi>i</m:mi></m:mfenced><m:mo>&lt;</m:mo><m:mn>0.0</m:mn></m:math>&#160;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>n</m:mi></m:math>, where <m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;and <m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;otherwise,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#RTOL"><m:mi mathcolor="#EE0000" mathvariant="bold">RTOL</m:mi></m:maction><m:mfenced separators=""><m:mi>i</m:mi></m:mfenced><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#ATOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ATOL</m:mi></m:maction><m:mfenced separators=""><m:mi>i</m:mi></m:mfenced><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>&#160;for all relevant <m:math><m:mi>i</m:mi></m:math>.</td></tr></table>
</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>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ATOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ATOL</m:mi></m:maction><m:mfenced separators=""><m:mi>i</m:mi></m:mfenced><m:mo>&lt;</m:mo><m:mn>0.0</m:mn></m:math>&#160;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>n</m:mi></m:math>, where <m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;and <m:math><m:mi>n</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;otherwise.</td></tr></table>
</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>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90">a previous call to this routine returned <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITASK"><m:mi mathcolor="#EE0000" mathvariant="bold">ITASK</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>&#160;and <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:mn>0</m:mn></m:math>, but no appropriate action was taken. For example, if a call returns 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="#IFeq15"><m:mn mathcolor="#003399" mathvariant="bold">15</m:mn></m:maction></m:math>&#160;(<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITASK"><m:mi mathcolor="#EE0000" mathvariant="bold">ITASK</m:mi></m:maction><m:mo>=</m:mo><m:mn>-1</m:mn></m:math>) then a call to <a class="rout" href="../D02/d02mcf.xml">D02MCF</a> must be made prior to making a continuation call to D02NEF.</td></tr></table>
</dd>
</dl><dl class="ifail">
<dt class="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">Either the initialization routine <a class="rout" href="../D02/d02mwf.xml">D02MWF</a> has not been called prior to the first call of this routine or one of the communication arrays <a class="arg" href="#ICOM">ICOM</a>, <a class="arg" href="#COM">COM</a> has become corrupted.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq13" id="IFeq13"/><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>13</m:mn></m:math></dt>
<dd>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LCOM"><m:mi mathcolor="#EE0000" mathvariant="bold">LCOM</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>40</m:mn><m:mo>+</m:mo><m:mfenced separators=""><m:mi mathvariant="italic">maxorder</m:mi><m:mo>+</m:mo><m:mn>4</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>, and the Jacobian is full;</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LCOM"><m:mi mathcolor="#EE0000" mathvariant="bold">LCOM</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>40</m:mn><m:mo>+</m:mo><m:mfenced separators=""><m:mi mathvariant="italic">maxorder</m:mi><m:mo>+</m:mo><m:mn>4</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>+</m:mo><m:mi>q</m:mi></m:math>, and the Jacobian is banded,
</td></tr></table>
<div class="paramtext">where <m:math><m:mi mathvariant="italic">maxorder</m:mi></m:math>&#160;is the maximum order of the integration method to be used, and <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>/</m:mo><m:mfenced separators=""> <m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn> </m:mfenced></m:mfenced><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;when the Jacobian is to be evaluated numerically and <m:math><m:mi>q</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;otherwise.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq15" id="IFeq15"/><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>15</m:mn></m:math></dt>
<dd>
<div class="paramtext">The maximum number of steps (<m:math><m:mn>500</m:mn></m:math>) has been taken on this call and the integration has not reached <a class="arg" href="#TOUT">TOUT</a>. The integration can proceed by calling <a class="rout" href="../D02/d02mcf.xml">D02MCF</a> prior to calling D02NEF again; this will reset the step counter to zero.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq16" id="IFeq16"/><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>16</m:mn></m:math></dt>
<dd>
<div class="paramtext">Too much accuracy was requested for the precision of the machine. On output <a class="arg" href="#RTOL">RTOL</a> and <a class="arg" href="#ATOL">ATOL</a> were increased by an appropriate scale factor to prevent this error exit. Try running the problem again with these scaled tolerances.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq17" id="IFeq17"/><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>17</m:mn></m:math></dt>
<dd>
<div class="paramtext">A purely relative tolerance was selected for a given solution component, but that solution component has become zero and a pure relative error test is impossible for this component. Perhaps an absolute tolerance requirement is also necessary for this component.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq18" id="IFeq18"/><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>18</m:mn></m:math></dt>
<dd>
<div class="paramtext">The error test failed repeatedly using the minimum stepsize and so the integration could not proceed. If a (nonzero) minimum stepsize was specified in a call to <a class="rout" href="../D02/d02mwf.xml">D02MWF</a> then either a reduction in this minimum stepsize or in the specified tolerances should be considered.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq19" id="IFeq19"/><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>19</m:mn></m:math></dt>
<dd>
<div class="paramtext">The corrector step to obtain the approximate solution at the next time step repeatedly failed to converge using the minimum stepsize.  This may be due to an inconsistency between the system of equations to be solved and initial conditions.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq20" id="IFeq20"/><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>20</m:mn></m:math></dt>
<dd>
<div class="paramtext">The iteration matrix (Jacobian) has become singular. Please check the Jacobian evaluations when this is performed analytically.  Also check for invalid solution values in the call to <a class="arg" href="#RES">RES</a>; these should be flagged by returning <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#RES_IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>-1</m:mn></m:math>.  This is probably due to an error in the analytic evaluation of the Jacobian.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq21" id="IFeq21"/><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>21</m:mn></m:math></dt>
<dd>
<div class="paramtext">The corrector step could not converge and the error test failed repeatedly.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq22" id="IFeq22"/><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>22</m:mn></m:math></dt>
<dd>
<div class="paramtext"><a class="arg" href="../D02/d02nef.xml#RES_IRES">IRES</a> was set to <m:math><m:mn>-1</m:mn></m:math>&#160;during a call to <a class="arg" href="#RES">RES</a> and the problem could not be resolved.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq23" id="IFeq23"/><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>23</m:mn></m:math></dt>
<dd>
<div class="paramtext"><a class="arg" href="../D02/d02nef.xml#RES_IRES">IRES</a> was set to <m:math><m:mn>-2</m:mn></m:math>&#160;during a call to <a class="arg" href="#RES">RES</a>.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq24" id="IFeq24"/><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>24</m:mn></m:math></dt>
<dd>
 <div class="paramtext">The initial <a class="arg" href="#YDOT">YDOT</a> could not be computed. This could happen because the initial approximation to <a class="arg" href="#YDOT">YDOT</a> was very poor or because no <a class="arg" href="#YDOT">YDOT</a> exists that is consistent with the initial <m:math><m:mi>Y</m:mi></m:math>.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq25" id="IFeq25"/><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>25</m:mn></m:math></dt>
<dd>
<div class="paramtext">Repeated occurrences of input constraint violations have been detected. This could result in a potential infinite loop.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The accuracy of the numerical solution may be controlled by a careful choice of the parameters <a class="arg" href="#RTOL">RTOL</a> and <a class="arg" href="#ATOL">ATOL</a>.  You are advised to use scalar error control unless the components of the solution are expected to be poorly scaled. For the type of decaying solution typical of many stiff problems, relative error control with a small absolute error threshold will be most appropriate (that is, you are advised to choose <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02mwf.xml#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;with <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ATOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ATOL</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;small but positive).</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The cost of computing a solution depends critically on the size of the differential system and to a lesser extent on the degree of stiffness of the problem.  For banded systems the cost is proportional to <m:math>
 <m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#215;</m:mo><m:msup>
 <m:mfenced separators="">
    <m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo>
    <m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn>
 </m:mfenced>
 <m:mn>2</m:mn></m:msup>
</m:math>, while for full systems the cost is proportional to 
<m:math><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mn>3</m:mn></m:msup></m:math>. Note however that for moderately sized problems which are only mildly nonlinear the cost may be dominated by factors proportional to <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#215;</m:mo><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#ML"><m:mi mathcolor="#EE0000" mathvariant="bold">ML</m:mi></m:maction><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02npf.xml#MU"><m:mi mathcolor="#EE0000" mathvariant="bold">MU</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced></m:math>&#160;and <m:math><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mn>2</m:mn></m:msup></m:math>&#160;respectively.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">For this routine two examples are presented.  There is a single example program for D02NEF, with a main program and the code to solve the two example problems given in Example 1 (EX1) and Example 2 (EX2).</div><div class="paramtext"><b>Example 1 (EX1)</b></div><div class="paramtext">This example solves the well-known stiff Robertson problem written in implicit form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mtable columnalign="left center right center left center left center left">
  <m:mtr>
   <m:mtd><m:msub><m:mi>r</m:mi><m:mn>1</m:mn></m:msub></m:mtd>
   <m:mtd><m:mo>=</m:mo></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.04</m:mn></m:mrow><m:mi>a</m:mi></m:mtd>
   <m:mtd><m:mo>+</m:mo></m:mtd>
   <m:mtd><m:mn>1.0</m:mn><m:mi mathvariant="normal">E</m:mi><m:mn>4</m:mn><m:mi>b</m:mi><m:mi>c</m:mi></m:mtd>
   <m:mtd/>
   <m:mtd/>
   <m:mtd><m:mo>-</m:mo></m:mtd>
   <m:mtd><m:msup><m:mi>a</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mtd>
   </m:mtr><m:mtr>
   <m:mtd><m:msub><m:mi>r</m:mi><m:mn>2</m:mn></m:msub></m:mtd>
   <m:mtd><m:mo>=</m:mo></m:mtd>
   <m:mtd><m:mn>0.04</m:mn><m:mi>a</m:mi></m:mtd>
   <m:mtd><m:mo>-</m:mo></m:mtd>
   <m:mtd><m:mn>1.0</m:mn><m:mi mathvariant="normal">E</m:mi><m:mn>4</m:mn><m:mi>b</m:mi><m:mi>c</m:mi></m:mtd>
   <m:mtd><m:mo>-</m:mo></m:mtd>
   <m:mtd><m:mn>3.0</m:mn><m:mi mathvariant="normal">E</m:mi><m:mn>7</m:mn><m:mo>&#8290;</m:mo><m:msup><m:mi>b</m:mi><m:mn>2</m:mn></m:msup></m:mtd>
   <m:mtd><m:mo>-</m:mo></m:mtd>
   <m:mtd><m:msup><m:mi>b</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mtd>
   </m:mtr><m:mtr>
   <m:mtd><m:msub><m:mi>r</m:mi><m:mn>3</m:mn></m:msub></m:mtd>
   <m:mtd><m:mo>=</m:mo></m:mtd>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
   <m:mtd><m:mn>3.0</m:mn><m:mi mathvariant="normal">E</m:mi><m:mn>7</m:mn><m:mo>&#8290;</m:mo><m:msup><m:mi>b</m:mi><m:mn>2</m:mn></m:msup></m:mtd>
   <m:mtd><m:mo>-</m:mo></m:mtd>
   <m:mtd><m:msup><m:mi>c</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mtd>
  </m:mtr>
 </m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

with initial conditions <m:math><m:mi>a</m:mi><m:mo>=</m:mo><m:mn>1.0</m:mn></m:math>&#160;and <m:math><m:mi>b</m:mi><m:mo>=</m:mo><m:mi>c</m:mi><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>&#160;over the range <m:math><m:mfenced separators="" open="[" close="]"><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>0.1</m:mn></m:mfenced></m:math>&#160;the BDF method (setup routine <a class="rout" href="../D02/d02mwf.xml">D02MWF</a> and <a class="rout" href="../D02/d02npf.xml">D02NPF</a>).</div><div class="paramtext"><b>Example 2 (EX2)</b></div><div class="paramtext">This example illustrates the use of D02NEF to solve a simple algebraic problem by continuation.  The equation <m:math><m:mn>4</m:mn><m:mo>-</m:mo><m:mn>2</m:mn><m:mi>y</m:mi><m:mo>+</m:mo><m:mn>0.1</m:mn><m:msup><m:mi>e</m:mi><m:mi>y</m:mi></m:msup><m:mi>t</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;from <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;(where <m:math><m:mi>y</m:mi><m:mo>=</m:mo><m:mn>2</m:mn></m:math>) to <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></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/d02nefe.f">Program Text (d02nefe.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/d02nefe.r">Program Results (d02nefe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/D02/d02nef.pdf">D02NEF (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>
