<?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>D02NDF : 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/d02ndf.pdf">D02NDF (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/>D02NDF</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">D02NDF is a forward communication routine for integrating stiff systems of explicit ordinary differential equations when the Jacobian is a sparse matrix.</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;D02NDF&#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="#FCN">FCN</a>, <a class="arg" href="#YSAV">YSAV</a>, <a class="arg" href="#SDYSAV">SDYSAV</a>, <a class="arg" href="#JAC">JAC</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="#MONITR">MONITR</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, 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><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">FCN, JAC, MONITR</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D02NDF 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>

It is designed specifically for the case where the Jacobian <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;is a sparse matrix.</div><div class="paramtext">Both interval and step oriented modes of operation are available and also modes designed to permit intermediate output within an interval oriented mode.</div><div class="paramtext">An outline of a typical calling program for D02NDF is given below.  It calls the sparse matrix linear algebra setup routine <a class="rout" href="../D02/d02nuf.xml">D02NUF</a>, the Backward Differentiation Formula (BDF) integrator setup routine <a class="rout" href="../D02/d02nvf.xml">D02NVF</a>, its diagnostic counterpart <a class="rout" href="../D02/d02nyf.xml">D02NYF</a>, and the sparse linear algebra diagnostic routine <a class="rout" href="../D02/d02nxf.xml">D02NXF</a>.
<pre class="verbatim">
C
C     declarations
C
      EXTERNAL FCN, JAC, MONITR
          .
          .
          .
      IFAIL = 0
      CALL D02NVF(...,IFAIL)
      CALL D02NUF(NEQ, NEQMAX, JCEVAL, NWKJAC, IA, NIA, JA, NJA,
     + JACPVT, NJCPVT, SENS, U, ETA, LBLOCK, ISPLIT, RWORK,
     + IFAIL)
      IFAIL = -1
      CALL D02NDF(NEQ, NEQMAX, T, TOUT, Y, YDOT, RWORK, RTOL,
     + ATOL, ITOL, INFORM, FCN, YSAVE, NY2DIM, JAC, WKJAC,
     + NWKJAC, JACPVT, NJCPVT, MONITR, ITASK, ITRACE, IFAIL)
      IF(IFAIL.EQ.1 .OR. IFAIL.GE.14) STOP
      IFAIL = 0
      CALL D02NXF(...)
      CALL D02NYF(...)
          .
          .
          .
      STOP
      END
</pre>

The linear algebra setup routine <a class="rout" href="../D02/d02nuf.xml">D02NUF</a> and one of the integrator setup routines, <a class="rout" href="../D02/d02nvf.xml">D02NVF</a> or <a class="rout" href="../D02/d02nwf.xml">D02NWF</a>,  must be called prior to the call of D02NDF.  Either or both of the integrator diagnostic routine <a class="rout" href="../D02/d02nyf.xml">D02NYF</a>, or the sparse matrix linear algebra diagnostic routine <a class="rout" href="../D02/d02nxf.xml">D02NXF</a>, may be called after the call to D02NDF.  There is also a routine, <a class="rout" href="../D02/d02nzf.xml">D02NZF</a>, designed to permit you to change step size on a continuation call to D02NDF without restarting the integration process.</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>
<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 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 entry</i>: 


