<?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>D02NMF : 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/d02nmf.pdf">D02NMF (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/>D02NMF</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">D02NMF is a reverse communication routine for integrating stiff systems of explicit ordinary differential 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;D02NMF&#160;(</td><td class="tdfspec2"><a class="arg" href="#NEQ">NEQ</a>, <a class="arg" href="#LDYSAV">LDYSAV</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="#RWORK">RWORK</a>, <a class="arg" href="#RTOL">RTOL</a>, <a class="arg" href="#ATOL">ATOL</a>, <a class="arg" href="#ITOL">ITOL</a>, <a class="arg" href="#INFORM">INFORM</a>, <a class="arg" href="#YSAV">YSAV</a>, <a class="arg" href="#SDYSAV">SDYSAV</a>, <a class="arg" href="#WKJAC">WKJAC</a>, <a class="arg" href="#NWKJAC">NWKJAC</a>, <a class="arg" href="#JACPVT">JACPVT</a>, <a class="arg" href="#NJCPVT">NJCPVT</a>, <a class="arg" href="#IMON">IMON</a>, <a class="arg" href="#INLN">INLN</a>, <a class="arg" href="#IRES">IRES</a>, <a class="arg" href="#IREVCM">IREVCM</a>, <a class="arg" href="#ITASK">ITASK</a>, <a class="arg" href="#ITRACE">ITRACE</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, LDYSAV, ITOL, INFORM(23), SDYSAV, NWKJAC, JACPVT(NJCPVT), NJCPVT, IMON, INLN, IRES, IREVCM, ITASK, ITRACE, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, TOUT, Y(NEQ), YDOT(NEQ), RWORK(50+4*NEQ), RTOL(*), ATOL(*), YSAV(LDYSAV,SDYSAV), WKJAC(NWKJAC)</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D02NMF is a general purpose routine for integrating the initial value problem for a stiff system of explicit ordinary differential equations,

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mi>g</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

An outline of a typical calling program is given below:</div><pre class="verbatim">
C 
C     declarations 
C 
      call linear algebra setup routine 
      call integrator setup routine 
      IREVCM=0 
 1000 CALL D02NMF(NEQ, LDYSAV, T, TOUT, Y, YDOT, RWORK, RTOL, 
     +  ATOL, ITOL, INFORM, YSAVE, SDYSAV, WKJAC, NWKJAC, JACPVT, 
     +  NJCPVT, IMON, INLN, IRES, IREVCM, ITASK, ITRACE, IFAIL) 
      IF (IREVCM.GT.0) THEN 
        IF (IREVCM. EQ. 8) THEN 
          supply the Jacobian matrix                                  (i)
        ELSE IF(IREVCM.EQ.9) THEN 
          perform monitoring tasks requested by the user             (ii)
        ELSE IF(IRECVM.EQ.1.OR.IREVCM.GE.3.AND.IREVCM.LE.5) THEN 
          evaluate the derivative                                   (iii)
        ELSE IF(IREVCM.EQ.10) THEN 
          indicates an unsuccessful step 
        ENDIF 
        GO TO 1000 
      ENDIF 
C 
C     post processing (optional linear algebra diagnostic call 
C     (sparse case only), optional integrator diagnostic call) 
C 
      STOP 
      END
