next up previous contents
Next: Defining Auxiliary Functions Up: Installing a New Dynamical Previous: Defining Derivative Information

   
Defining Information About an Inverse

In this section we show how to define an inverse or an approximate inverse for a mapping. We recall that the ``inverse function'' for a vector field is trivial, since integrating the equations of motion backwards in time is the same as integrating forward in time--except we pass in a negative time step to a numerical integrator. Thus if we were installing a vector field, we would skip this section. Moreover, it frequently happens that a mapping does not have an inverse, nor is there any sort of an approximate inverse. In that case, do not edit the inverse routine at all.

For diffeomorphisms, it is sometimes difficult to iterate backwards in time. The Reference Manual  discusses Newton's method  and implicitly iterating a mapping backwards ; it also briefly indicates some of the ways that Newton's method can fail. One of the most important aspects of Newton's algorithm is its dependence on a ``good'' initial guess. In the present section, we will discuss one way to provide a good guess.

For our bouncing ball example, it turns out that we can find an explicit inverse  for fsince 74#74. This inverse is the map given by  
75#75

To enter this inverse into DsTool, locate the section of bball_def.c which looks like

/* ------------------------------------------------------------------------
   function used to define inverse or approximate inverse
   ------------------------------------------------------------------------ */
/*
int user_inv(y,x,p)
double    *y,*x,*p;
{
}
*/
and modify this section to produce
/* ------------------------------------------------------------------------
   function used to define inverse
   ------------------------------------------------------------------------ */
int bball_inv(y,x,p)
double    *y,*x,*p;
{
   double     temp;

   temp = ( p[1] * cos( x[0] ) + x[1] ) / p[0];
   y[0] = x[0] - temp;
   y[1] = temp;
}
Suppose that our map did not have an explicit inverse (or we could not calculate it). Then we would have to resort to using Newton's method to numerically solve for the inverse iterate at each backward step. To do so requires that we provide an initial guess for the inverse image of the current state. If we provide a good guess for the inverse image, then possibly we will require only a few Newton steps to ``sharpen'' our guess and converge to a solution (See the Reference Manual ). Suppose, for the sake of an example, that we were only interested in the bouncing ball map 72#72in the special case that 17#17 is small. Then f can be thought of as a perturbation of the linear map g defined by
76#76
and g-1 can be written as:
77#77
In this case, we could code g-1 into DsTool in place of f-1.  If we were to do this, we would modify bball_def.c to read:
/* ------------------------------------------------------------------------
   function used to define approximate inverse
   ------------------------------------------------------------------------ */
int bball_approx_inv(y,x,p)
double    *y,*x,*p;
{
   y[0] = x[0] - x[1] / p[0];
   y[1] = x[1] / p[0];
}
Of course, we must inform DsTool whether to interpret the procedure as a definition of the actual inverse or merely as an approximation; Section [*] explains how this is done.


next up previous contents
Next: Defining Auxiliary Functions Up: Installing a New Dynamical Previous: Defining Derivative Information
John Lapeyre
1998-09-04