next up previous contents
Next: Parameters Up: Defining Labels and Initial Previous: Defining Labels and Initial

  
Variables

For our example, we have two spatial phase space variables, namely 64#64 and v. Because the equations of motion (Equation [*]) are invariant under the coordinate transformation 78#78, 79#79, it is natural to display 64#64 on the interval 80#80. There is no ``natural'' interval to use in displaying the v coordinate, since vcan be any real number, but we will choose the interval [-30, 30] as a default range on which to display v. We will also need to choose a default initial condition 81#81, which we arbitrarily select to be the origin, (0,0).

After implementing these choices, the relevant code in bball_init() looks like:

int            n_varb=2;                      /* dim of phase space           */
static char    *variable_names[]={"phi","v"}; /* list of phase varb names     */
static double  variables[]={0.,0.};           /* default varb initial values  */
static double  variable_min[]={0.,-30.};      /* default varb min for display */
static double  variable_max[]={TWOPI,30};     /* default varb max for display */
We remark that TWOPI (82#82)  and PI (83#83)  are two constants  which the user may use in defining a dynamical system.

Although we have defined labels and initial values for the spatial variables, the independent variable (usually thought of as time) is also considered to be a member of every phase space.  The code which provides this information is given by:

static char    *indep_varb_name="time";  /* name of indep variable             */
static double  indep_varb_min=0.;        /* default indep varb min for display */
static double  indep_varb_max=10000.;    /* default indep varb max for display */
In fact, this is the way the code looked when we copied it from GENERIC.c, so we do not need to make any changes to the code. If we wanted to call the independent variable ``iteration'' instead of ``time,'' or if we wanted to change the default plotting range, then the code segment above would have to be appropriately modified.


next up previous contents
Next: Parameters Up: Defining Labels and Initial Previous: Defining Labels and Initial
John Lapeyre
1998-09-04