<?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>D02PXF : 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/d02pxf.pdf">D02PXF (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/>D02PXF</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">D02PXF computes the solution of a system of ordinary differential equations using interpolation anywhere on an integration step taken by <a class="rout" href="../D02/d02pdf.xml">D02PDF</a>.</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;D02PXF&#160;(</td><td class="tdfspec2"><a class="arg" href="#TWANT">TWANT</a>, <a class="arg" href="#REQEST">REQEST</a>, <a class="arg" href="#NWANT">NWANT</a>, <a class="arg" href="#YWANT">YWANT</a>, <a class="arg" href="#YPWANT">YPWANT</a>, <a class="arg" href="#F">F</a>, <a class="arg" href="#WORK">WORK</a>, <a class="arg" href="#WRKINT">WRKINT</a>, <a class="arg" href="#LENINT">LENINT</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NWANT, LENINT, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">TWANT, YWANT(*), YPWANT(*), WORK(*), WRKINT(LENINT)</td></tr><tr><td class="tdfspec1">CHARACTER*1</td><td class="tdfspec2">REQEST</td></tr><tr><td class="tdfspec1">EXTERNAL</td><td class="tdfspec2">F</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D02PXF and its associated routines (<a class="rout" href="../D02/d02pdf.xml">D02PDF</a>, <a class="rout" href="../D02/d02pvf.xml">D02PVF</a>, <a class="rout" href="../D02/d02pwf.xml">D02PWF</a>, <a class="rout" href="../D02/d02pyf.xml">D02PYF</a> and <a class="rout" href="../D02/d02pzf.xml">D02PZF</a>)  solve the initial value problem for a first-order system of ordinary differential equations.  The routines, based on Runge&#8211;Kutta methods and derived from RKSUITE (see <a class="ref" href="#ref477">Brankin <span class="italic">et al.</span> (1991)</a>), integrate