a 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 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 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 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 entry</i>: the values of the dependent variables (solution). On the first call the first <a class="arg" href="#NEQ">NEQ</a> elements of <a class="arg" href="#Y">Y</a> must contain the vector of initial values.</div>
<div class="paramtext"><i>On exit</i>: the computed solution vector, evaluated at <a class="arg" href="#T">T</a> (usually <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>).</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">Output</span></dt><dd>
<div class="paramtext"><i>On 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><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 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 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 entry</i>: a value to indicate the form of the local error test. <a class="arg" href="#ITOL">ITOL</a> indicates to D02NDF 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="FCN" id="FCN"/>12: &#8194; FCN &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#FCN">FCN</a> must evaluate the derivative vector for the explicit ordinary differential equation system, defined by <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>.</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#FCN">FCN</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;FCN&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02ndf.xml#FCN_NEQ">NEQ</a>, <a class="arg" href="../D02/d02ndf.xml#FCN_T">T</a>, <a class="arg" href="../D02/d02ndf.xml#FCN_Y">Y</a>, <a class="arg" href="../D02/d02ndf.xml#FCN_F">F</a>, <a class="arg" href="../D02/d02ndf.xml#FCN_IRES">IRES</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, IRES</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, Y(NEQ), F(NEQ)</td></tr></table>
<dl><dt class="paramhead"><a name="FCN_NEQ" id="FCN_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 equations being solved.</div></dd><dt class="paramhead"><a name="FCN_T" id="FCN_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="FCN_Y" id="FCN_Y"/>3: &#160;&#160;&#8194; Y(<a class="arg" href="../D02/d02ndf.xml#FCN_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 value of <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="#FCN_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.</div></dd><dt class="paramhead"><a name="FCN_F" id="FCN_F"/>4: &#160;&#160;&#8194; F(<a class="arg" href="../D02/d02ndf.xml#FCN_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>: the value <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi><m:mo>&#8242;</m:mo></m:msubsup></m:math>, given by <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi><m:mo>&#8242;</m:mo></m:msubsup><m:mo>=</m:mo><m:msub><m:mi>g</m:mi><m:mi>i</m:mi></m:msub><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#FCN_NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.</div></dd><dt class="paramhead"><a name="FCN_IRES" id="FCN_IRES"/>5: &#160;&#160;&#8194; IRES &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#FCN_IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>.</div>
<div class="paramtext"><i>On exit</i>: you may set <a class="arg" href="../D02/d02ndf.xml#FCN_IRES">IRES</a> as follows to indicate certain conditions in <a class="arg" href="#FCN">FCN</a> to the integrator: 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#FCN_IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>Indicates a normal return from <a class="arg" href="#FCN">FCN</a>, that is <a class="arg" href="../D02/d02ndf.xml#FCN_IRES">IRES</a> has not been altered by you and integration continues.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#FCN_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 the integrator 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="#FCN_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 the integrator 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 the integrator 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="#FCN_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 the integrator to stop its current operation and to enter <a class="arg" href="#MONITR">MONITR</a> immediately with parameter <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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>.</dd></dl>
</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#FCN">FCN</a> must be declared as EXTERNAL in the (sub)program from which D02NDF 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="YSAV" id="YSAV"/>13: &#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"/>14: &#8194; SDYSAV &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the second dimension of the array <a class="arg" href="#YSAV">YSAV</a> as declared in the (sub)program from which D02NDF is called. An appropriate value for <a class="arg" href="#SDYSAV">SDYSAV</a> is described in the specification 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="JAC" id="JAC"/>15: &#8194; JAC &#8211; SUBROUTINE, supplied by the NAG Library or the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#JAC">JAC</a> must evaluate the Jacobian of the system. If this option is not required, the actual argument for <a class="arg" href="#JAC">JAC</a> must be the dummy routine D02NDZ.  (D02NDZ 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/d02nuf.xml#JCEVAL">JCEVAL</a> appropriately in a call to the sparse linear algebra setup routine <a class="rout" href="../D02/d02nuf.xml">D02NUF</a>.</div>
<div class="paramtext">First 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>, generated internally, 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:mfenced separators=""><m:mi>h</m:mi><m:mi>d</m:mi></m:mfenced>
 <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>. 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 it 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 <m:math><m:mi>r</m:mi></m:math>&#160;is the function 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 in <a class="arg" href="#JAC">JAC</a> as follows: 

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> 
 <m:mtable columnalign="left"> 
  <m:mtr> 
   <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:mtext>,</m:mtext>
   </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: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: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:mtext>,</m:mtext>
   </m:mtd>
   <m:mtd><m:mtext>otherwise.</m:mtext></m:mtd>
  </m:mtr>
 </m:mtable>
