Prev Next

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@
ODE Fitting Using Simple Representation

Purpose
In this section we represent the objective and constraint functions, (in the simultaneous forward and reverse optimization problem) using the simple representation in the sense of cppad_ipopt_nlp.

Argument Vector
The argument vector that we are optimizing with respect to ( @(@ x @)@ in cppad_ipopt_nlp ) has the following structure @[@ x = ( y^0 , \cdots , y^{S(Nz)} , a ) @]@ Note that @(@ x \in \B{R}^{S(Nz) + Na} @)@ and @[@ \begin{array}{rcl} y^i & = & ( x_{Ny * i} , \ldots , x_{Ny * i + Ny - 1} ) \\ a & = & ( x_{Ny *S(Nz) + Ny} , \ldots , x_{Ny * S(Nz) + Na - 1} ) \end{array} @]@

Objective Function
The objective function ( @(@ fg_0 (x) @)@ in cppad_ipopt_nlp ) has the following representation, @[@ fg_0 (x) = \sum_{i=1}^{Nz} H_i ( y^{S(i)} , a ) @]@

Initial Condition Constraint
For @(@ i = 1 , \ldots , Ny @)@, we define the component functions @(@ fg_i (x) @)@, and corresponding constraint equations, by @[@ 0 = fg_i ( x ) = y_i^0 - F_i (a) @]@

Trapezoidal Approximation Constraint
For @(@ i = 1, \ldots , S(Nz) @)@, and for @(@ j = 1 , \ldots , Ny @)@, we define the component functions @(@ fg_{Ny*i + j} (x) @)@, and corresponding constraint equations, by @[@ 0 = fg_{Ny*i + j } = y_j^{i} - y_j^{i-1} - \left[ G_j ( y^i , a ) + G_j ( y^{i-1} , a ) \right] * \frac{t_i - t_{i-1} }{ 2 } @]@

Source
The file ipopt_nlp_ode_simple.hpp contains source code for this representation of the objective and constraints.
Input File: cppad_ipopt/example/ode2.omh