<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>f</m:mi><m:mfenced separators=""><m:mi>t</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mtext>&#8195; given &#8195;</m:mtext><m:mi>y</m:mi><m:mfenced separators=""><m:msub><m:mi>t</m:mi><m:mn>0</m:mn></m:msub></m:mfenced><m:mo>=</m:mo><m:msub><m:mi>y</m:mi><m:mn>0</m:mn></m:msub>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>y</m:mi></m:math>&#160;is the vector of <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;solution components and <m:math><m:mi>t</m:mi></m:math>&#160;is the independent variable.</div><div class="paramtext"><a class="rout" href="../D02/d02pdf.xml">D02PDF</a> computes the solution at the end of an integration step.  Using the information computed on that step D02PXF computes the solution by interpolation at any point on that step.  It cannot be used if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>&#160;was specified in the call to setup routine <a class="rout" href="../D02/d02pvf.xml">D02PVF</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref477" id="ref477"/>Brankin R W, Gladwell I and Shampine L F (1991)  RKSUITE: A suite of Runge&#8211;Kutta codes for the initial value problems for ODEs <i>SoftReport 91-S1</i> Southern Methodist University </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="TWANT" id="TWANT"/>1: &#160;&#160;&#8194; TWANT &#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 value of the independent variable where a solution is desired.</div></dd><dt class="paramhead"><a name="REQEST" id="REQEST"/>2: &#160;&#160;&#8194; REQEST &#8211; CHARACTER*1<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: determines whether the solution and/or its first derivative are to be computed.

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math></dt>
<dd>Compute the approximate solution only.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'D'</m:mtext></m:math></dt>
<dd>Compute the approximate first derivative of the solution only.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'B'</m:mtext></m:math></dt>
<dd>Compute both the approximate solution and its first derivative.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'D'</m:mtext></m:math>&#160;or <m:math><m:mtext>'B'</m:mtext></m:math>.
</div></dd><dt class="paramhead"><a name="NWANT" id="NWANT"/>3: &#160;&#160;&#8194; NWANT &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the number of components of the solution to be computed. The first <a class="arg" href="#NWANT">NWANT</a> components are evaluated.</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="#NWANT"><m:mi mathcolor="#EE0000" mathvariant="bold">NWANT</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mi mathvariant="italic">n</m:mi></m:math>, where <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;is specified by <a class="arg" href="../D02/d02pvf.xml#NEQ">NEQ</a> in the prior call to <a class="rout" href="../D02/d02pvf.xml">D02PVF</a>.</div></dd><dt class="paramhead"><a name="YWANT" id="YWANT"/>4: &#160;&#160;&#8194; YWANT(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#YWANT">YWANT</a>
must be at least
<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NWANT"><m:mi mathcolor="#EE0000" mathvariant="bold">NWANT</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>&#160;or <m:math><m:mtext>'B'</m:mtext></m:math>, and at least <m:math><m:mn>1</m:mn></m:math>&#160;otherwise.</div>
<div class="paramtext"><i>On exit</i>: an approximation to the first <a class="arg" href="#NWANT">NWANT</a> components of the solution at <a class="arg" href="#TWANT">TWANT</a> if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>&#160;or <m:math><m:mtext>'B'</m:mtext></m:math>. Otherwise <a class="arg" href="#YWANT">YWANT</a> is not defined.</div></dd><dt class="paramhead"><a name="YPWANT" id="YPWANT"/>5: &#160;&#160;&#8194; YPWANT(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#YPWANT">YPWANT</a>
must be at least
<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NWANT"><m:mi mathcolor="#EE0000" mathvariant="bold">NWANT</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'D'</m:mtext></m:math>&#160;or <m:math><m:mtext>'B'</m:mtext></m:math>, and at least <m:math><m:mn>1</m:mn></m:math>&#160;otherwise.</div>
<div class="paramtext"><i>On exit</i>: an approximation to the first <a class="arg" href="#NWANT">NWANT</a> components of the first derivative at <a class="arg" href="#TWANT">TWANT</a> if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#REQEST"><m:mi mathcolor="#EE0000" mathvariant="bold">REQEST</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'D'</m:mtext></m:math>&#160;or <m:math><m:mtext>'B'</m:mtext></m:math>. Otherwise <a class="arg" href="#YPWANT">YPWANT</a> is not defined.</div></dd><dt class="paramhead"><a name="F" id="F"/>6: &#160;&#160;&#8194; F &#8211; SUBROUTINE, supplied by the user.<span class="pclass">External Procedure</span></dt><dd>
<div class="paramtext"><a class="arg" href="#F">F</a> must evaluate the functions <m:math><m:msub><m:mi>f</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;(that is the first derivatives <m:math><m:msubsup><m:mi>y</m:mi><m:mi>i</m:mi><m:mo>&#8242;</m:mo></m:msubsup></m:math>) for given values of the arguments <m:math><m:mi>t</m:mi><m:mo>,</m:mo><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:math>. It must be the same procedure as supplied to <a class="rout" href="../D02/d02pdf.xml">D02PDF</a>.</div><div class="subprog">
<div class="paramtext">The specification of <a class="arg" href="#F">F</a> is:</div><table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;F&#160;(</td><td class="tdfspec2"><a class="arg" href="../D02/d02pxf.xml#F_T">T</a>, <a class="arg" href="../D02/d02pxf.xml#F_Y">Y</a>, <a class="arg" href="../D02/d02pxf.xml#F_YP">YP</a>)</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">T, Y(<m:math><m:mi mathvariant="italic">n</m:mi></m:math>), YP(<m:math><m:mi mathvariant="italic">n</m:mi></m:math>)</td></tr></table>
<div class="paramtext">where <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;is the value of <a class="arg" href="../D02/d02pvf.xml#NEQ">NEQ</a> in the call of D02PXF.</div>
<dl><dt class="paramhead"><a name="F_T" id="F_T"/>1: &#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="F_Y" id="F_Y"/>2: &#160;&#160;&#8194; Y(<m:math><m:mi mathvariant="italic">n</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>: the current values of the dependent variables, <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:mi mathvariant="italic">n</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="F_YP" id="F_YP"/>3: &#160;&#160;&#8194; YP(<m:math><m:mi mathvariant="italic">n</m:mi></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the values of <m:math><m:msub><m:mi>f</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:mi mathvariant="italic">n</m:mi></m:math>.</div></dd></dl>
</div>
<div class="paramtext"><a class="arg" href="#F">F</a> must be declared as EXTERNAL in the (sub)program from which D02PXF 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="WORK" id="WORK"/>7: &#160;&#160;&#8194; WORK(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#WORK">WORK</a>
must be at least
<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#LENWRK"><m:mi mathcolor="#EE0000" mathvariant="bold">LENWRK</m:mi></m:maction></m:math>&#160;(see <a class="rout" href="../D02/d02pvf.xml">D02PVF</a>).</div>
<div class="paramtext"><i>On entry</i>: this <b>must</b> be the same array as supplied to <a class="rout" href="../D02/d02pdf.xml">D02PDF</a> and <b>must</b> remain unchanged between calls.</div>
<div class="paramtext"><i>On exit</i>: contains information about the integration for use on subsequent calls to <a class="rout" href="../D02/d02pdf.xml">D02PDF</a> or other associated routines.</div></dd><dt class="paramhead"><a name="WRKINT" id="WRKINT"/>8: &#160;&#160;&#8194; WRKINT(<a class="arg" href="#LENINT">LENINT</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: must be the same array as supplied in previous calls, if any, and must remain unchanged between calls to D02PXF.</div>
<div class="paramtext"><i>On exit</i>: the contents are modified.</div></dd><dt class="paramhead"><a name="LENINT" id="LENINT"/>9: &#160;&#160;&#8194; LENINT &#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="#WRKINT">WRKINT</a> as declared in the (sub)program from which D02PXF is called.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LENINT"><m:mi mathcolor="#EE0000" mathvariant="bold">LENINT</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;in the prior call to <a class="rout" href="../D02/d02pvf.xml">D02PVF</a>;</li>
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LENINT"><m:mi mathcolor="#EE0000" mathvariant="bold">LENINT</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mi mathvariant="italic">n</m:mi><m:mo>+</m:mo><m:mn>5</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NWANT"><m:mi mathcolor="#EE0000" mathvariant="bold">NWANT</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math>&#160;and <m:math><m:mi mathvariant="italic">n</m:mi></m:math>&#160;is specified by <a class="arg" href="../D02/d02pvf.xml#NEQ">NEQ</a> in the prior call to <a class="rout" href="../D02/d02pvf.xml">D02PVF</a>.</li>
</ul></div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>10: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>). <div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn mathvariant="bold">1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div></div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeq1" id="IFeq1"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>
<div class="paramtext">On entry, an invalid input value for <a class="arg" href="#NWANT">NWANT</a> or <a class="arg" href="#LENINT">LENINT</a> was detected or an invalid call to D02PXF was made, for example without a previous call to the integration routine <a class="rout" href="../D02/d02pdf.xml">D02PDF</a>, or after an error return from <a class="rout" href="../D02/d02pdf.xml">D02PDF</a>, or if <a class="rout" href="../D02/d02pdf.xml">D02PDF</a> was being used with <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math>.  You cannot continue integrating the problem.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The computed values will be of a similar accuracy to that computed by <a class="rout" href="../D02/d02pdf.xml">D02PDF</a>.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">None.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example solves the equation

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msup><m:mi>y</m:mi><m:mrow><m:mo>&#8242;</m:mo><m:mo>&#8242;</m:mo></m:mrow></m:msup>
 <m:mo>=</m:mo>
 <m:mo>-</m:mo><m:mi>y</m:mi>
 <m:mtext>, &#8195;</m:mtext>
 <m:mi>y</m:mi><m:mfenced separators=""><m:mn>0</m:mn></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>, &#8195;</m:mtext>
 <m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mfenced separators=""><m:mn>0</m:mn></m:mfenced><m:mo>=</m:mo><m:mn>1</m:mn>
