<?xml version='1.0'?>
<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:math='http://www.w3.org/1998/Math/MathML'
>
<head>
<title>ODE Fitting Using Fast Representation</title>
<meta name="description" id="description" content="ODE Fitting Using Fast Representation"/>
<meta name="keywords" id="keywords" content=" representation cppad_ipopt_nlp ode "/>
<style type='text/css'>
body { color : black }
body { background-color : white }
A:link { color : blue }
A:visited { color : purple }
A:active { color : purple }
</style>
<script type='text/javascript' language='JavaScript' src='_ipopt_nlp_ode_fast_xml.js'>
</script>
</head>
<body>
<table><tr>
<td>
<a href="http://www.coin-or.org/CppAD/" target="_top"><img border="0" src="_image.gif"/></a>
</td>
<td><a href="ipopt_nlp_ode_simple.hpp.xml" target="_top">Prev</a>
</td><td><a href="ipopt_nlp_ode_fast.hpp.xml" target="_top">Next</a>
</td><td>
<select onchange='choose_across0(this)'>
<option>Index-&gt;</option>
<option>contents</option>
<option>reference</option>
<option>index</option>
<option>search</option>
<option>external</option>
</select>
</td>
<td>
<select onchange='choose_up0(this)'>
<option>Up-&gt;</option>
<option>CppAD</option>
<option>Appendix</option>
<option>deprecated</option>
<option>cppad_ipopt_nlp</option>
<option>ipopt_nlp_ode</option>
<option>ipopt_nlp_ode_fast</option>
</select>
</td>
<td>
<select onchange='choose_down3(this)'>
<option>deprecated-&gt;</option>
<option>include_deprecated</option>
<option>FunDeprecated</option>
<option>omp_max_thread</option>
<option>TrackNewDel</option>
<option>omp_alloc</option>
<option>memory_leak</option>
<option>epsilon</option>
<option>test_vector</option>
<option>cppad_ipopt_nlp</option>
<option>old_atomic</option>
</select>
</td>
<td>
<select onchange='choose_down2(this)'>
<option>cppad_ipopt_nlp-&gt;</option>
<option>ipopt_nlp_get_started.cpp</option>
<option>ipopt_nlp_ode</option>
<option>ipopt_ode_speed.cpp</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>ipopt_nlp_ode-&gt;</option>
<option>ipopt_nlp_ode_problem</option>
<option>ipopt_nlp_ode_simple</option>
<option>ipopt_nlp_ode_fast</option>
<option>ipopt_nlp_ode_run.hpp</option>
<option>ipopt_nlp_ode_check.cpp</option>
</select>
</td>
<td>
<select onchange='choose_down0(this)'>
<option>ipopt_nlp_ode_fast-&gt;</option>
<option>ipopt_nlp_ode_fast.hpp</option>
</select>
</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Purpose</option>
<option>Objective Function</option>
<option>---..Range Indices I(k,0)</option>
<option>---..Domain Indices J(k,0)</option>
<option>Initial Condition</option>
<option>---..Range Indices I(k,0)</option>
<option>---..Domain Indices J(k,0)</option>
<option>Trapezoidal Approximation</option>
<option>---..Range Indices I(k,0)</option>
<option>---..Domain Indices J(k,0)</option>
<option>Source</option>
</select>
</td>
</tr></table><br/>



<center><b><big><big>ODE Fitting Using Fast Representation</big></big></b></center>
<br/>
<b><big><a name="Purpose" id="Purpose">Purpose</a></big></b>
<br/>
In this section we represent a more complex representation of the 
simultaneous forward and reverse ODE fitting problem (described above).
The representation defines the problem using
simpler functions that are faster to differentiate
(either by hand coding or by using AD).

<br/>
<br/>
<b><big><a name="Objective Function" id="Objective Function">Objective Function</a></big></b>
<br/>
We use the following representation for the
<a href="ipopt_nlp_ode_simple.xml#Objective Function" target="_top"><span style='white-space: nowrap'>objective&#xA0;function</span></a>
:
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow></math>

,
we define the function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msup>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
</mrow>
</msup>
<mo stretchy="false">&#x02192;</mo>
<mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
</mrow></math>


by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<msub><mi mathvariant='italic'>fg</mi>
<mn>0</mn>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<munderover><mo displaystyle='true' largeop='true'>&#x02211;</mo>
<mrow><mi mathvariant='italic'>i</mi>
<mo stretchy="false">=</mo>
<mn>1</mn>
</mrow>
<mrow><mi mathvariant='italic'>Nz</mi>
</mrow>
</munderover>
<msub><mi mathvariant='italic'>H</mi>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mrow><mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
</mrow>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<msub><mi mathvariant='italic'>fg</mi>
<mn>0</mn>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<munderover><mo displaystyle='true' largeop='true'>&#x02211;</mo>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
</mrow>
<mrow><mi mathvariant='italic'>Nz</mi>
<mn>-1</mn>
</mrow>
</munderover>
<msup><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msup>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mtd></mtr></mtable>
</mrow></math>