</m:math></td><td class="formula2"/></tr></table></div></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/d02ndf.xml#JAC_NEQ">NEQ</a>, <a class="arg" href="../D02/d02ndf.xml#JAC_T">T</a>, <a class="arg" href="../D02/d02ndf.xml#JAC_Y">Y</a>, <a class="arg" href="../D02/d02ndf.xml#JAC_H">H</a>, <a class="arg" href="../D02/d02ndf.xml#JAC_D">D</a>, <a class="arg" href="../D02/d02ndf.xml#JAC_J">J</a>, <a class="arg" href="../D02/d02ndf.xml#JAC_PDJ">PDJ</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, J</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, Y(NEQ), H, D, PDJ(NEQ)</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 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/d02ndf.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_H" id="JAC_H"/>4: &#160;&#160;&#8194; H &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the current step size.</div></dd><dt class="paramhead"><a name="JAC_D" id="JAC_D"/>5: &#160;&#160;&#8194; D &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the parameter <m:math><m:mi>d</m:mi></m:math>&#160;which depends on the integration method.</div></dd><dt class="paramhead"><a name="JAC_J" id="JAC_J"/>6: &#160;&#160;&#8194; J &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the column of the Jacobian that <a class="arg" href="#JAC">JAC</a> must return in the array <a class="arg" href="../D02/d02ndf.xml#JAC_PDJ">PDJ</a>.</div></dd><dt class="paramhead"><a name="JAC_PDJ" id="JAC_PDJ"/>7: &#160;&#160;&#8194; PDJ(<a class="arg" href="../D02/d02ndf.xml#JAC_NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: is set to zero.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#JAC_PDJ"><m:mi mathcolor="#EE0000" mathvariant="bold">PDJ</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;should be set to 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, where <m:math><m:mi>j</m:mi></m:math>&#160;is given by <a class="arg" href="../D02/d02ndf.xml#JAC_J">J</a>. Only nonzero elements of this array need be set, since it is preset to zero before the call 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 D02NDF 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="WKJAC" id="WKJAC"/>16: &#8194; WKJAC(<a class="arg" href="#NWKJAC">NWKJAC</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Communication Array</span></dt><dt class="multi-paramhead"><a name="NWKJAC" id="NWKJAC"/>17: &#8194; NWKJAC &#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="#WKJAC">WKJAC</a> as declared in the (sub)program from which D02NDF is called. The actual size depends on whether the sparsity structure is supplied or whether it is to be estimated. An appropriate value for <a class="arg" href="#NWKJAC">NWKJAC</a> is described in the specification of the linear algebra setup routine <a class="rout" href="../D02/d02nuf.xml">D02NUF</a>. This value must be the same as that supplied to <a class="rout" href="../D02/d02nuf.xml">D02NUF</a>.</div></dd><dt class="paramhead"><a name="JACPVT" id="JACPVT"/>18: &#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"/>19: &#8194; NJCPVT &#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="#JACPVT">JACPVT</a> as declared in the (sub)program from which D02NDF is called. The actual size depends on whether the sparsity structure is supplied or whether it is to be estimated. An appropriate value for <a class="arg" href="#NJCPVT">NJCPVT</a> is described in the specification of the linear algebra setup routine <a class="rout" href="../D02/d02nuf.xml">D02NUF</a>. This value must be the same as that supplied to <a class="rout" href="../D02/d02nuf.xml">D02NUF</a>.</div></dd><dt class="paramhead"><a name="MONITR" id="MONITR"/>20: &#8194; MONITR &#8211; SUBROUTINE, supplied by the NAG Library or the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#MONITR">MONITR</a> performs tasks requested by you. If this option is not required, then the actual argument for <a class="arg" href="#MONITR">MONITR</a> must be the dummy routine D02NBY. (D02NBY is included in the NAG Library.)</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#MONITR">MONITR</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;MONITR&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02ndf.xml#MONITR_NEQ">NEQ</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_LDYSAV">LDYSAV</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_T">T</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_HLAST">HLAST</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_HNEXT">HNEXT</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_Y">Y</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_YDOT">YDOT</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_YSAV">YSAV</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_R">R</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_ACOR">ACOR</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_IMON">IMON</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_INLN">INLN</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_HMIN">HMIN</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_HMAX">HMAX</a>, <a class="arg" href="../D02/d02ndf.xml#MONITR_NQU">NQU</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, LDYSAV, IMON, INLN, NQU</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, HLAST, HNEXT, Y(NEQ), YDOT(NEQ), YSAV(LDYSAV,<m:math><m:mi mathvariant="italic">sdysav</m:mi></m:math>), R(NEQ), ACOR(NEQ,2), HMIN, HMAX</td></tr></table>
<div class="paramtext">where <m:math><m:mi mathvariant="italic">sdysav</m:mi></m:math>&#160;is the numerical value of <a class="arg" href="#SDYSAV">SDYSAV</a> in the call of D02NDF.</div>
<dl><dt class="paramhead"><a name="MONITR_NEQ" id="MONITR_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 equations being solved.</div></dd><dt class="paramhead"><a name="MONITR_LDYSAV" id="MONITR_LDYSAV"/>2: &#160;&#160;&#8194; LDYSAV &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: an upper bound on the number of differential equations to be solved.</div></dd><dt class="paramhead"><a name="MONITR_T" id="MONITR_T"/>3: &#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>: the current value of the independent variable.</div></dd><dt class="paramhead"><a name="MONITR_HLAST" id="MONITR_HLAST"/>4: &#160;&#160;&#8194; HLAST &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the last step size successfully used by the integrator.</div></dd><dt class="paramhead"><a name="MONITR_HNEXT" id="MONITR_HNEXT"/>5: &#160;&#160;&#8194; HNEXT &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the step size that the integrator proposes to take on the next step.</div><div class="paramtext"><i>On exit</i>: the next step size to be used. If this is different from the input value, then <a class="arg" href="../D02/d02ndf.xml#MONITR_IMON">IMON</a> must be set to <m:math><m:mn>4</m:mn></m:math>.</div></dd><dt class="paramhead"><a name="MONITR_Y" id="MONITR_Y"/>6: &#160;&#160;&#8194; Y(<a class="arg" href="../D02/d02ndf.xml#MONITR_NEQ">NEQ</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <m:math><m:mi>y</m:mi></m:math>, the values of the dependent variables evaluated at <m:math><m:mi>t</m:mi></m:math>.</div><div class="paramtext"><i>On exit</i>: these values must not be changed unless <a class="arg" href="../D02/d02ndf.xml#MONITR_IMON">IMON</a> is set to <m:math><m:mn>2</m:mn></m:math>.</div></dd><dt class="paramhead"><a name="MONITR_YDOT" id="MONITR_YDOT"/>7: &#160;&#160;&#8194; YDOT(<a class="arg" href="../D02/d02ndf.xml#MONITR_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 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>.</div></dd><dt class="paramhead"><a name="MONITR_YSAV" id="MONITR_YSAV"/>8: &#160;&#160;&#8194; YSAV(<a class="arg" href="../D02/d02ndf.xml#MONITR_LDYSAV">LDYSAV</a>,<m:math><m:mi mathvariant="italic">sdysav</m:mi></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: workspace to enable you to carry out interpolation using either of the routines <a class="rout" href="../D02/d02xjf.xml">D02XJF</a> or <a class="rout" href="../D02/d02xkf.xml">D02XKF</a>.</div></dd><dt class="paramhead"><a name="MONITR_R" id="MONITR_R"/>9: &#160;&#160;&#8194; R(<a class="arg" href="../D02/d02ndf.xml#MONITR_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>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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="#MONITR_INLN"><m:mi mathcolor="#EE0000" mathvariant="bold">INLN</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>, the first <a class="arg" href="../D02/d02ndf.xml#MONITR_NEQ">NEQ</a> elements contain the residual vector, <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>.</div></dd><dt class="paramhead"><a name="MONITR_ACOR" id="MONITR_ACOR"/>10: &#8194; ACOR(<a class="arg" href="../D02/d02ndf.xml#MONITR_NEQ">NEQ</a>,<m:math><m:mn>2</m:mn></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_ACOR"><m:mi mathcolor="#EE0000" mathvariant="bold">ACOR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;contains the weight used for the <m:math><m:mi>i</m:mi></m:math>th equation when the norm is evaluated, and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_ACOR"><m:mi mathcolor="#EE0000" mathvariant="bold">ACOR</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;contains the estimated local error for the <m:math><m:mi>i</m:mi></m:math>th equation. The scaled local error at the end of a timestep may be obtained by calling the <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, ACOR(1,2), ACOR(1,1), IFAIL)
C     CHECK IFAIL BEFORE PROCEEDING
</pre></div></dd><dt class="paramhead"><a name="MONITR_IMON" id="MONITR_IMON"/>11: &#8194; IMON &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: a flag indicating under what circumstances <a class="arg" href="#MONITR">MONITR</a> was called: 
<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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>Entry from the integrator after <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#FCN_IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn></m:math>&#160;(set in <a class="arg" href="#FCN">FCN</a>) 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="#MONITR_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="#MONITR_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>Entry after a call to the internal nonlinear equation solver (see <a class="arg" href="../D02/d02ndf.xml#MONITR_INLN">INLN</a>).</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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 exit</i>: may be reset to determine subsequent action in D02NDF. 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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 the integrator 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="#MONITR_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 the integrator to continue with its own internal strategy. The integrator will try up to three restarts unless <a class="arg" href="../D02/d02ndf.xml#MONITR_IMON">IMON</a> is set <m:math><m:mtext/><m:mo>&#8800;</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>&#160;on exit.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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="../D02/d02ndf.xml#MONITR_INLN">INLN</a> (see <a class="arg" href="../D02/d02ndf.xml#MONITR_INLN">INLN</a>).</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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 the integrator to continue integration.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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="../D02/d02ndf.xml#MONITR_Y">Y</a>, provided by <a class="arg" href="#MONITR">MONITR</a>, will be used for the initial conditions.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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 the call to <a class="arg" href="#MONITR">MONITR</a>. <a class="arg" href="../D02/d02ndf.xml#MONITR_HMIN">HMIN</a> and <a class="arg" href="../D02/d02ndf.xml#MONITR_HMAX">HMAX</a> may be altered if desired.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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 <a class="arg" href="../D02/d02ndf.xml#MONITR_HNEXT">HNEXT</a> and possibly new values of <a class="arg" href="../D02/d02ndf.xml#MONITR_HMIN">HMIN</a> and <a class="arg" href="../D02/d02ndf.xml#MONITR_HMAX">HMAX</a>.</dd></dl>
</div></dd><dt class="paramhead"><a name="MONITR_INLN" id="MONITR_INLN"/>12: &#8194; INLN &#8211; INTEGER<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the action to be taken by the internal nonlinear equation solver when <a class="arg" href="#MONITR">MONITR</a> is exited with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_IMON"><m:mi mathcolor="#EE0000" mathvariant="bold">IMON</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>. By setting <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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 the integrator, the residual vector is evaluated and placed in the array <a class="arg" href="../D02/d02ndf.xml#MONITR_R">R</a>, and then <a class="arg" href="#MONITR">MONITR</a> is called again. At present this is the only option available: <a class="arg" href="../D02/d02ndf.xml#MONITR_INLN">INLN</a> must not be set to any other value.</div></dd><dt class="paramhead"><a name="MONITR_HMIN" id="MONITR_HMIN"/>13: &#8194; HMIN &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the minimum step size to be taken on the next step.</div><div class="paramtext"><i>On exit</i>: the minimum step size to be used. If this is different from the input value, then <a class="arg" href="../D02/d02ndf.xml#MONITR_IMON">IMON</a> must be set to <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="MONITR_HMAX" id="MONITR_HMAX"/>14: &#8194; HMAX &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the maximum step size to be taken on the next step.</div><div class="paramtext"><i>On exit</i>: the maximum step size to be used. If this is different from the input value, then <a class="arg" href="../D02/d02ndf.xml#MONITR_IMON">IMON</a> must be set to <m:math><m:mn>3</m:mn></m:math>&#160;or <m:math><m:mn>4</m:mn></m:math>. If <a class="arg" href="../D02/d02ndf.xml#MONITR_HMAX">HMAX</a> is set to zero, no limit is assumed.</div></dd><dt class="paramhead"><a name="MONITR_NQU" id="MONITR_NQU"/>15: &#8194; NQU &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the order of the integrator used on the last step. This is supplied to enable you to carry out interpolation using either of the routines <a class="rout" href="../D02/d02xjf.xml">D02XJF</a> or <a class="rout" href="../D02/d02xkf.xml">D02XKF</a>.</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#MONITR">MONITR</a> must be declared as EXTERNAL in the (sub)program from which D02NDF 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="ITASK" id="ITASK"/>21: &#8194; ITASK &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On 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/d02mvf.xml#TCRIT"><m:mi mathcolor="#EE0000" mathvariant="bold">TCRIT</m:mi></m:maction></m:math>&#160;(e.g., see <a class="rout" href="../D02/d02mvf.xml">D02MVF</a>). <a class="arg" href="../D02/d02mvf.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/d02mvf.xml#TCRIT">TCRIT</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/d02mvf.xml#TCRIT">TCRIT</a> (e.g., see <a class="rout" href="../D02/d02mvf.xml">D02MVF</a>). <a class="arg" href="../D02/d02mvf.xml#TCRIT">TCRIT</a> must be specified as 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: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>, <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>.
</div></dd><dt class="paramhead"><a name="ITRACE" id="ITRACE"/>22: &#8194; ITRACE &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On 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"/>23: &#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">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">An illegal input was detected on entry, or after an internal call to <a class="arg" href="#MONITR">MONITR</a>. 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:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>, then 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: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:math>) 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"><a class="arg" href="#FCN">FCN</a> set its error flag (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#FCN_IRES"><m:mi mathcolor="#EE0000" mathvariant="bold">IRES</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>) 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 the 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"><a class="arg" href="#FCN">FCN</a> signalled the integrator to halt the integration and return (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#FCN_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"><a class="arg" href="#MONITR">MONITR</a> set <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MONITR_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 D02NDF is unable to start the integration.</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 linear algebra setup routine <a class="rout" href="../D02/d02nuf.xml">D02NUF</a> was not called prior to calling D02NDF.</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">Since numerical stability and memory are often conflicting requirements when solving ordinary differential systems where the Jacobian matrix is sparse, we provide a diagnostic routine, <a class="rout" href="../D02/d02nxf.xml">D02NXF</a>, whose aim is to inform you how much memory is required to solve the problem and to give you some indication of numerical stability.</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 columnalign="left center right center">
 <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: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: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: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:mrow><m:mo>-</m:mo><m:mn>3.0</m:mn></m:mrow><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: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:mtd><m:mphantom><m:mo>-</m:mo></m:mphantom><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: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.0</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;using 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 solution is computed up to <m:math><m:mn>10.0</m:mn></m:math>&#160;by overshooting and interpolating (<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>) and the intermediate solution computed on an equispaced mesh through <a class="arg" href="#MONITR">MONITR</a>.  The integration algorithm used is the BDF method (setup routine <a class="rout" href="../D02/d02nvf.xml">D02NVF</a>) and a modified Newton method is also used.  The use of the 'N'  (Numerical) and 'S' (Structural) options are illustrated in turn for calculating the Jacobian.</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/d02ndfe.f">Program Text (d02ndfe.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/d02ndfe.r">Program Results (d02ndfe.r)</a></p><div class="figure"><a name="d02ndf-plot" id="d02ndf-plot"/><img src="../figures/d02ndf-plot.png" alt="Example Program Plot for d02ndf-plot"/></div>
<hr/><div><a class="rout" href="../../pdf/D02/d02ndf.pdf">D02NDF (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>
