1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998)
originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Variables</TITLE>
<META NAME="description" CONTENT="Variables">
<META NAME="keywords" CONTENT="userman">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="userman.css">
<LINK REL="next" HREF="node59.html">
<LINK REL="previous" HREF="node57.html">
<LINK REL="up" HREF="node57.html">
<LINK REL="next" HREF="node59.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1263"
HREF="node59.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/lib/latex2html/icons.gif/next_motif.gif"></A>
<A NAME="tex2html1260"
HREF="node57.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/lib/latex2html/icons.gif/up_motif.gif"></A>
<A NAME="tex2html1254"
HREF="node57.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/lib/latex2html/icons.gif/previous_motif.gif"></A>
<A NAME="tex2html1262"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="/usr/lib/latex2html/icons.gif/contents_motif.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1264"
HREF="node59.html">Parameters</A>
<B> Up:</B> <A NAME="tex2html1261"
HREF="node57.html">Defining Labels and Initial</A>
<B> Previous:</B> <A NAME="tex2html1255"
HREF="node57.html">Defining Labels and Initial</A>
<BR>
<BR>
<!--End of Navigation Panel-->
<H3><A NAME="SECTION00625100000000000000"> </A><A NAME="varbs"> </A>
<BR>
Variables
</H3>
For our example, we have two spatial phase space variables, namely 64#64
and <I>v</I>.
Because the equations of motion (Equation <A HREF="node53.html#bball"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]"
SRC="/usr/lib/latex2html/icons.gif/cross_ref_motif.gif"></A>) are invariant under the
coordinate transformation
<!-- MATH: $\phi \to \phi + 2n \pi$ -->
78#78,
<!-- MATH: $n \in \zed$ -->
79#79,
it is natural to display 64#64
on the interval
<!-- MATH: $[0, 2 \pi]$ -->
80#80.
There is no ``natural''
interval to use in displaying the <I>v</I> coordinate, since <I>v</I>can be any real number, but we will choose the interval [-30, 30] as a default range
on which to display <I>v</I>.
We will also need to choose a default initial condition
<!-- MATH: $(\phi_0, v_0)$ -->
81#81,
which we arbitrarily
select to be the origin, (0,0).
<P>
After implementing these choices, the relevant code in bball_init() looks like:
<PRE>
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 */
</PRE>
We remark that TWOPI (82#82)<A NAME="2084"> </A> and PI (83#83)<A NAME="2086"> </A>
are two constants<A NAME="2087"> </A> which the user may use in
defining a dynamical system.
<P>
Although we have defined labels
and initial values for the <EM>spatial</EM> variables, the independent variable
(usually thought of as time) is also considered to be a member
of every phase space.<A NAME="2089"> </A>
The code which provides this information is given by:
<PRE>
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 */
</PRE>
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.
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1263"
HREF="node59.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/lib/latex2html/icons.gif/next_motif.gif"></A>
<A NAME="tex2html1260"
HREF="node57.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/lib/latex2html/icons.gif/up_motif.gif"></A>
<A NAME="tex2html1254"
HREF="node57.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/lib/latex2html/icons.gif/previous_motif.gif"></A>
<A NAME="tex2html1262"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="/usr/lib/latex2html/icons.gif/contents_motif.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1264"
HREF="node59.html">Parameters</A>
<B> Up:</B> <A NAME="tex2html1261"
HREF="node57.html">Defining Labels and Initial</A>
<B> Previous:</B> <A NAME="tex2html1255"
HREF="node57.html">Defining Labels and Initial</A>
<!--End of Navigation Panel-->
<ADDRESS>
<I>John Lapeyre</I>
<BR><I>1998-09-04</I>
</ADDRESS>
</BODY>
</HTML>
|