where for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Nz</mi>
<mn>-1</mn>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">&#x02208;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
</mrow>
</msup>
</mrow></math>

 is defined by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">=</mo>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mrow><mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mrow>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mrow></math>



<br/>
<br/>
<b><a name="Objective Function.Range Indices I(k,0)" id="Objective Function.Range Indices I(k,0)">Range Indices I(k,0)</a></b>
<br/>
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow></math>

,
the range index in the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 
corresponding to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msup>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mrow></math>

 is 0.
Thus, the range indices are given by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mo stretchy="false">}</mo>
</mrow></math>

 for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Nz</mi>
<mn>-1</mn>
</mrow></math>

.

<br/>
<br/>
<b><a name="Objective Function.Domain Indices J(k,0)" id="Objective Function.Domain Indices J(k,0)">Domain Indices J(k,0)</a></b>
<br/>
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow></math>

,
the components of the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
</mrow></math>


corresponding to the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
</mrow></math>

 are

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mrow><mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mo stretchy="false">(</mo>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo stretchy="false">)</mo>
</mtd></mtr></mtable>
</mrow></math>

Thus, the domain indices are given by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mo stretchy="false">{</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

<br/>
<b><big><a name="Initial Condition" id="Initial Condition">Initial Condition</a></big></b>
<br/>
We use the following representation for the
<a href="ipopt_nlp_ode_simple.xml#Initial Condition Constraint" target="_top"><span style='white-space: nowrap'>initial&#xA0;condition&#xA0;constraint</span></a>
:
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Nz</mi>
</mrow></math>

 we define the function 

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msup>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>Ny</mi>
</mrow>
</msup>
<mo stretchy="false">&#x000D7;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>Na</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
</mrow>
</msup>
</mrow></math>

 by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<mn>0</mn>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<msub><mi mathvariant='italic'>fg</mi>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<msubsup><mi mathvariant='italic'>y</mi>
<mi mathvariant='italic'>i</mi>
<mn>0</mn>
</msubsup>
<mo stretchy="false">-</mo>
<msub><mi mathvariant='italic'>F</mi>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<mn>0</mn>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<msubsup><mi mathvariant='italic'>r</mi>
<mrow><mi mathvariant='italic'>i</mi>
<mn>-1</mn>
</mrow>
<mi mathvariant='italic'>k</mi>
</msubsup>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<msubsup><mi mathvariant='italic'>y</mi>
<mi mathvariant='italic'>i</mi>
<mn>0</mn>
</msubsup>
<mo stretchy="false">-</mo>
<msub><mi mathvariant='italic'>F</mi>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mtd></mtr></mtable>
</mrow></math>

where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">=</mo>
<mn>1</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Ny</mi>
</mrow></math>

 and
where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">&#x02208;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
</mrow>
</msup>
</mrow></math>

 is defined by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">=</mo>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mn>0</mn>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mrow></math>

. 

<br/>
<br/>
<b><a name="Initial Condition.Range Indices I(k,0)" id="Initial Condition.Range Indices I(k,0)">Range Indices I(k,0)</a></b>
<br/>
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Nz</mi>
</mrow></math>

,
the range index in the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 
corresponding to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msup>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mrow></math>

 are

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mo stretchy="false">{</mo>
<mn>1</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">}</mo>
</mrow></math>

.

<br/>
<br/>
<b><a name="Initial Condition.Domain Indices J(k,0)" id="Initial Condition.Domain Indices J(k,0)">Domain Indices J(k,0)</a></b>
<br/>
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Nz</mi>
</mrow></math>

,
the components of the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
</mrow></math>


corresponding to the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
</mrow></math>

 are

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msup>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mn>0</mn>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mo stretchy="false">(</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>0</mn>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mn>-1</mn>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo stretchy="false">)</mo>
</mtd></mtr></mtable>
</mrow></math>

Thus, the domain indices are given by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

<br/>
<b><big><a name="Trapezoidal Approximation" id="Trapezoidal Approximation">Trapezoidal Approximation</a></big></b>
<br/>
We use the following representation for the
<a href="ipopt_nlp_ode_simple.xml#Trapezoidal Approximation Constraint" target="_top"><span style='white-space: nowrap'>trapezoidal&#xA0;approximation&#xA0;constraint</span></a>
:
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>1</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>Nz</mi>
</mrow></math>

,
we define the function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>r</mi>
<mrow><mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>k</mi>
</mrow>
</msup>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mn>2</mn>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
</mrow>
</msup>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>Ny</mi>
</mrow>
</msup>
</mrow></math>

 by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<msup><mi mathvariant='italic'>r</mi>
<mrow><mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>k</mi>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>y</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>w</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>y</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>w</mi>
<mo stretchy="false">-</mo>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>G</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>y</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>G</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>w</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
<mo stretchy="false">*</mo>
<mfrac><mrow><mi mathvariant='normal'>&#x00394;</mi>
<msub><mi mathvariant='italic'>t</mi>
<mi mathvariant='italic'>k</mi>
</msub>
</mrow>
<mrow><mn>2</mn>
</mrow>
</mfrac>
</mrow></math>

For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>N</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
<mn>-1</mn>
</mrow></math>

,
using the notation 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mn>-1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

,
the corresponding trapezoidal approximation is represented by 

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<mn>0</mn>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<msub><mi mathvariant='italic'>fg</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>i</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<msup><mi mathvariant='italic'>y</mi>
<mi mathvariant='italic'>i</mi>
</msup>
<mo stretchy="false">-</mo>
<msup><mi mathvariant='italic'>y</mi>
<mrow><mi mathvariant='italic'>i</mi>
<mn>-1</mn>
</mrow>
</msup>
<mo stretchy="false">-</mo>
<mrow><mo stretchy="true">[</mo><mrow><mi mathvariant='italic'>G</mi>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mi mathvariant='italic'>i</mi>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>G</mi>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mrow><mi mathvariant='italic'>i</mi>
<mn>-1</mn>
</mrow>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mrow><mo stretchy="true">]</mo></mrow>
<mo stretchy="false">*</mo>
<mfrac><mrow><mi mathvariant='normal'>&#x00394;</mi>
<msub><mi mathvariant='italic'>t</mi>
<mi mathvariant='italic'>k</mi>
</msub>
</mrow>
<mrow><mn>2</mn>
</mrow>
</mfrac>
</mtd></mtr><mtr><mtd columnalign="right" >
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<msup><mi mathvariant='italic'>r</mi>
<mrow><mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>k</mi>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mtd></mtr></mtable>
</mrow></math>

where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msup>
<mo stretchy="false">&#x02208;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mn>2</mn>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
</mrow>
</msup>
</mrow></math>

 is defined by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msup>
<mo stretchy="false">=</mo>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mrow><mi mathvariant='italic'>i</mi>
<mn>-1</mn>
</mrow>
</msup>
<mo stretchy="false">,</mo>
<msup><mi mathvariant='italic'>y</mi>
<mi mathvariant='italic'>i</mi>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mrow></math>

. 

<br/>
<br/>
<b><a name="Trapezoidal Approximation.Range Indices I(k,0)" id="Trapezoidal Approximation.Range Indices I(k,0)">Range Indices I(k,0)</a></b>
<br/>
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mn>2</mn>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>Nz</mi>
</mrow></math>

,
and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>N</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
<mn>-1</mn>
</mrow></math>

,
the range index in the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 
corresponding to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msup>
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mrow></math>

 are

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mo stretchy="false">{</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mn>2</mn>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
<mo stretchy="false">}</mo>
</mrow></math>


where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mn>-1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

.

<br/>
<br/>
<b><a name="Trapezoidal Approximation.Domain Indices J(k,0)" id="Trapezoidal Approximation.Domain Indices J(k,0)">Domain Indices J(k,0)</a></b>
<br/>
For 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mn>2</mn>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>Nz</mi>
</mrow></math>

,
and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>N</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
<mn>-1</mn>
</mrow></math>

,
define 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mn>-1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

.
The components of the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
</mrow></math>


corresponding to the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msup>
</mrow></math>

 are
(and the function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 in <a href="cppad_ipopt_nlp.xml" target="_top"><span style='white-space: nowrap'>cppad_ipopt_nlp</span></a>
 )

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<msup><mi mathvariant='italic'>u</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msup>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mo stretchy="false">(</mo>
<msup><mi mathvariant='italic'>y</mi>
<mrow><mi mathvariant='italic'>i</mi>
<mn>-1</mn>
</mrow>
</msup>
<mo stretchy="false">,</mo>
<msup><mi mathvariant='italic'>y</mi>
<mi mathvariant='italic'>i</mi>
</msup>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>a</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mo stretchy="false">(</mo>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mn>-1</mn>
<mo stretchy="false">)</mo>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
</mrow>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow>
</msub>
<mo stretchy="false">)</mo>
</mtd></mtr></mtable>
</mrow></math>

Thus, the domain indices are given by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mo stretchy="false">{</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mn>-1</mn>
<mo stretchy="false">)</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">-</mo>
<mn>1</mn>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02026;</mo>
<mspace width='.3em'/>
<mo stretchy="false">,</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>S</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>Nz</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Ny</mi>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>Na</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

<br/>
<b><big><a name="Source" id="Source">Source</a></big></b>
<br/>
The file <a href="ipopt_nlp_ode_fast.hpp.xml" target="_top"><span style='white-space: nowrap'>ipopt_nlp_ode_fast.hpp</span></a>

contains source code for this representation of the objective
and constraints.

 

<hr/>Input File: cppad_ipopt/example/ode2.omh

</body>
</html>
