
\section{Installed Problems}

\subsection{Default Problem}

\noindent The default problem is executed when the {\em complib\_test} program
is executed without specifying an installed problem using the `-p' option.  The
defining equations are those prescribed by Hull, et al. \cite{hull1} as testcase (A1)
in  the DETEST collection.  We state our problem setup as though it were to be executed
with the default integrator -- the fixed-step $4^{th}$-order Runge-Kutta algorithm:

\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
           \dot{y}  =  -y \rule{.5in}{0in} t \in [0,\frac{3}{2}] \\
           y(0)  = 1 
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $y(t_f) \; \; \mbox{with} \; \; t_f = (150 \; \mbox{steps}) \cdot (0.01 \; \mbox{time units per step} )$ \\ 
\>  \\
\> {\bf Exact Solution:} \\
\> \>          $y(t) = \mbox{\normalsize $e$}^{-t}$
\end{tabbing}
}}
\end{center}
\medskip

\noindent Initiating execution of the {\em complib\_test} problem with no options specified
will propagate an orbit in the flow of this vector field using the fixed-step Runge-Kutta
($4^{th}$ order) algorithm with the following result:

\begin{verbatim}

   Integration Method:  Runge-Kutta (4) 
    
   Iter    Stepsize     time        y-Computed        y-Exact        Difference
   ----    --------    ------       ----------        ---------     ------------ 
   0                     0           1                1             0  
   1         0.01        0.01        0.9900498        0.9900498     8.318901e-13  
   2         0.01        0.02        0.9801987        0.9801987     1.647349e-12  
   3         0.01        0.03        0.9704455        0.9704455     2.446376e-12  
   4         0.01        0.04        0.9607894        0.9607894     3.229417e-12  
   5         0.01        0.05        0.9512294        0.9512294     3.996581e-12
\end{verbatim}
\vspace{-.1in}
\hspace{2.8in}$\vdots$
\vspace{-.1in}
\begin{verbatim}
   145       0.01        1.45        0.2345703        0.2345703     2.858133e-11  
   146       0.01        1.46        0.2322363        0.2322363     2.84921e-11  
   147       0.01        1.47        0.2299255        0.2299255     2.840181e-11  
   148       0.01        1.48        0.2276377        0.2276377     2.831049e-11  
   149       0.01        1.49        0.2253727        0.2253727     2.821818e-11  
   150       0.01        1.5         0.2231302        0.2231302     2.812492e-11
\end{verbatim}



\subsection{Problem 1}

\noindent  This ordinary differential equation defines a logistic curve and appears as testcase (A4)
in the DETEST collection.   The complib subsection is capable of numerically integrating a flow
to a fixed value of the independent variable, for each of the algorithms installed in the 
distribution version of dstool.  We illustrate this capability by propagating the trajectory with
initial condition $y(0) = 1$ to the final condition $y(t_f)$ where $t_f=1.5$ time units.

\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
           \dot{y}  =   \frac{y}{4} \left ( 1 - \frac{y}{20} \right )    \rule{.5in}{0in} t \in [0,\frac{3}{2}] \\
           y(0)  = 1 
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $y(t_f) \; \; \mbox{with} \; \; t_f = 1.5 \; $ time units \\ 
\>  \\
\> {\bf Exact Solution:} \\
\> \>	   $y(t) = { \mbox{\rule[-.02in]{0in}{.16in} $20$ } \over
		{\mbox{\rule{0in}{.12in} $ 1 + 19 \mbox{\normalsize $e$}^{-t/4} $ }} } $ 

\end{tabbing}
}}
\end{center}
\medskip



\subsection{Problem 2}

\noindent  This 4-dimensional system of ordinary differential equations is used by Press, et al. \cite{press1,vetter1}
to illustrate the fundamental differences between the $4^{th}$-order fixed stepsize Runge-Kutta, variable-step
Runge-Kutta and Bulirsch-Stoer algorithms as described in the text {\em Numerical Recipes in C}.  

\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
           \dot{y}_1 \rule[-.1in]{0in}{.2in}  =  -y_2 \rule{.5in}{0in} t \in [1,20]  \\
           \dot{y}_2 \rule[-.1in]{0in}{.2in}  =  y_1 - { 1 \over \mbox{\normalsize $t$} } y_2  \\
           \dot{y}_3 \rule[-.1in]{0in}{.2in}  =  y_2 - { 2 \over \mbox{\normalsize $t$}  } y_3  \\
           \dot{y}_4 \rule[-.1in]{0in}{.2in}  =  y_3 - { 3 \over \mbox{\normalsize $t$}  } y_4  
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $y(t_f) \; \; \mbox{where} \; \; t_f = 20.0 \;$ time units \\ 
\end{tabbing}
}}
\end{center}
\medskip




\subsection{Problem 3}

\noindent  This nonlinear chemical reaction problems was considered by Frost \cite{frost1}, and included in
the DETEST collection as testcase (B3). 


\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
           \dot{y}_1 \rule[-.1in]{0in}{.2in}  =  -y_2 \rule{.5in}{0in} t \in [1,20]  \\
           \dot{y}_2 \rule[-.1in]{0in}{.2in}  =  y_1 - y_2^2  \\
           \dot{y}_3 \rule[-.1in]{0in}{.2in}  =  y_2^2  \\
	   y_1(0) = 3  \; \; \; y_2(0) = y_3(0) = 0
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $y(t_n) \; \;$ where $n$ equal $150$ and $h_i \! = \! t_{i+1} \! - \! t{i}$ \\
\> \>  is the integration stepsize (fixed or variable). \\
\end{tabbing}
}}
\end{center}
\medskip


\subsection{Problem 4}

\noindent  This example is derived from Van der Pol's equation, 
\[
   \ddot{y} - \left ( 1-y^2 \right ) \dot{y} + y = 0
\]
and appears as testcase (E2) in the DETEST collection \cite{hull1}.  We note that for a
different choice of parameters this vector field is stiff, and appears in a collection
used to evaluation numerical methods for stiff systems of ODE's \cite{enright1}.  


\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
           \dot{y}_1 \rule[-.1in]{0in}{.2in}  =  y_2 \rule{.5in}{0in} t \in [1,20]  \\
           \dot{y}_2 \rule[-.1in]{0in}{.2in}  =  (1 - y_1^2)y_2 - y_1  \\
	   y_1(0) = 2 \rule{.2in}{0in} y_2(0) = 0 \\
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $y(t_n) \; \;$ where $n$ equal $150$ and $h_i \! = \! t_{i+1} \! - \! t{i}$ \\
\> \>  is the integration stepsize (fixed or variable). \\
\end{tabbing}
}}
\end{center}
\medskip


\subsection{Problem 5}

\noindent  The phase portrait for the integrable Hamiltonian system with Hamiltonian, 
\[
     {\cal H}\left ( y_1,y_2 \right ) = { y_2^2 \over 2 } - { y_2^2 \over 2 } +  { y_1^4 \over 4 }
\]
contains a homoclinic orbit based at the equilibrium point, $(\sqrt{2},0)$.  The analytic 
solution for this connecting orbit may be obtained by elementary methods in terms of
the hyperbolic trigonometric  functions, {\em sech()} and {\em tanh()}.   This invariant 
set for the vector field separates two very different regions of behavior in the phase
portrait: One open set foliated with periodic solutions and a second containing 
unbounded trajectories.  The separatrix for this problem represents the (non-transversal)
intersection of the stable and unstable manifolds for the fixed point at $\; y^* \! = \! (0,0)$.
\medskip

\noindent We use this example to exercise two particular features of the propagation computation engine:
backward integration (in the independent variable, $t$) and terminating the orbit propagation based
on the crossing of a surface of section defined by a user-supplied function.

\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
           \dot{y}_1 \rule[-.1in]{0in}{.2in}  =  y_2 \rule{.5in}{0in} t \! \leq \! 0  \\
           \dot{y}_2 \rule[-.1in]{0in}{.2in}  =  (1 + y_1^2)y_1  \\
	   y_1(0) = \sqrt{2} \rule{.2in}{0in} y_2(0) = 0 \\
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $y(t_f) \; \;$ such that $y(t_f)$ lies in the ball $ \; ||y^* \! - \! y(t_f)||$\raisebox{-.08in}{\scriptsize 2}$ \! < \! 0.01$  \\ 
\> \> \hspace{.38in}  of the fixed point $ \; y^* = (0,0)$.
\>  \\
\> {\bf Exact Solution:} \\
\> \> $
       \begin{array}{l}
           y_1(t) \rule[-.1in]{0in}{.2in}  =  \sqrt{2} \;  \mbox{sech} (t)  \\
           y_2(t) \rule[-.1in]{0in}{.2in}  =  - \sqrt{2} \; \mbox{sech}(t) \; \mbox{tanh}(t)  \\
       \end{array} $ 
\end{tabbing}
}}
\end{center}
\medskip




\subsection{Problem 6}

\noindent This problem is used by Dahlquist \cite{dahlquist1} to demonstrate the instability
of the fixed-step Runga-Kutta method when applied to a stiff ordinary differential equation.

\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
           \dot{y}  =  100 \cdot ( \sin t - y ) \rule{.5in}{0in} t \in [0,\frac{1}{3}] \\
           y(0)  = 0 
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $y(t_f) \; \; \mbox{with} \; \; t_f = 3.0 \;$ time units \\ 
\>  \\
\> {\bf Exact Solution:} \\
\> \>          $y(t) = { \mbox{\rule[-.02in]{0in}{.16in} $ \sin t - 0.01 \cdot \cos t +
			    0.01 \cdot \mbox{\normalsize $e$}^{-100 t}$ } \over
		       {\mbox{\rule{0in}{.12in} $ 1.0001 $ }} } $
\end{tabbing}
}}
\end{center}
\medskip

\noindent The relevant control structure parameters for this problem are the integration time step, the
termination mode and the final time:

\begin{verbatim}
   prop_cntl->prop_mode  = PROP_TF;    /* propagate until final_time is reached */
   prop_cntl->final_time = 3.0;        /* desired final integration time */
   prop_cntl->time_step  = 0.030;      /* UNSTABLE stepsize for RK4 !! */
   prop_cntl->time_step  = 0.025;      /* stable stepsize for RK4 */
\end{verbatim}



\subsection{Problem 7}

\noindent  The complib propagation subsection may be used to iterate a mapping as well as integrate
a vector field;  this example serves to illustrate its capability in the case of the {\em standard
map}, a diffeomorphism defined on the 2-torus, $T^2$.  The initial conditions selected for the
distribution example is for a period-5 periodic orbit.

\medskip
\begin{center}
\fbox{
\parbox{4.6in}{ 
\rule{4.6in}{0in}
\begin{tabbing}
000\=0000000\=00000000000000000000\=0000000000000000000000000000000000000000000000000000000\=00000\= \kill
\> {\bf Given:} \\
\> \> $
       \begin{array}{l}
          f(x,y)  = \left ( x - \omega - y \; , \; {1 \over \mbox{\normalsize $b$}} \left (
		       y + {\mbox{\normalsize $k$} \over \mbox{\normalsize $2 \pi$}}
		       \sin(2 \pi x) \right )  \right ) \\
          \omega = 0.0 \hspace{.15in} k = 0.97 \hspace{0.15in} b = 1.0 
       \end{array} $ \\
\> \\
\> {\bf Find:} \\
\> \> $(x_n,y_n) = f^{15}(x_0,y_0)  \; \; \mbox{where} \; \; (x_0,y_0) = (0.5,0.646696840644)$ \\ 
\>  \\
\> {\bf Exact Solution:} \\
\> \> $ (x_{15},y_{15}) = (x_0,y_0) $
\end{tabbing}
}}
\end{center}
\medskip