</m:math></td><td class="formula2"/></tr></table></div>

reposed as

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msubsup><m:mi>y</m:mi><m:mn>1</m:mn><m:mo>&#8242;</m:mo></m:msubsup>
 <m:mo>=</m:mo>
 <m:msub><m:mi>y</m:mi><m:mn>2</m:mn></m:msub>
</m:math></td><td class="formula2"/></tr></table></div><div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msubsup><m:mi>y</m:mi><m:mn>2</m:mn><m:mo>&#8242;</m:mo></m:msubsup>
 <m:mo>=</m:mo>
 <m:mo>-</m:mo><m:msub><m:mi>y</m:mi><m:mn>1</m:mn></m:msub>
</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:mrow><m:mn>2</m:mn><m:mi>&#960;</m:mi></m:mrow></m:mfenced></m:math>&#160;with initial conditions <m:math><m:msub><m:mi>y</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>&#160;and <m:math><m:msub><m:mi>y</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mn>1.0</m:mn></m:math>.  Relative error control is used with threshold values of <m:math><m:mtext>1.0D&#8722;8</m:mtext></m:math>&#160;for each solution component.  <a class="rout" href="../D02/d02pdf.xml">D02PDF</a> is used to integrate the problem one step at a time and D02PXF is used to compute the first component of the solution and its derivative at intervals of length <m:math><m:mi>&#960;</m:mi><m:mo>/</m:mo><m:mn>8</m:mn></m:math>&#160;across the range whenever these points lie in one of those integration steps.  A moderate order Runge&#8211;Kutta method (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math>) is also used with tolerances <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>1.0D&#8722;3</m:mtext></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="../D02/d02pvf.xml#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>1.0D&#8722;4</m:mtext></m:math>&#160;in turn so that solutions may be compared.  The value of <m:math><m:mi>&#960;</m:mi></m:math>&#160;is obtained by using <a class="rout" href="../X01/x01aaf.xml">X01AAF</a>.</div><div class="paramtext">Note that the length of <a class="arg" href="#WORK">WORK</a> is large enough for any valid combination of input arguments to <a class="rout" href="../D02/d02pvf.xml">D02PVF</a> and the length of <a class="arg" href="#WRKINT">WRKINT</a> is large enough for any valid value of the parameter <a class="arg" href="#NWANT">NWANT</a>.</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/d02pxfe.f">Program Text (d02pxfe.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/d02pxfe.r">Program Results (d02pxfe.r)</a></p><div class="figure"><a name="d02pxf-plot" id="d02pxf-plot"/><img src="../figures/d02pxf-plot.png" alt="Example Program Plot for d02pxf-plot"/></div>
<hr/><div><a class="rout" href="../../pdf/D02/d02pxf.pdf">D02PXF (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>