</pre><div class="paramtext">There are three major operations that may be required of the calling (sub)program on an intermeditate return (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>&#8800;</m:mo><m:mn>0</m:mn></m:math>) from D02NMF; these are denoted (i), (ii) and (iii) above.</div><div class="paramtext">The following sections describe in greater detail exactly what is required of each of these operations.</div><div class="paramtext"><b>(i) Supply the Jacobian Matrix</b></div><div class="paramtext">You need only provide this facility if the parameter <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02nsf.xml#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'A'</m:mtext></m:math>&#160;(or 'F' if using sparse matrix linear algebra) in a call to the linear algebra setup routine. If the Jacobian matrix is to be evaluated numerically by the integrator, then the remainder of section (i) can be ignored.</div><div class="paramtext">We must define the system of nonlinear equations which is solved internally by the integrator. The time derivative, <m:math><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>, has the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mfenced separators=""><m:mi>y</m:mi><m:mo>-</m:mo><m:mi>z</m:mi></m:mfenced><m:mo>/</m:mo><m:mfenced separators=""><m:mi>h</m:mi><m:mi>d</m:mi></m:mfenced><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>h</m:mi></m:math>&#160;is the current step size and <m:math><m:mi>d</m:mi></m:math>&#160;is a parameter that depends on the integration method in use. The vector <m:math><m:mi>y</m:mi></m:math>&#160;is the current solution and the vector <m:math><m:mi>z</m:mi></m:math>&#160;depends on information from previous time steps. This means that <m:math>
 <m:mfrac>
  <m:mi>d</m:mi>
  <m:mrow><m:mi>d</m:mi><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mrow>
 </m:mfrac>
 <m:mfenced separators=""><m:mtext>&#8203; &#8203;</m:mtext></m:mfenced>
 <m:mo>=</m:mo>
 <m:mfrac><m:mn>1</m:mn><m:mfenced separators=""><m:mi>h</m:mi><m:mi>d</m:mi></m:mfenced></m:mfrac>
 <m:mfrac><m:mi>d</m:mi><m:mrow><m:mi>d</m:mi><m:mi>y</m:mi></m:mrow></m:mfrac>
 <m:mfenced separators=""><m:mtext>&#8203; &#8203;</m:mtext></m:mfenced>
</m:math>.</div><div class="paramtext">The system of nonlinear equations that is solved has the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>-</m:mo><m:mi>g</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn>
</m:math></td><td class="formula2"/></tr></table></div>

but is solved in the form

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>r</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where the function <m:math><m:mi>r</m:mi></m:math>&#160;is defined by

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>r</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mo>=</m:mo><m:mfenced separators=""><m:mi>h</m:mi><m:mi>d</m:mi></m:mfenced><m:mfenced separators=""><m:mrow><m:mfenced separators=""><m:mi>y</m:mi><m:mo>-</m:mo><m:mi>z</m:mi></m:mfenced><m:mo>/</m:mo><m:mfenced separators=""><m:mi>h</m:mi><m:mi>d</m:mi></m:mfenced><m:mo>-</m:mo><m:mi>g</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced></m:mrow></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

It is the Jacobian matrix <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>r</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>y</m:mi></m:mrow>
 </m:mfrac>
</m:math>&#160;that you must supply as follows:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable>
 <m:mtr>
  <m:mtd/>
  <m:mtd><m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>r</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>y</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>-</m:mo><m:mfenced separators=""><m:mi>h</m:mi><m:mi>d</m:mi></m:mfenced><m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>g</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>y</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac></m:mtd>
  <m:mtd><m:mtext>if &#8203;</m:mtext><m:mi>i</m:mi><m:mo>=</m:mo><m:mi>j</m:mi><m:mtext>,</m:mtext></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd/>
  <m:mtd/>
 </m:mtr><m:mtr>
  <m:mtd/>
  <m:mtd/>
 </m:mtr><m:mtr>
  <m:mtd/>
  <m:mtd><m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>r</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>y</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac><m:mo>=</m:mo><m:mphantom><m:mn>0</m:mn></m:mphantom><m:mo>-</m:mo><m:mfenced separators=""><m:mi>h</m:mi><m:mi>d</m:mi></m:mfenced><m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>g</m:mi><m:mi>i</m:mi></m:msub></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:msub><m:mi>y</m:mi><m:mi>j</m:mi></m:msub></m:mrow>
 </m:mfrac></m:mtd>
  <m:mtd><m:mtext>otherwise,</m:mtext></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>t</m:mi></m:math>, <m:math><m:mi>h</m:mi></m:math>&#160;and <m:math><m:mi>d</m:mi></m:math>&#160;are located in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>19</m:mn></m:mfenced></m:mrow></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>16</m:mn></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>20</m:mn></m:mfenced></m:mrow></m:math>&#160;respectively and the array <a class="arg" href="#Y">Y</a> contains the current values of the dependent variables.  Only the nonzero elements of the Jacobian need be set, since the locations where it is to be stored are preset to zero.</div><div class="paramtext"><b>Hereafter in this document this operation will be referred to as JAC.</b></div><div class="paramtext"><b>(ii) Perform Tasks Requested by You</b></div><div class="paramtext">This operation is essentially a monitoring function and additionally provides the opportunity of changing the current values of <a class="arg" href="#Y">Y</a>, HNEXT (the step size that the integrator proposes to take on the next step), HMIN (the minimum step size to be taken on the next step), and HMAX (the maximum step size to be taken on the next step).  The scaled local error at the end of a timestep may be obtained by calling <span class="bitalic">double precision</span> function <a class="rout" href="../D02/d02zaf.xml">D02ZAF</a> as follows:
<pre class="verbatim">
      IFAIL = 1
      ERRLOC = D02ZAF(NEQ,RWORK(51+NEQ),RWORK(51),IFAIL)
C     CHECK IFAIL BEFORE PROCEEDING
</pre></div><div class="paramtext">The following gives details of the location within the array <a class="arg" href="#RWORK">RWORK</a> of variables that may be of interest to you: 
<div class="tablediv"><table class="frame-none"><tbody><tr><td class="libdoc" valign="top" align="left"><b>Variable</b></td><td class="libdoc" valign="top" align="center"><b>Specification</b></td><td class="libdoc" valign="top" align="center"><b>Location</b></td></tr><tr><td class="libdoc" valign="top" align="left">TCURR</td><td class="libdoc" valign="top" align="left">the current value of the independent variable</td><td class="libdoc" valign="top" align="left"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>19</m:mn></m:mfenced></m:mrow></m:math></td></tr><tr><td class="libdoc" valign="top" align="left">HLAST</td><td class="libdoc" valign="top" align="left">last step size successfully used by the integrator</td><td class="libdoc" valign="top" align="left"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>15</m:mn></m:mfenced></m:mrow></m:math></td></tr><tr><td class="libdoc" valign="top" align="left">HNEXT</td><td class="libdoc" valign="top" align="left">step size that the integrator proposes to take on the next step</td><td class="libdoc" valign="top" align="left"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>16</m:mn></m:mfenced></m:mrow></m:math></td></tr><tr><td class="libdoc" valign="top" align="left">HMIN</td><td class="libdoc" valign="top" align="left">minimum step size to be taken on the next step</td><td class="libdoc" valign="top" align="left"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>17</m:mn></m:mfenced></m:mrow></m:math></td></tr><tr><td class="libdoc" valign="top" align="left">HMAX</td><td class="libdoc" valign="top" align="left">maximum step size to be taken on the next step</td><td class="libdoc" valign="top" align="left"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>18</m:mn></m:mfenced></m:mrow></m:math></td></tr><tr><td class="libdoc" valign="top" align="left">NQU</td><td class="libdoc" valign="top" align="left">the order of the integrator used on the last step</td><td class="libdoc" valign="top" align="left"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>10</m:mn></m:mfenced></m:mrow></m:math></td></tr></tbody></table></div>
</div><div class="paramtext">You are advised to consult the description of <a class="arg" href="../D02/d02nbf.xml#MONITR">MONITR</a> in <a class="rout" href="../D02/d02nbf.xml">D02NBF</a> for details on what optional input can be made.</div><div class="paramtext">If <a class="arg" href="#Y">Y</a> is changed, then <a class="arg" href="#IMON">IMON</a> must be set to <m:math><m:mn>2</m:mn></m:math>&#160;before return to D02NMF.  If either of the values of HMIN or HMAX are changed, then <a class="arg" href="#IMON">IMON</a> must be set <m:math><m:mtext/><m:mo>&#8805;</m:mo><m:mn>3</m:mn></m:math>&#160;before return to D02NMF.  If HNEXT is changed, then <a class="arg" href="#IMON">IMON</a> must be set to <m:math><m:mn>4</m:mn></m:math>&#160;before return to D02NMF.</div><div class="paramtext">In addition you can force D02NMF to evaluate the residual vector

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>-</m:mo><m:mi>g</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

by setting <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INLN"><m:mi mathcolor="#EE0000" mathvariant="bold">INLN</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>&#160;and then returning to D02NMF; on return to this monitoring operation the residual vector will be stored in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>50</m:mn><m:mo>+</m:mo><m:mn>2</m:mn><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:mi>i</m:mi></m:mrow></m:mfenced></m:mrow><m:mtext>,</m:mtext></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>&#8230;</m:mo><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>.</div><div class="paramtext"><b>Hereafter in this document this operation will be referred to as MONITR.</b></div><div class="paramtext"><b>(iii) Evaluate the Derivative</b></div><div class="paramtext">This operation must evaluate the derivative vector for the explicit ordinary differential equation system defined by

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mi>g</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>t</m:mi></m:math>&#160;is located in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>19</m:mn></m:mfenced></m:mrow></m:math>.</div><div class="paramtext"><b>Hereafter in this document this operation will be referred to as FCN.</b></div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2>
<div class="paramtext">See the <a class="chapint" href="../D02/d02mnintro.xml">D02M&#8211;N sub-chapter Introduction</a>.</div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<div class="paramtext"><b>Note:</b> this routine uses <b>reverse communication.</b> Its use involves an initial entry, intermediate exits and re-entries, and a final exit, as indicated by the <b>parameter <a class="arg" href="#IREVCM">IREVCM</a></b>. Between intermediate exits and re-entries, <b>all parameters other than</b> <b><a class="arg" href="#YDOT">YDOT</a>, <a class="arg" href="#RWORK">RWORK</a>, <a class="arg" href="#WKJAC">WKJAC</a>, <a class="arg" href="#IMON">IMON</a>, <a class="arg" href="#INLN">INLN</a> and <a class="arg" href="#IRES">IRES</a> must remain unchanged</b>.</div><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 initial entry</i>: 


the number of differential 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="LDYSAV" id="LDYSAV"/>2: &#160;&#160;&#8194; LDYSAV &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: 


an upper bound on the maximum number of differential equations to be solved during the integration.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDYSAV"><m:mi mathcolor="#EE0000" mathvariant="bold">LDYSAV</m:mi></m:maction><m:mo>&#8805;</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>.
</div></dd><dt class="paramhead"><a name="T" id="T"/>3: &#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>: <m:math><m:mi>t</m:mi></m:math>, the value of the independent variable. The input value of <a class="arg" href="#T">T</a> is used only on the first call as the initial point of the integration.</div><div class="paramtext"><i>On final exit</i>: the value 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"/>4: &#160;&#160;&#8194; TOUT &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: 
the next value of <m:math><m:mi>t</m:mi></m:math>&#160;at which a computed solution is desired. For the initial <m:math><m:mi>t</m:mi></m:math>, the input value of <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"/>5: &#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 values of the dependent variables (solution). On the first call the first <a class="arg" href="#NEQ">NEQ</a> elements of <m:math><m:mi>y</m:mi></m:math>&#160;must contain the vector of initial values.</div><div class="paramtext"><i>On final exit</i>: the computed solution vector evaluated at <a class="arg" href="#T">T</a> (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"/>6: &#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 intermediate re-entry</i>: must be set to the derivatives as defined under the description of <a class="arg" href="#IREVCM">IREVCM</a>.</div>
<div class="paramtext"><i>On final exit</i>: the time derivatives <m:math><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></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="RWORK" id="RWORK"/>7: &#160;&#160;&#8194; RWORK(<m:math><m:mn>50</m:mn><m:mo>+</m:mo><m:mn>4</m:mn><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>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Communication Array</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: must be the same array as used by one of the method setup routines <a class="rout" href="../D02/d02mvf.xml">D02MVF</a>, <a class="rout" href="../D02/d02nvf.xml">D02NVF</a> or <a class="rout" href="../D02/d02nwf.xml">D02NWF</a>, and by one of the storage setup routines <a class="rout" href="../D02/d02ntf.xml">D02NTF</a>, <a class="rout" href="../D02/d02nuf.xml">D02NUF</a> or <a class="rout" href="../D02/d02nvf.xml">D02NVF</a>. The contents of <a class="arg" href="#RWORK">RWORK</a> must not be changed between any call to a setup routine and the first call to D02NMF.</div>
<div class="paramtext"><i>On intermediate re-entry</i>: elements of <a class="arg" href="#RWORK">RWORK</a> must be set to quantities as defined under the description of <a class="arg" href="#IREVCM">IREVCM</a>.</div>
<div class="paramtext"><i>On intermediate exit</i>:
contains information for JAC, FCN and MONITR operations as described in <a class="sec" href="#description">Section 3</a> and the parameter <a class="arg" href="#IREVCM">IREVCM</a>.</div></dd><dt class="paramhead"><a name="RTOL" id="RTOL"/>8: &#160;&#160;&#8194; RTOL(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#RTOL">RTOL</a>
must be at least
<m:math><m:mn>1</m:mn></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math>, and 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;otherwise.</div><div class="paramtext"><i>On initial 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>&#160;for all relevant <m:math><m:mi>i</m:mi></m:math>&#160;(see <a class="arg" href="#ITOL">ITOL</a>)</div></dd><dt class="paramhead"><a name="ATOL" id="ATOL"/>9: &#160;&#160;&#8194; ATOL(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#ATOL">ATOL</a>
must be at least
<m:math><m:mn>1</m:mn></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>, and 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;otherwise.</div>
<div class="paramtext"><i>On initial 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>&#160;for all relevant <m:math><m:mi>i</m:mi></m:math>&#160;(see <a class="arg" href="#ITOL">ITOL</a>)</div></dd><dt class="paramhead"><a name="ITOL" id="ITOL"/>10: &#8194; ITOL &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: a value to indicate the form of the local error test. <a class="arg" href="#ITOL">ITOL</a> indicates to D02NMF whether to interpret either or both of <a class="arg" href="#RTOL">RTOL</a> or <a class="arg" href="#ATOL">ATOL</a> as a vector or a scalar. The error test to be satisfied is <m:math><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:msub><m:mi>e</m:mi><m:mi>i</m:mi></m:msub><m:mo>/</m:mo><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>&lt;</m:mo><m:mn>1.0</m:mn></m:math>, where <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;is defined as follows:

<div class="tablediv"><table class="frame-none"><tbody>
<tr>
<td class="libdoc" valign="top" align="center"><a class="arg" href="#ITOL">ITOL</a></td>
<td class="libdoc" valign="top" align="left"><a class="arg" href="#RTOL">RTOL</a></td>
<td class="libdoc" valign="top" align="left"><a class="arg" href="#ATOL">ATOL</a></td>
<td class="libdoc" valign="top" align="center"><m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math></td>
</tr><tr>
<td class="libdoc" valign="top" align="center">1</td>
<td class="libdoc" valign="top" align="left">scalar</td>
<td class="libdoc" valign="top" align="left">scalar</td>
<td class="libdoc" valign="top" align="left"><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:mn>1</m:mn></m:mfenced></m:mrow><m:mo>&#215;</m:mo><m:mfenced open="|" close="|" separators=""><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>+</m:mo><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></td>
</tr><tr>
<td class="libdoc" valign="top" align="center">2</td>
<td class="libdoc" valign="top" align="left">scalar</td>
<td class="libdoc" valign="top" align="left">vector</td>
<td class="libdoc" valign="top" align="left"><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:mn>1</m:mn></m:mfenced></m:mrow><m:mo>&#215;</m:mo><m:mfenced open="|" close="|" separators=""><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>+</m:mo><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:math></td>
</tr><tr>
<td class="libdoc" valign="top" align="center">3</td>
<td class="libdoc" valign="top" align="left">vector</td>
<td class="libdoc" valign="top" align="left">scalar</td>
<td class="libdoc" valign="top" align="left"><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>&#215;</m:mo><m:mfenced open="|" close="|" separators=""><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>+</m:mo><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></td>
</tr><tr>
<td class="libdoc" valign="top" align="center">4</td>
<td class="libdoc" valign="top" align="left">vector</td>
<td class="libdoc" valign="top" align="left">vector</td>
<td class="libdoc" valign="top" align="left"><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>&#215;</m:mo><m:mfenced open="|" close="|" separators=""><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>+</m:mo><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:math></td>
</tr>
</tbody>
</table></div><div class="paramtext"><m:math><m:msub><m:mi>e</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;is an estimate of the local error in <m:math><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:math>, computed internally, and the choice of norm to be used is defined by a previous call to an integrator setup routine.</div>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>&#160;or <m:math><m:mn>4</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="INFORM" id="INFORM"/>11: &#8194; INFORM(<m:math><m:mn>23</m:mn></m:math>) &#8211; INTEGER array<span class="pclass">Communication Array</span></dt><dt class="paramhead"><a name="YSAV" id="YSAV"/>12: &#8194; YSAV(<a class="arg" href="#LDYSAV">LDYSAV</a>,<a class="arg" href="#SDYSAV">SDYSAV</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Communication Array</span></dt><dt class="multi-paramhead"><a name="SDYSAV" id="SDYSAV"/>13: &#8194; SDYSAV &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: the second dimension of the array <a class="arg" href="#YSAV">YSAV</a> as declared in the (sub)program from which D02NMF is called. An appropriate value for <a class="arg" href="#SDYSAV">SDYSAV</a> is described in the specifications of the integrator setup routines <a class="rout" href="../D02/d02nvf.xml">D02NVF</a> and <a class="rout" href="../D02/d02nwf.xml">D02NWF</a>. This value must be the same as that supplied to the integrator setup routine.</div></dd><dt class="paramhead"><a name="WKJAC" id="WKJAC"/>14: &#8194; WKJAC(<a class="arg" href="#NWKJAC">NWKJAC</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On intermediate re-entry</i>: elements of the Jacobian as defined under the description of <a class="arg" href="#IREVCM">IREVCM</a>. If a numerical Jacobian was requested then <a class="arg" href="#WKJAC">WKJAC</a> is used for workspace.</div><div class="paramtext"><i>On intermediate exit</i>:
the Jacobian is overwritten.</div></dd><dt class="paramhead"><a name="NWKJAC" id="NWKJAC"/>15: &#8194; NWKJAC &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: the dimension of the array <a class="arg" href="#WKJAC">WKJAC</a> as declared in the (sub)program from which D02NMF is called. The actual size depends on the linear algebra method used. An appropriate value for <a class="arg" href="#NWKJAC">NWKJAC</a> is described in the specifications of the linear algebra setup routines <a class="rout" href="../D02/d02nsf.xml">D02NSF</a>, <a class="rout" href="../D02/d02ntf.xml">D02NTF</a> and <a class="rout" href="../D02/d02nuf.xml">D02NUF</a> for full, banded and sparse matrix linear algebra respectively. This value must be the same as that supplied to the linear algebra setup routine.</div></dd><dt class="paramhead"><a name="JACPVT" id="JACPVT"/>16: &#8194; JACPVT(<a class="arg" href="#NJCPVT">NJCPVT</a>) &#8211; INTEGER array<span class="pclass">Communication Array</span></dt><dt class="multi-paramhead"><a name="NJCPVT" id="NJCPVT"/>17: &#8194; NJCPVT &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: the dimension of the array <a class="arg" href="#JACPVT">JACPVT</a> as declared in the (sub)program from which D02NMF is called. The actual size depends on the linear algebra method used. An appropriate value for <a class="arg" href="#NJCPVT">NJCPVT</a> is described in the specifications of the linear algebra setup routines <a class="rout" href="../D02/d02ntf.xml">D02NTF</a> and <a class="rout" href="../D02/d02nuf.xml">D02NUF</a> for banded and sparse matrix linear algebra respectively. This value must be the same as that supplied to the linear algebra setup routine. When full matrix linear algebra is chosen, the array <a class="arg" href="#JACPVT">JACPVT</a> is not used and hence <a class="arg" href="#NJCPVT">NJCPVT</a> should be set to <m:math><m:mn>1</m:mn></m:math>.</div></dd><dt class="paramhead"><a name="IMON" id="IMON"/>18: &#8194; IMON &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On intermediate exit</i>:
used to pass information between D02NMF and the MONITR operation (see <a class="sec" href="#description">Section 3</a>). With <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>9</m:mn></m:math>, <a class="arg" href="#IMON">IMON</a> contains a flag indicating under what circumstances the return from D02NMF occurred: 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:math></dt>
<dd>Exit from D02NMF after <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn></m:math>&#160;caused an early termination (this facility could be used to locate discontinuities).</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math></dt>
<dd>The current step failed repeatedly.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>Exit from D02NMF after a call to the internal nonlinear equation solver.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>The current step was successful.</dd></dl>
</div>
<div class="paramtext"><i>On intermediate re-entry</i>: may be reset to determine subsequent action in D02NMF. 
<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:math></dt>
<dd>Integration is to be halted. A return will be made from D02NMF to the calling (sub)program 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="#IFeq12"><m:mn mathcolor="#003399" mathvariant="bold">12</m:mn></m:maction></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math></dt>
<dd>Allow D02NMF to continue with its own internal strategy. The integrator will try up to three restarts unless <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>&#8800;</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>Return to the internal nonlinear equation solver, where the action taken is determined by the value of <a class="arg" href="#INLN">INLN</a>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>Normal exit to D02NMF to continue integration.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>Restart the integration at the current time point. The integrator will restart from order <m:math><m:mn>1</m:mn></m:math>&#160;when this option is used. The solution <a class="arg" href="#Y">Y</a>, provided by the MONITR operation (see <a class="sec" href="#description">Section 3</a>), will be used for the initial conditions.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>Try to continue with the same step size and order as was to be used before entering the MONITR operation (see <a class="sec" href="#description">Section 3</a>). HMIN and HMAX may be altered if desired.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn></m:math></dt>
<dd>Continue the integration but using a new value of HNEXT and possibly new values of HMIN and HMAX.</dd></dl>
</div></dd><dt class="paramhead"><a name="INLN" id="INLN"/>19: &#8194; INLN &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On intermediate re-entry</i>: with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>9</m:mn></m:math>, <a class="arg" href="#INLN">INLN</a> specifies the action to be taken by the internal nonlinear equation solver. By setting <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INLN"><m:mi mathcolor="#EE0000" mathvariant="bold">INLN</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>&#160;and returning to D02NMF, the residual vector is evaluated and placed in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>50</m:mn><m:mo>+</m:mo><m:mn>2</m:mn><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:mi>i</m:mi></m:mrow></m:mfenced></m:mrow></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="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;and then the MONITR operation (see <a class="sec" href="#description">Section 3</a>) is invoked again. At present this is the only option available: <a class="arg" href="#INLN">INLN</a> must not be set to any other value.</div><div class="paramtext"><i>On intermediate exit</i>:
contains a flag indicating the action to be taken, if any, by the internal nonlinear equation solver.</div></dd><dt class="paramhead"><a name="IRES" id="IRES"/>20: &#8194; IRES &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On intermediate exit</i>:
with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>, <m:math><m:mn>4</m:mn></m:math>&#160;or <m:math><m:mn>5</m:mn></m:math>, <a class="arg" href="#IRES">IRES</a> contains the value <m:math><m:mn>1</m:mn></m:math>.</div>
<div class="paramtext"><i>On intermediate re-entry</i>: should be unchanged unless one of the following actions is required of D02NMF in which case <a class="arg" href="#IRES">IRES</a> should be set accordingly. 
<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>Indicates to D02NMF that control should be passed back immediately to the calling (sub)program with the error indicator set to <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="#IFeq11"><m:mn mathcolor="#003399" mathvariant="bold">11</m:mn></m:maction></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>Indicates to D02NMF that an error condition has occurred in the solution vector, its time derivative or in the value of <m:math><m:mi>t</m:mi></m:math>. The integrator will use a smaller time step to try to avoid this condition. If this is not possible D02NMF returns to the calling (sub)program with the error indicator set to <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFeq7"><m:mn mathcolor="#003399" mathvariant="bold">7</m:mn></m:maction></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn></m:math></dt>
<dd>Indicates to D02NMF to stop its current operation and to enter the MONITR operation (see <a class="sec" href="#description">Section 3</a>) immediately.</dd></dl>
</div></dd><dt class="paramhead"><a name="IREVCM" id="IREVCM"/>21: &#8194; IREVCM &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: must contain <m:math><m:mn>0</m:mn></m:math>.</div>
<div class="paramtext"><i>On intermediate re-entry</i>: should remain unchanged.</div>
<div class="paramtext"><i>On intermediate exit</i>:
indicates what action you must take before re-entering. The possible exit values of <a class="arg" href="#IREVCM">IREVCM</a> are <m:math><m:mn>1</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>, <m:math><m:mn>4</m:mn></m:math>, <m:math><m:mn>5</m:mn></m:math>, <m:math><m:mn>8</m:mn></m:math>, <m:math><m:mn>9</m:mn></m:math>&#160;or <m:math><m:mn>10</m:mn></m:math>, which should be interpreted as follows: 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>, <m:math><m:mn>4</m:mn></m:math>&#160;and <m:math><m:mn>5</m:mn></m:math></dt>
<dd>Indicates that an FCN operation (see <a class="sec" href="#description">Section 3</a>) is required: <m:math><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mi>g</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced></m:math>&#160;must be supplied, where <m:math><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>i</m:mi></m:mfenced></m:mrow></m:math>&#160;is located in <m:math><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></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="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.
<div class="paramtext">For <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;or <m:math><m:mn>3</m:mn></m:math>, <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi><m:mo>&#8242;</m:mo></m:msubsup></m:math>&#160;should be placed in location <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>50</m:mn><m:mo>+</m:mo><m:mn>2</m:mn><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:mi>i</m:mi></m:mrow></m:mfenced></m:mrow></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="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.</div>
<div class="paramtext">For <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn></m:math>, <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi><m:mo>&#8242;</m:mo></m:msubsup></m:math>&#160;should be placed in location <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><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:mo>+</m:mo><m:mi>i</m:mi></m:mrow></m:mfenced></m:mrow></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="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.</div>
<div class="paramtext">For <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>5</m:mn></m:math>, <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi><m:mo>&#8242;</m:mo></m:msubsup></m:math>&#160;should be placed in location <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#YDOT"><m:mi mathcolor="#EE0000" mathvariant="bold">YDOT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></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="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.</div></dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>8</m:mn></m:math></dt>
<dd>Indicates that a JAC operation (see <a class="sec" href="#description">Section 3</a>) is required: the Jacobian matrix must be supplied.
<div class="paramtext">If full matrix linear algebra is being used, then 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 Jacobian must be stored in <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WKJAC"><m:mi mathcolor="#EE0000" mathvariant="bold">WKJAC</m:mi></m:maction><m:mfenced separators=""><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="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:mi>i</m:mi></m:mfenced></m:math>.</div>
<div class="paramtext">If banded matrix linear algebra is being used then 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 Jacobian  must be stored in <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WKJAC"><m:mi mathcolor="#EE0000" mathvariant="bold">WKJAC</m:mi></m:maction><m:mfenced separators=""><m:mfenced separators=""><m:mi>i</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced><m:mo>&#215;</m:mo><m:msub><m:mi>m</m:mi><m:mi>B</m:mi></m:msub><m:mo>+</m:mo><m:mi>k</m:mi></m:mfenced></m:math>, where <m:math><m:msub><m:mi>m</m:mi><m:mi>B</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>m</m:mi><m:mi>L</m:mi></m:msub><m:mo>+</m:mo><m:msub><m:mi>m</m:mi><m:mi>U</m:mi></m:msub><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;and   <m:math><m:mi>k</m:mi><m:mo>=</m:mo><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mrow><m:msub><m:mi>m</m:mi><m:mi>L</m:mi></m:msub><m:mo>-</m:mo><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow><m:mo>,</m:mo><m:mn>0</m:mn></m:mfenced></m:mrow><m:mo>+</m:mo><m:mi>j</m:mi></m:math>; here <m:math><m:msub><m:mi>m</m:mi><m:mi>L</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>m</m:mi><m:mi>U</m:mi></m:msub></m:math>&#160;are the number of subdiagonals and superdiagonals, respectively, in the band.</div>
<div class="paramtext">If sparse matrix linear algebra is being used then <a class="rout" href="../D02/d02nrf.xml">D02NRF</a> must be called to determine which column of the Jacobian is required and where it should be stored.</div> 
<pre class="verbatim">
      CALL D02NRF(J, IPLACE, INFORM)
</pre><div class="paramtext">will return in <a class="arg" href="../D02/d02nrf.xml#J">J</a> the number of the column of the Jacobian that is required and will set <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02nrf.xml#IPLACE"><m:mi mathcolor="#EE0000" mathvariant="bold">IPLACE</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;or <m:math><m:mn>2</m:mn></m:math>. If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02nrf.xml#IPLACE"><m:mi mathcolor="#EE0000" mathvariant="bold">IPLACE</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, then 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 Jacobian must be stored in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mn>50</m:mn><m:mo>+</m:mo><m:mn>2</m:mn><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:mi>i</m:mi></m:mrow></m:mfenced></m:mrow></m:math>; otherwise it must be stored in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><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:mo>+</m:mo><m:mi>i</m:mi></m:mrow></m:mfenced></m:mrow></m:math>.</div></dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>9</m:mn></m:math></dt>
<dd>Indicates that a MONITR operation (see <a class="sec" href="#description">Section 3</a>) can be performed.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>10</m:mn></m:math></dt>
<dd>Indicates that the current step was not successful, due to error test failure or convergence test failure. The only information supplied to you on this return is the current value of the independent variable <m:math><m:mi>t</m:mi></m:math>, located in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>19</m:mn></m:mfenced></m:mrow></m:math>. No values must be changed before re-entering D02NMF; this facility enables you to determine the number of unsuccessful steps.</dd></dl>
</div>
<div class="paramtext"><i>On final exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;indicated the user-specified task has been completed or an error has been encountered (see the descriptions for <a class="arg" href="#ITASK">ITASK</a> and <a class="arg" href="#IFAIL">IFAIL</a>).</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IREVCM"><m:mi mathcolor="#EE0000" mathvariant="bold">IREVCM</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, <m:math><m:mn>1</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>, <m:math><m:mn>4</m:mn></m:math>, <m:math><m:mn>5</m:mn></m:math>, <m:math><m:mn>8</m:mn></m:math>, <m:math><m:mn>9</m:mn></m:math>&#160;or <m:math><m:mn>10</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="ITASK" id="ITASK"/>22: &#8194; ITASK &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: the task to be performed by the integrator.

<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>1</m:mn></m:math></dt>
<dd>Normal computation of output values of <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>t</m:mi></m:mfenced></m:math>&#160;at <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>&#160;(by overshooting and interpolating).</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>2</m:mn></m:math></dt>
<dd>Take one step only and return.</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>Stop at the first internal integration point at or beyond <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>&#160;and return.</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>4</m:mn></m:math></dt>
<dd>Normal computation of output values of <m:math><m:mi>y</m:mi><m:mfenced separators=""><m:mi>t</m:mi></m:mfenced></m:math>&#160;at <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>&#160;but without overshooting <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02nvf.xml#TCRIT"><m:mi mathcolor="#EE0000" mathvariant="bold">TCRIT</m:mi></m:maction></m:math>. <a class="arg" href="../D02/d02nvf.xml#TCRIT">TCRIT</a> must be specified as an option in one of the integrator setup routines prior to the first call to the integrator, or specified in the optional input routine prior to a continuation call. <a class="arg" href="../D02/d02nvf.xml#TCRIT">TCRIT</a> (e.g., see <a class="rout" href="../D02/d02nvf.xml">D02NVF</a>) may be equal to or beyond <a class="arg" href="#TOUT">TOUT</a>, but not before it in the direction of integration.</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>5</m:mn></m:math></dt>
<dd>Take one step only and return, without passing <a class="arg" href="../D02/d02nvf.xml#TCRIT">TCRIT</a> (e.g., see <a class="rout" href="../D02/d02nvf.xml">D02NVF</a>). <a class="arg" href="../D02/d02nvf.xml#TCRIT">TCRIT</a> must be specified under <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>4</m:mn></m:math>.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITASK"><m:mi mathcolor="#EE0000" mathvariant="bold">ITASK</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>5</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="ITRACE" id="ITRACE"/>23: &#8194; ITRACE &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On initial entry</i>: the level of output that is printed by the integrator. <a class="arg" href="#ITRACE">ITRACE</a> may take the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>, <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mn>1</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>&#160;or <m:math><m:mn>3</m:mn></m:math>. 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITRACE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITRACE</m:mi></m:maction><m:mo>&lt;</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math></dt>
<dd><m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>&#160;is assumed and similarly if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITRACE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITRACE</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>3</m:mn></m:math>, then <m:math><m:mn>3</m:mn></m:math>&#160;is assumed.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITRACE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITRACE</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math></dt>
<dd>No output is generated.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITRACE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITRACE</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>Only warning messages are printed on the current error message unit (see <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITRACE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITRACE</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>Warning messages are printed as above, and on the current advisory message unit (see <a class="rout" href="../X04/x04abf.xml">X04ABF</a>) output is generated which details Jacobian entries, the nonlinear iteration and the time integration. The advisory messages are given in greater detail the larger the value of <a class="arg" href="#ITRACE">ITRACE</a>.</dd></dl>
</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>24: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On initial 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 final 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">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">On entry, the integrator detected an illegal input, or that a linear algebra and/or integrator setup routine has not been called prior to the call to the integrator.  If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITRACE"><m:mi mathcolor="#EE0000" mathvariant="bold">ITRACE</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>0</m:mn></m:math>, the form of the error will be detailed on the current error message unit (see <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</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">The maximum number of steps specified has been taken (see the description of optional inputs in the integrator setup routines and the optional input continuation routine, <a class="rout" href="../D02/d02nzf.xml">D02NZF</a>).</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">With the given values of <a class="arg" href="#RTOL">RTOL</a> and <a class="arg" href="#ATOL">ATOL</a> no further progress can be made across the integration range from the current point <a class="arg" href="#T">T</a>. The components <m:math><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:mn>1</m:mn></m:mfenced></m:mrow><m:mo>,</m:mo><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: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="#Y"><m:mi mathcolor="#EE0000" mathvariant="bold">Y</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:mfenced></m:mrow></m:math>&#160;contain the computed values of the solution at the current point <a class="arg" href="#T">T</a>.</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">There were repeated error test failures on an attempted step, before completing the requested task, but the integration was successful as far as <a class="arg" href="#T">T</a>. The problem may have a singularity, or the local error requirements may be inappropriate.</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 were repeated convergence test failures on an attempted step, before completing the requested task, but the integration was successful as far as <a class="arg" href="#T">T</a>. This may be caused by an inaccurate Jacobian matrix or one which is incorrectly computed.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq6" id="IFeq6"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>6</m:mn></m:math></dt>
<dd>
<div class="paramtext">Some error weight <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;became zero during the integration (see the description of <a class="arg" href="#ITOL">ITOL</a>).  Pure relative error control <m:math><m:mfenced separators=""><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>=</m:mo><m:mn>0.0</m:mn></m:mfenced></m:math>&#160;was requested on a variable (the <m:math><m:mi>i</m:mi></m:math>th) which has now vanished.  The integration was successful as far as <a class="arg" href="#T">T</a>.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq7" id="IFeq7"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>7</m:mn></m:math></dt>
<dd>
<div class="paramtext">The FCN operation (see <a class="sec" href="#description">Section 3</a>) set the error flag <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>&#160;continually despite repeated attempts by the integrator to avoid this.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq8" id="IFeq8"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>8</m:mn></m:math></dt>
<dd>
<div class="paramtext">Not used for this integrator.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq9" id="IFeq9"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>9</m:mn></m:math></dt>
<dd>
<div class="paramtext">A singular Jacobian <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>r</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>y</m:mi></m:mrow>
 </m:mfrac>
</m:math>&#160;has been encountered. This error exit is unlikely to be taken when solving explicit ordinary differential equations. You should check the problem formulation and Jacobian calculation.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq10" id="IFeq10"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>10</m:mn></m:math></dt>
<dd>
<div class="paramtext">An error occurred during Jacobian formulation or back-substitution (a more detailed error description may be directed to the current error message unit, see <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq11" id="IFeq11"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>11</m:mn></m:math></dt>
<dd>
<div class="paramtext">The FCN operation (see <a class="sec" href="#description">Section 3</a>) signalled the integrator to halt the integration and return by setting <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math>.  Integration was successful as far as <a class="arg" href="#T">T</a>.</div>
</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">The MONITR operation (see <a class="sec" href="#description">Section 3</a>) set <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:math>&#160;and so forced a return but the integration was successful as far as <a class="arg" href="#T">T</a>.</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>
<div class="paramtext">The requested task has been completed, but it is estimated that a small change in <a class="arg" href="#RTOL">RTOL</a> and <a class="arg" href="#ATOL">ATOL</a> is unlikely to produce any change in the computed solution. (Only applies when you are not operating in one step mode, that is when <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>&#8800;</m:mo><m:mn>2</m:mn></m:math>&#160;or <m:math><m:mn>5</m:mn></m:math>.)</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq14" id="IFeq14"/><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>14</m:mn></m:math></dt>
<dd>
<div class="paramtext">The values of <a class="arg" href="#RTOL">RTOL</a> and <a class="arg" href="#ATOL">ATOL</a> are so small that D02NMF is unable to start the integration.</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>, and to a much lesser extent by the choice of norm.  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="#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</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; also on the type of linear algebra being used.  For further details see <a class="sec" href="#fcomments">Section 8</a> of the documents for <a class="rout" href="../D02/d02nbf.xml">D02NBF</a> (full matrix), <a class="rout" href="../D02/d02ncf.xml">D02NCF</a> (banded matrix) or <a class="rout" href="../D02/d02ndf.xml">D02NDF</a> (sparse matrix).</div><div class="paramtext">In general, you are advised to choose the backward differentiation formula option (setup routine <a class="rout" href="../D02/d02nvf.xml">D02NVF</a>) but if efficiency is of great importance and especially if it is suspected that <m:math>
 <m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>g</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>y</m:mi></m:mrow>
 </m:mfrac>
</m:math>&#160;has complex eigenvalues near the imaginary axis for some part of the integration, you should try the BLEND option (setup routine <a class="rout" href="../D02/d02nwf.xml">D02NWF</a>).</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example solves the well-known stiff Robertson problem

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable>
 <m:mtr>
  <m:mtd><m:msup><m:mi>a</m:mi><m:mo>&#8242;</m:mo></m:msup></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:mo>+</m:mo><m:mtext>1.0D4</m:mtext><m:mi>b</m:mi><m:mi>c</m:mi><m:mphantom><m:mo>-</m:mo><m:mtext>3.0D7</m:mtext><m:mo>&#8290;</m:mo><m:msup><m:mi>b</m:mi><m:mn>2</m:mn></m:msup></m:mphantom></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:msup><m:mi>b</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mtd>
  <m:mtd><m:mo>=</m:mo></m:mtd>
  <m:mtd><m:mphantom><m:mo>-</m:mo></m:mphantom><m:mn>0.04</m:mn><m:mi>a</m:mi><m:mo>-</m:mo><m:mtext>1.0D4</m:mtext><m:mi>b</m:mi><m:mi>c</m:mi><m:mo>-</m:mo><m:mtext>3.0D7</m:mtext><m:mo>&#8290;</m:mo><m:msup><m:mi>b</m:mi><m:mn>2</m:mn></m:msup></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd><m:msup><m:mi>c</m:mi><m:mo>&#8242;</m:mo></m:msup></m:mtd>
  <m:mtd><m:mo>=</m:mo></m:mtd>
  <m:mtd><m:mphantom><m:mo>-</m:mo><m:mn>0.04</m:mn><m:mi>a</m:mi><m:mo>-</m:mo><m:mtext>1.0D4</m:mtext><m:mi>b</m:mi><m:mi>c</m:mi><m:mo>-</m:mo></m:mphantom><m:mtext>3.0D7</m:mtext><m:mo>&#8290;</m:mo><m:msup><m:mi>b</m:mi><m:mn>2</m:mn></m:msup></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

over the range <m:math><m:mfenced separators="" open="[" close="]"><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>10</m:mn></m:mfenced></m:math>&#160;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;and with scalar error control (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITOL"><m:mi mathcolor="#EE0000" mathvariant="bold">ITOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>).  The integration proceeds until <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:mn>10.0</m:mn></m:math>&#160;is passed, providing <m:math><m:msup><m:mi>C</m:mi><m:mn>1</m:mn></m:msup></m:math>&#160;interpolation at intervals of <m:math><m:mn>2.0</m:mn></m:math>&#160;through a MONITR operation.  The integration method used is the BDF method (setup routine <a class="rout" href="../D02/d02nvf.xml">D02NVF</a>) with a modified Newton method.  The Jacobian is a full matrix, which is specified using the setup routine <a class="rout" href="../D02/d02nsf.xml">D02NSF</a>; this Jacobian is to be calculated numerically.</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/d02nmfe.f">Program Text (d02nmfe.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/d02nmfe.r">Program Results (d02nmfe.r)</a></p><div class="figure"><a name="d02nmf-plot" id="d02nmf-plot"/><img src="../figures/d02nmf-plot.png" alt="Example Program Plot for d02nmf-plot"/></div>
<hr/><div><a class="rout" href="../../pdf/D02/d02nmf.pdf">D02NMF (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>
